Skip to content

Commit

Permalink
Hide settings on Simple
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr committed Jan 16, 2025
1 parent 7653ae1 commit 4b60633
Showing 1 changed file with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s</a> %s</p>',
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 = <<<EOT
<input type="hidden" name="jetpack_relatedposts[enabled]" value="1" />
Expand All @@ -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(
'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s</a> %s</p>',
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 = <<<EOT
<ul id="settings-reading-relatedposts">
<li>
Expand Down

0 comments on commit 4b60633

Please sign in to comment.