Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sanitize_callback for the container type setting and the navbar type setting #1973

Merged
merged 2 commits into from Nov 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 14 additions & 16 deletions inc/customizer.php
Expand Up @@ -132,7 +132,7 @@ function understrap_theme_customize_register( $wp_customize ) {
array(
'default' => 'collapse',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
'sanitize_callback' => 'understrap_customize_sanitize_select',
'capability' => 'edit_theme_options',
)
);
Expand All @@ -142,19 +142,18 @@ function understrap_theme_customize_register( $wp_customize ) {
$wp_customize,
'understrap_navbar_type',
array(
'label' => __( 'Responsive Navigation Type', 'understrap' ),
'description' => __(
'label' => __( 'Responsive Navigation Type', 'understrap' ),
'description' => __(
'Choose between an expanding and collapsing navbar or an offcanvas drawer.',
'understrap'
),
'section' => 'understrap_theme_layout_options',
'type' => 'select',
'sanitize_callback' => 'understrap_customize_sanitize_select',
'choices' => array(
'section' => 'understrap_theme_layout_options',
'type' => 'select',
'choices' => array(
'collapse' => __( 'Collapse', 'understrap' ),
'offcanvas' => __( 'Offcanvas', 'understrap' ),
),
'priority' => apply_filters( 'understrap_navbar_type_priority', 20 ),
'priority' => apply_filters( 'understrap_navbar_type_priority', 20 ),
)
)
);
Expand All @@ -164,7 +163,7 @@ function understrap_theme_customize_register( $wp_customize ) {
array(
'default' => 'right',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
'sanitize_callback' => 'understrap_customize_sanitize_select',
'capability' => 'edit_theme_options',
)
);
Expand All @@ -174,21 +173,20 @@ function understrap_theme_customize_register( $wp_customize ) {
$wp_customize,
'understrap_sidebar_position',
array(
'label' => __( 'Sidebar Positioning', 'understrap' ),
'description' => __(
'label' => __( 'Sidebar Positioning', 'understrap' ),
'description' => __(
'Set sidebar\'s default position. Can either be: right, left, both or none. Note: this can be overridden on individual pages.',
'understrap'
),
'section' => 'understrap_theme_layout_options',
'type' => 'select',
'sanitize_callback' => 'understrap_customize_sanitize_select',
'choices' => array(
'section' => 'understrap_theme_layout_options',
'type' => 'select',
'choices' => array(
'right' => __( 'Right sidebar', 'understrap' ),
'left' => __( 'Left sidebar', 'understrap' ),
'both' => __( 'Left & Right sidebars', 'understrap' ),
'none' => __( 'No sidebar', 'understrap' ),
),
'priority' => apply_filters( 'understrap_sidebar_position_priority', 20 ),
'priority' => apply_filters( 'understrap_sidebar_position_priority', 20 ),
)
)
);
Expand Down