Title: revive's Replies | WordPress.org

---

# revive

  [  ](https://wordpress.org/support/users/revive/)

 *   [Profile](https://wordpress.org/support/users/revive/)
 *   [Topics Started](https://wordpress.org/support/users/revive/topics/)
 *   [Replies Created](https://wordpress.org/support/users/revive/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/revive/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/revive/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/revive/engagements/)
 *   [Favorites](https://wordpress.org/support/users/revive/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/users/revive/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/revive/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[GiveWP - Donation Plugin and Fundraising Platform] Donation form 500 error using Shortcode in template](https://wordpress.org/support/topic/donation-form-500-error-using-shortcode-in-template/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/donation-form-500-error-using-shortcode-in-template/#post-18125813)
 * Deactivating the Give Fee Recovery plugin restored the donation form.. any thoughts?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Reading Time WP] All ACF posts are still under 1 minute](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/#post-16584894)
 * Ok, given the 3 yr old post regarding getting counts for ACF sub_fields, and 
   no new info up to this point.. I’ve put this together and it works, if a little
   bloated IMHO. 🙂 
   But, it DOES count sub_fields for every flexible content if
   you include the IF check and WHILE loop for that flexible content field.
 *     ```wp-block-code
       //  Word Count support for ACF sub_fields 
       add_filter('rtwp_filter_wordcount', 'up_the_count');
       function up_the_count($count) {
         $field_count =0;  // set the field_count to 0
   
           if( have_rows('flexible_content') ):                        // flexible content field type IF
             while ( have_rows('flexible_content') ) : the_row();      // flexible content field WHILE loop
               if( get_row_layout() == 'editable_text' ):              // flexible content layout 
                 $field_count += count( preg_split('/\s+/', get_sub_field('editable_text', $post->ID) )); // flexible content sub_field 
               elseif( get_row_layout() == 'related_content' ):                                           // another flexible content layout
                 $field_count += count( preg_split('/\s+/', get_sub_field('title', $post->ID) ));        // flexible content sub_field 
                 $field_count += count( preg_split('/\s+/', get_sub_field('content', $post->ID) ));      // flexible content sub_field 
               endif;
             endwhile;
           endif;
   
         $count += $field_count;  // adding the field_count to count
         return $count;          // returning the count 
   
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Reading Time WP] All ACF posts are still under 1 minute](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/#post-16584799)
 * [https://wordpress.org/support/topic/adding-to-count-with-acf-flexible-content/#post-12088849](https://wordpress.org/support/topic/adding-to-count-with-acf-flexible-content/#post-12088849)
 * I came across this post, stating you have to wrap the Reading Time code in the
   ACF repeater field.. to get the value of the sub_field! 
   What if you have 10 
   repeater / Flexible Content fields.. you would really need to run loops for each
   one?
 * 
   Is there no way to check the sub_field count aside from doing this??
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Reading Time WP] All ACF posts are still under 1 minute](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/all-acf-posts-are-still-under-1-minute/#post-16584707)
 * The second snippet returns a word count… because the ACF get_field is in it’s
   parent field, a flexible content type… but get_sub_field(‘editable_text’) doesn’t
   return anything outside of that if/while statement check… so, it cannot be used
   standalone to get a word count to be added to Reading Time..
 *     ```wp-block-code
       if( have_rows('flexible_content') ):
           while ( have_rows('flexible_content') ) : the_row();
               if( get_row_layout() == 'editable_text'):
   
       $the_content = wp_strip_all_tags(     get_sub_field('editable_text', $post->ID));
   
       $word_count = count(preg_split('/\s+/',$the_content ) );
   
               $reading_time = $word_count / 200;
               echo $reading_time; <- this will return a value for $reading_time and $word_count
               endif;
           endwhile;
       endif;  
       ```
   
 * So, how can someone inject the value of an ACF child or nested field, like those
   of Flexible Content or Repeaters into Reading Time?
 *     ```wp-block-code
       add_filter('rtwp_filter_wordcount', 'up_the_count');
       function up_the_count($count) {
   
         $ACFcount = array(
   
       ** THIS NEXT LINE IS A FIELD FROM A FLEXIBLE CONTENT TYPE, it doesn't return a value (because it's outside of the if/when statement for the parent). This is the field we need the value from, and other sub_fields.	
   
           count( preg_split('/\s+/', get_sub_field('editable_text', $post->ID) ))
   
       );
   
         foreach($ACFcount as $words) {
           $count += $words;
         }
   
         return $count;
   
       }
       ```
   
    -  This reply was modified 3 years, 3 months ago by [revive](https://wordpress.org/support/users/revive/).
      Reason: update code example
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[W3 Total Cache] Exclude caching of Draft posts](https://wordpress.org/support/topic/exclude-caching-of-draft-posts/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/exclude-caching-of-draft-posts/#post-16296738)
 * Yes.
 * Here is our workflow.
 * Post is created and content is added by various departments, etc.. it is in Draft
   status. The post is only viewable by admin, which is the expected result.
 * Once approved the post is then published and purged from cache. However, it is
   still only viewable by an admin and not publicly visible on the site – until 
   the entire cache times out and reloads.
 * Not sure why purging one article is not actually purging it from cache or why
   a Draft would even be cached.. but, this is what is happening and it’s causing
   a major delay in getting new content onto the site (these are items for sale,
   so much more important than an article post.)
    -  This reply was modified 3 years, 6 months ago by [revive](https://wordpress.org/support/users/revive/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[W3 Total Cache] Exclude caching of Draft posts](https://wordpress.org/support/topic/exclude-caching-of-draft-posts/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/exclude-caching-of-draft-posts/#post-16293833)
 * Hi Marko,
 * Thanks for reaching out. My apologies, I should have included that we also tried
   to clear cache for that specific page, once we published and realized that it
   is not on the live site for visitors (only admins can see it because they’re 
   logged in)…
    It seems the cache is aggressively retaining the drafts that are
   then published, in draft status.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SearchWP Live Ajax Search] Live Ajax Search results box hidden until results returned](https://wordpress.org/support/topic/live-ajax-search-results-box-hidden-until-results-returned/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/live-ajax-search-results-box-hidden-until-results-returned/#post-15953675)
 * resolved. was a CSS conflict.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SearchWP Live Ajax Search] Live Ajax Seach doesn’t find ACF and Meta data fields](https://wordpress.org/support/topic/live-ajax-seach-doesnt-find-acf-and-meta-data-fields/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/live-ajax-seach-doesnt-find-acf-and-meta-data-fields/#post-15953114)
 * All good, I applied the code from [https://adambalee.com/lazy-loading-responsive-images-in-wordpress-without-a-plugin/](https://adambalee.com/lazy-loading-responsive-images-in-wordpress-without-a-plugin/)
   and search is pulling ACF field data.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[SearchWP Live Ajax Search] Live Ajax Seach doesn’t find ACF and Meta data fields](https://wordpress.org/support/topic/live-ajax-seach-doesnt-find-acf-and-meta-data-fields/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/live-ajax-seach-doesnt-find-acf-and-meta-data-fields/#post-15951444)
 * Side note, I do already have the pre_get_posts function applied to the search
   query to add the CPTs
 *     ```
       	if ( $query->is_search ) {
             $query->set( 'post_type', array( 'page','post', 'inventory', 'auction', 'liquidation' ) );
         }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Regenerate Thumbnails] Restore deleted images (original sized images)](https://wordpress.org/support/topic/restore-deleted-images-original-sized-images/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/restore-deleted-images-original-sized-images/#post-15168085)
 * [@gikaragia](https://wordpress.org/support/users/gikaragia/) Thanks for the reply.
   
   We don’t have any other image plugins installed on the site. Regenerate Thumbnails
   is the only image plugin we’ve ever installed.. which is why we’re wondering 
   what happened to the original images (Regenerate Thumbnails has never affected
   them in the past). Is there anyway for Regenerate Thumbnails to delete the original
   images??
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Regenerate Thumbnails] Restore deleted images (original sized images)](https://wordpress.org/support/topic/restore-deleted-images-original-sized-images/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/restore-deleted-images-original-sized-images/#post-15140743)
 * Rephrased and reposted to clarify support request
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Can’t switch List/Month view](https://wordpress.org/support/topic/cant-switch-list-month-view/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cant-switch-list-month-view/#post-14894174)
 * [@marckolo](https://wordpress.org/support/users/marckolo/)
    It’s in your functions.
   php file usually
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Can’t switch List/Month view](https://wordpress.org/support/topic/cant-switch-list-month-view/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cant-switch-list-month-view/#post-14882815)
 * I replaced the themes enqueue of jQuery from:
 *     ```
           wp_register_script('jquery-3.5.1', 'https://code.jquery.com/jquery-3.5.1.js', false, '3.5.1', true);
           wp_enqueue_script('jquery-3.5.1');
       ```
   
 * to just the basic enqueue that the TwentyTwentyOne theme uses:
    `wp_enqueue_script('
   jquery');`
    -  This reply was modified 4 years, 9 months ago by [revive](https://wordpress.org/support/users/revive/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Search, Data dropdown and view selector now working](https://wordpress.org/support/topic/search-data-dropdown-and-view-selector-now-working/)
 *  Thread Starter [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/search-data-dropdown-and-view-selector-now-working/#post-14872216)
 * Found the issue for us.. WP was loading jQuery twice. resolved that, and TEC 
   works great. Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Can’t switch List/Month view](https://wordpress.org/support/topic/cant-switch-list-month-view/)
 *  [revive](https://wordpress.org/support/users/revive/)
 * (@revive)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cant-switch-list-month-view/#post-14872213)
 * Found the issue for us.. WP was loading jQuery twice. resolved that, and TEC 
   works great. Thanks!

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/users/revive/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/revive/replies/page/2/?output_format=md)