Plugin Using get_the_content Causing Issues With <!–more–> Tag

I’m testing out the Woothemes “Our Team” plugin to see how it works for future project purposes.

The plugin uses at CPT for Team Members as well as a shortcode to allow users to display members on a page.

The issue that I’m bumping into is that the content that is output by the shortcode is not honoring the <!--more--> tag. I’m assuming it’s because in the woothemes-our-team-template.php file on line 196 it’s using get_the_content as shown below:

$content = apply_filters( 'woothemes_our_team_content', wpautop( get_the_content() ), $post );

It appears that there is also a filter that should be able to be hooked into called “woothemes_our_team_content” but no matter what I try to add into my functions.php I can’t get it to recognize that there is a <!--more--> tag. All my efforts have only managed to remove all the content.

Essentially I’d like to hook into the filter, have it recognize the <!--more--> tag, and then change “Read More” to say “Read Full Bio…”.

Doe anyone have any suggestions on the best way to achieve this?

Thanks in advance!

Solutions Collecting From Web of "Plugin Using get_the_content Causing Issues With <!–more–> Tag"

The logical fork between displaying full content and teaser (that’s what part from start of post to more tag is called) is ruled by $more global variable. Which depends on other global stuff and so on, important point being it’s not set to 0 when you want it to be. Likely because you are running this in context when it wouldn’t be set to zero for normal loop either.

Something like this should work:

add_filter( 'woothemes_our_team_content', function () {
    global $more;
    $real_more = $more;
    $more      = 0;
    $output    = wpautop( get_the_content() );
    $more      = $real_more;

    return $output;
} );

You can just work with link there, or hook into the_content_more_link to customize it.