Skip to content

Instantly share code, notes, and snippets.

/title.php
Created Jun 28, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.