Hello!
We haven’t changed the_seo_framework_generated_description
in about 3 years.
Have you updated anything else in your WordPress environment? Could you show me the filter you’re using and tell me where it’s invoked/called? Thanks!
Thread Starter
Jakub
(@kaderavek)
Hi Sybre,
thanks for your reply!
No I don’t make any update of my env. We use it in multisite. We use it in framework Sage. In the same file we use filter the_seo_framework_title_from_generation an it works normally.
We use it this way:
add_filter( 'the_seo_framework_generated_description', function ( $description ) {
if ( App\is_web( 'sb' ) ) { // custom function detect website by global $blog_id;
if ( is_post_type_archive( 'wpj_discussion' ) ) { // custom post type wpj_discussion archive
$description = 'My custom desc';
}
}
return $description;
} );
Thank for your help
Hello!
To ensure your hook hooks best, please change the filter’s priority to a number higher than the default (10), e.g.:
add_filter( 'the_seo_framework_generated_description', function ( $description ) {
if ( App\is_web( 'sb' ) ) { // custom function detect website by global $blog_id;
if ( is_post_type_archive( 'wpj_discussion' ) ) { // custom post type wpj_discussion archive
$description = 'My custom desc';
}
}
return $description;
}, 99 ); // higher priority!
If that doesn’t work, please debug (dump) the App\is_web()
and is_post_type_archive()
calls. If neither of those dump anything, then the filter may not run: perhaps you have specified a custom description; preceding the generated one.
Thread Starter
Jakub
(@kaderavek)
Hi Sybre,
thank youp. It’s very strange because we not change nothing (except update plugins a WP core) and it’s start working. We will watch it again but now we don’t see any trouble.
Have a nice day