This is wrong (or at best very confusing).
$wp_posts = get_the_content('page'); // get content of pages.
Your note says “get content of pages” but what you’ve really done is passed a alternate more link text.
get_the_content( $more_link_text, $stripteaser )
But that is an unnecessary step as you have the post content passed into the callback as $content
already.
Additionally, you are only setting $mv_title
if ('movie_ronny' == get_post_type()){
but you are using it whether it is set or not. That is going to trigger Notice
s.
This should be more correct:
function get_post_type_title($content){
if('movie_ronny' == get_post_type()){
$mv_title = get_the_title(); //get title of movie post type
$content = str_ireplace(
$mv_title,
'<a href="http://mylink.com">'.$mv_title.'</a>',
$content
); //perform a search and replace.
}
return $content;
}
add_filter('the_content','get_post_type_title');