Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Not currently. Are you working with Advanced Custom Fields or are you creating your own core meta fields?

    You could technically modify the rt_calculate_reading_time function to pull in your custom fields and add it to the count.

    Plugin Author Jason Yingling

    (@yingling017)

    Hi David,

    The latest version of Reading Time WP added a filter for adding to the word count. You can use rtwp_filter_wordcount.

    @yingling017 can you provide further direction on how to use that filter?

    • This reply was modified 6 years, 1 month ago by bekee.
    Plugin Author Jason Yingling

    (@yingling017)

    @bekee you can use the add_filter function to add to the total word count that’s calculated.

    A basic example adding 3000 words to the count could look like this.

    add_filter( 'rtwp_filter_wordcount', 'up_the_count' );
    function up_the_count( $count ) {
    	return $count + 3000;
    }

    Now that’s not very useful on account of it just inflating the total. But if you wanted to add an ACF WYSIWYG to the word count you could do return something like.

    return $count + count( preg_split( '/\s+/', get_field( 'acf_wysiwyg', $post->ID ) ) );

    Hopefully that helps.

    @yingling017 Thanks so much! That helps a lot.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Fields’ is closed to new replies.