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)

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12300304679

Upstream-Ref: Automattic/jetpack@d669cd5
  • Loading branch information
coder-karen authored and matticbot committed Dec 12, 2024
1 parent cea2688 commit 6a69892
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This is an alpha version! The changes listed here are not final.
- Facebook Embeds: add a white background to embeds to avoid transparent background interfering with readability.
- Form Block: fixed validation of URL input types to allow query strings.
- Import: setting WP_IMPORTING when doing an import
- SEO: Ensure that SEO fields are not visible when another SEO plugin is active.

### Other changes <!-- Non-user-facing changes go here. This section will not be copied to readme.txt. -->
- Blogging prompts endpoint: disable bloganuary for 2025 and beyond.
Expand Down
11 changes: 10 additions & 1 deletion 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 6a69892

Please sign in to comment.