diff --git a/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php b/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php index 3cca1e7a16eed..69810f35fac71 100644 --- a/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php +++ b/projects/plugins/jetpack/modules/related-posts/jetpack-related-posts.php @@ -727,24 +727,6 @@ public function print_setting_html() { esc_html__( 'Preview:', 'jetpack' ) ); - // The above settings does not take effect on block themes. - if ( wp_is_block_theme() ) { - $ui_settings = sprintf( - '

%s %s

', - esc_url( - Redirect::get_url( - 'jetpack-support-related-posts', - array( - 'anchor' => 'adding-related-posts-block-theme', - 'site' => $this->get_blog_id(), - ) - ) - ), - esc_html__( 'Add a Related Posts Block to your site’s template in the site editor', 'jetpack' ), - esc_html__( 'to keep your visitors engaged with related content at the bottom of each post.', 'jetpack' ) - ); - } - if ( ! $this->allow_feature_toggle() ) { $template = << @@ -755,6 +737,28 @@ public function print_setting_html() { $ui_settings // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- data is escaped when variable is set. ); } else { + // Hide settings that does not take effect on block themes. + if ( wp_is_block_theme() ) { + $ui_settings = sprintf( + '

%s %s

', + esc_url( + Redirect::get_url( + 'jetpack-support-related-posts', + array( + 'anchor' => 'adding-related-posts-block-theme', + 'site' => $this->get_blog_id(), + ) + ) + ), + esc_html__( 'Add a Related Posts Block to your site’s template in the site editor', 'jetpack' ), + esc_html__( 'to keep your visitors engaged with related content at the bottom of each post.', 'jetpack' ) + ); + printf( + $ui_settings // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- data is escaped when variable is set. + ); + return; + } + $template = <<