beginning to implement custom settings in customizer
This commit is contained in:
parent
82e2c9c3f8
commit
540498a0b2
1 changed files with 23 additions and 10 deletions
|
|
@ -128,20 +128,33 @@ function theme_customize_register( $wp_customize ) {
|
||||||
'label' => esc_html__( 'Theme color', 'theme' ),
|
'label' => esc_html__( 'Theme color', 'theme' ),
|
||||||
) ) );
|
) ) );
|
||||||
|
|
||||||
$wp_customize->add_setting('contact_mail', array(
|
$wp_customize->add_section( 'kit_advanced_settings' , array(
|
||||||
'default' => '',
|
'title' => __('Advanced settings','kit'),
|
||||||
'type' => 'option',
|
'priority' => 30,
|
||||||
'transport' => 'refresh',
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$wp_customize->add_control('contact_mail', array(
|
$wp_customize->add_setting( 'kit_url_setting_id', array(
|
||||||
'label' => __('Contact mail', 'contact_mail'),
|
'capability' => 'edit_theme_options',
|
||||||
'section' => 'core',
|
'sanitize_callback' => 'kit_sanitize_url',
|
||||||
'settings' => 'contact_mail',
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
$wp_customize->add_control( 'kit_url_setting_id', array(
|
||||||
|
'type' => 'url',
|
||||||
|
'section' => 'nav',
|
||||||
|
'label' => __( 'Custom URL' ),
|
||||||
|
'description' => __( 'This is a custom url input.' ),
|
||||||
|
'input_attrs' => array(
|
||||||
|
'placeholder' => __( 'http://www.google.com' ),
|
||||||
|
),
|
||||||
|
) );
|
||||||
|
|
||||||
|
function kit_sanitize_url( $url ) {
|
||||||
|
return esc_url_raw( $url );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_action( 'customize_register', 'kit_advanced_settings' );
|
||||||
add_action( 'customize_register', 'theme_customize_register' );
|
add_action( 'customize_register', 'theme_customize_register' );
|
||||||
|
|
||||||
function kit_customize_css()
|
function kit_customize_css()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue