WordPress Pirates Ahoy! “Talk like a Pirate” Plugin

I’m trying to fix the Pirates Ahoy! Translate to Pirate for next year’s “Talk like a Pirate Day” and I have most of the issues corrected but with WordPress 4.4+ the way the is handled is, apparently, different and I’m having trouble filtering it.
This is what it looks like:

// Hook into post, excerpt, and comment functions
add_filter( ‘the_content’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ) );
add_filter( ‘the_excerpt’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ) );
add_filter( ‘excerpt’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ) );
add_filter( ‘get_comment_text’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ) );
//add_filter( ‘wp_title’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ), 10, 1 );
//add_filter( ‘wp_title’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ) );//deprecated
add_filter( ‘the_title’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ), 999, 2 );//on page (article) title
//add_filter( ‘the_title’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ), 10, 1 );
//add_filter(‘pre_get_document_title’, array( ‘Pirates_Ahoy’, ‘translation2pirate’,999,1 ));//doesn’t work
add_filter( ‘document_title_parts’, array( ‘Pirates_Ahoy’, ‘translation2pirate’ ), 10, 1 );//doesn’t work

Nothing I’ve tried seems to alter the title. Any help would be greatly appreciated!

Read more here:: WordPress Pirates Ahoy! “Talk like a Pirate” Plugin

Leave a Reply

Your email address will not be published. Required fields are marked *