Skip to content

Commit

Permalink
Clarify sidebar customizer setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrakern committed Jan 2, 2025
1 parent 426ca24 commit 614a58a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions includes/functions/_customizer-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1535,19 +1535,29 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
'right' => _x( 'Right', 'Customizer header sidebar option.', 'fictioneer' )
);

if ( get_option( 'fictioneer_disable_all_widgets' ) ) {
$description = sprintf(
'%s <div style="margin: 10px 0;">%s</div>',
__( 'Choose whether and where to render the sidebar. You can set it up under Widgets; it will not appear before that.', 'fictioneer' ),
__( '<strong>Note:</strong> Widgets are currently disabled under Fictioneer > General > Performance. You need to enable them first.', 'fictioneer' )
);
} else {
$description = __( 'Choose whether and where to render the sidebar. You can set it up under Widgets; it will not appear before that.', 'fictioneer' );
}

$manager->add_control(
'sidebar_style',
array(
'type' => 'select',
'priority' => 6,
'section' => 'layout',
'label' => __( 'Sidebar', 'fictioneer' ),
'description' => __( 'Choose whether and where to render the sidebar. You can set it up under Widgets.', 'fictioneer' ),
'description' => $description,
'choices' => apply_filters( 'fictioneer_filter_customizer_sidebar_style', $sidebar_styles )
)
);

// Disable story sidebar
// Disable mobile sidebar
$manager->add_setting(
'sidebar_hide_on_mobile',
array(
Expand Down
2 changes: 1 addition & 1 deletion includes/functions/settings/_settings_page_general.php
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@
fictioneer_settings_label_checkbox(
'fictioneer_disable_all_widgets',
__( 'Disable all widgets', 'fictioneer' ),
__( 'The theme does not use widgets by default and removing them slightly boosts performance.', 'fictioneer' )
__( 'Required for sidebar. If not used, removing widgets slightly boosts performance.', 'fictioneer' )
);
?>
</div>
Expand Down

0 comments on commit 614a58a

Please sign in to comment.