Last active
August 18, 2019 04:52
-
-
Save freddielore/fbf3e3311c33143d74ea47f9ad3b59b8 to your computer and use it in GitHub Desktop.
Revisions
-
freddielore revised this gist
Aug 18, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function demo_export_default_seo_titles_v2( $title, $post ){ 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; -
freddielore created this gist
Aug 18, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <?php 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], array() ); } return $title; } ?>