Created
August 18, 2019 04:36
-
-
Save freddielore/78c5e60555a7b88c3d664752b5068630 to your computer and use it in GitHub Desktop.
[smart_seo_export_title] smart_seo_export_title filter demo #wordpress #wp #seo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'smart_seo_export_title', 'demo_export_default_seo_titles', 8, 2 ); | |
function demo_export_default_seo_titles( $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' ); | |
$title = $settings['title-' . $post->post_type]; | |
} | |
return $title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment