Skip to content

Instantly share code, notes, and snippets.

@nextend
Created May 17, 2018 16:21
Show Gist options
  • Save nextend/fce67d264b3f7f6d2a76dcc52168eb71 to your computer and use it in GitHub Desktop.
Save nextend/fce67d264b3f7f6d2a76dcc52168eb71 to your computer and use it in GitHub Desktop.
<?php
//Original
function zeo_final_title(){
// Use object to avoid namespace collisions
$zeo_rewrite_title = new zeo_rewrite_title();
// We want to act when the page is 99% complete
add_action('wp_footer', array(&$zeo_rewrite_title, 'wpzeo_footer'));
// There is no action hook for "start of processing",
// so we use this implicitly.
$zeo_rewrite_title->starting();
}
// This is the good
function zeo_final_title(){
$priority = 10;
add_action('template_redirect', array($zeo_rewrite_title, 'starting'), $priority);
add_action('shutdown', array(&$zeo_rewrite_title, 'wpzeo_footer'), -1 * $priority);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment