Skip to content

Commit

Permalink
Jetpack SEO: Ensure we only enable the SEO extension if the jetpack_d…
Browse files Browse the repository at this point in the history
…isable_seo_tools filter is set to false (#40567)
  • Loading branch information
coder-karen authored Dec 12, 2024
1 parent 01fe06c commit d669cd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

SEO: Ensure that SEO fields are not visible when another SEO plugin is active.
11 changes: 10 additions & 1 deletion projects/plugins/jetpack/extensions/plugins/seo/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
'jetpack_register_gutenberg_extensions',
function () {
\Jetpack_Gutenberg::set_availability_for_plan( 'advanced-seo' );
\Jetpack_Gutenberg::set_extension_available( 'jetpack-seo' );
}
);

add_action(
'after_setup_theme',
function () {
// We only want to enable the SEO extension (and display SEO settings) if the 'jetpack_disable_seo_tools' filter is not set to false.
if ( ! apply_filters( 'jetpack_disable_seo_tools', false ) ) {
\Jetpack_Gutenberg::set_extension_available( 'jetpack-seo' );
}
}
);

Expand Down

0 comments on commit d669cd5

Please sign in to comment.