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' ),
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting('contact_mail', array(
|
||||
'default' => '',
|
||||
'type' => 'option',
|
||||
'transport' => 'refresh',
|
||||
));
|
||||
$wp_customize->add_section( 'kit_advanced_settings' , array(
|
||||
'title' => __('Advanced settings','kit'),
|
||||
'priority' => 30,
|
||||
) );
|
||||
|
||||
$wp_customize->add_control('contact_mail', array(
|
||||
'label' => __('Contact mail', 'contact_mail'),
|
||||
'section' => 'core',
|
||||
'settings' => 'contact_mail',
|
||||
));
|
||||
$wp_customize->add_setting( 'kit_url_setting_id', array(
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'kit_sanitize_url',
|
||||
) );
|
||||
|
||||
$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' );
|
||||
|
||||
function kit_customize_css()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue