Back in my naive days of theming, I had to make it so the link inserted by <!--more--> wouldn't dump the viewer at the anchor it produces.
I made a dinky plugin that consisted of:
function No_More_Link($buffer) {
$inHTML[0] = '/#more-\d+/';
$outHTML[0] = '';
return preg_replace($inHTML, $outHTML, $buffer);
}
ob_start("No_More_Link");
Years later, I thought I could do much better, by using a filter in the theme's functions.php file:
function no_more_link ( $input ) {
return preg_replace( '/#more-\d+/', '', $input );
}
add_filter( 'get_permalink', 'no_more_link' );
This doesn't work. I've tried bumping up the priority to ridiculous levels.
Am I applying the filter to the wrong thing? What am I missing here?