I am doing string conversion for every post/page in Wordpress. I add below function to template_redirect
hook to get the whole html content and do the conversion.
function my_string_conversing() {
obstart( 'ob_callback' );
return;
}
function ob_callback( $buffer ) {
// doing conversion here...
return $buffer
}
add_action( 'template_redirect', 'my_string_conversion' );
These code works well for posts and pages, but if I split one post into multiple pages, then this will not work. It even don't run my_string_conversion
function when click each page of a split post. How can I make it work? Thanks.
I found the solution, use
add_action( 'template_redirect', 'my_string_conversion', -100 );
instead.