Skip to content

Instantly share code, notes, and snippets.

Created June 28, 2016 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6db5af892a4cf4fb029655167d7002a4 to your computer and use it in GitHub Desktop.
Save anonymous/6db5af892a4cf4fb029655167d7002a4 to your computer and use it in GitHub Desktop.
add_action( 'init', 'change_title' );
function change_title() {
add_theme_support( 'title-tag' );
add_filter('pre_get_document_title', 'dq_pre_get_document_title', 10);
function dq_pre_get_document_title(){
error_log('pre_get_document_title');
return 'Title: pre_get_document_title';
}
add_filter( 'document_title_parts', function( $title )
{
error_log('document_title_parts');
return 'Title: document_title_parts';
}, 10, 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment