Fix identation

This commit is contained in:
IanDelMar 2018-11-19 00:43:14 +01:00
parent c8274df833
commit b653d6f2ce
1 changed files with 59 additions and 40 deletions

View File

@ -37,12 +37,15 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
function understrap_theme_customize_register( $wp_customize ) {
// Theme layout settings.
$wp_customize->add_section( 'understrap_theme_layout_options', array(
$wp_customize->add_section(
'understrap_theme_layout_options',
array(
'title' => __( 'Theme Layout Settings', 'understrap' ),
'capability' => 'edit_theme_options',
'description' => __( 'Container width and sidebar defaults', 'understrap' ),
'priority' => 160,
) );
)
);
/**
* Select sanitization function
@ -51,7 +54,7 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
* @param WP_Customize_Setting $setting Setting instance.
* @return string Sanitized slug if it is a valid choice; otherwise, the setting default.
*/
function understrap_theme_slug_sanitize_select( $input, $setting ){
function understrap_theme_slug_sanitize_select( $input, $setting ) {
// Ensure input is a slug (lowercase alphanumeric characters, dashes and underscores are allowed only).
$input = sanitize_key( $input );
@ -64,17 +67,21 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
}
$wp_customize->add_setting( 'understrap_container_type', array(
$wp_customize->add_setting(
'understrap_container_type',
array(
'default' => 'container',
'type' => 'theme_mod',
'sanitize_callback' => 'understrap_theme_slug_sanitize_select',
'capability' => 'edit_theme_options',
) );
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'understrap_container_type', array(
'understrap_container_type',
array(
'label' => __( 'Container Width', 'understrap' ),
'description' => __( 'Choose between Bootstrap\'s container and container-fluid', 'understrap' ),
'section' => 'understrap_theme_layout_options',
@ -86,22 +93,29 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
),
'priority' => '10',
)
) );
)
);
$wp_customize->add_setting( 'understrap_sidebar_position', array(
$wp_customize->add_setting(
'understrap_sidebar_position',
array(
'default' => 'right',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
'capability' => 'edit_theme_options',
) );
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'understrap_sidebar_position', array(
'understrap_sidebar_position',
array(
'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' ),
'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',
'settings' => 'understrap_sidebar_position',
'type' => 'select',
@ -114,7 +128,8 @@ if ( ! function_exists( 'understrap_theme_customize_register' ) ) {
),
'priority' => '20',
)
) );
)
);
}
} // endif function_exists( 'understrap_theme_customize_register' ).
add_action( 'customize_register', 'understrap_theme_customize_register' );
@ -127,8 +142,12 @@ if ( ! function_exists( 'understrap_customize_preview_js' ) ) {
* Setup JS integration for live previewing.
*/
function understrap_customize_preview_js() {
wp_enqueue_script( 'understrap_customizer', get_template_directory_uri() . '/js/customizer.js',
array( 'customize-preview' ), '20130508', true
wp_enqueue_script(
'understrap_customizer',
get_template_directory_uri() . '/js/customizer.js',
array( 'customize-preview' ),
'20130508',
true
);
}
}