Skip to content

Instantly share code, notes, and snippets.

Last active August 18, 2019 04:52
What would you like to do?
[smart_seo_export_title_v2] smart_seo_export_title usage example #wordpress #genesis #seo
add_filter( 'smart_seo_export_title', 'demo_export_default_seo_titles_v2', 8, 2 );
function demo_export_default_seo_titles_v2( $title, $post ){
// if no custom SEO title being defined, get global defaults for Yoast
if( class_exists('WPSEO_Option' ) && empty($title) ){
$settings = get_option( 'wpseo_titles' );
$replacer = new WPSEO_Replace_Vars();
$title = $replacer->replace( $settings['title-' . $post->post_type], $post );
return $title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment