GithubHelp home page GithubHelp logo

Comments (5)

eri-trabiccolo avatar eri-trabiccolo commented on June 14, 2024

I also ran an export/import but wasn't able to reproduce the issue :/

from customizr.

eri-trabiccolo avatar eri-trabiccolo commented on June 14, 2024

What do you think if we put a call to action button in the post list customize section to re-generate the thumb field (this button should have a description which doesn't make users think we re-generate the thumbnails ). The code could be something simple like the following (the LIMIT is to avoid memory issues - we'll actually avoid them this way? need to test this aspect):

function generate_tc_thumb_fld(){
  global $wpdb;
  $_has_posts = true;
  $_offset = 0;

  while ( $_has_posts ) {
    $_posts = $wpdb->get_results( "
      SELECT `ID` FROM $wpdb->posts 
      WHERE `post_status` = 'publish'  
      LIMIT 20 OFFSET " . $_offset
    );
    $_has_posts = count($_posts) > 0;
    if ( $_has_posts ) {
      $_offset = $_offset + count($_posts);
      if ( ! class_exists( 'TC_post_thumbnails' ) )
        TC___::$instance -> tc__( array('content' => array( array('inc/parts', 'post_thumbnails') ) ), true );
      foreach ( $_posts as $_post) 
        TC_post_thumbnails::$instance -> tc_set_thumb_info( $_post -> ID );
    }
  }
}

(maybe with an sql to remove the tc-thumb-fld occurrences before set them again)
But I'm assuming the issue is related to something which prevents the automatic refresh which your code already properly provides.

from customizr.

eri-trabiccolo avatar eri-trabiccolo commented on June 14, 2024

FYI the user having the issue solved it after this suggestion:

  1. disable your plugins (maybe one of them might have conflicted)
  2. browse the whole blog (post-lists) as admin

point 2 because we always refresh the thumb fld when user can upload images (right?).
I'm not sure if the user followed the 1) step too or if it was needed.

from customizr.

 avatar commented on June 14, 2024

After all this is an edge case.
instead of adding a new button to the customizer, wouldn't it possible to hook at the end of the import process (there must a be a hook there) and run your code ?

from customizr.

eri-trabiccolo avatar eri-trabiccolo commented on June 14, 2024

A better version of it, yes, makes sense.
Anyway I tried to reproduce it but I couldn't reproduce it.
Hopefully will not be so much expensive.

from customizr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.