Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'customize_register', 'registerSection' );
- function registerSection( $wp_customize ){
- $section_key = "custom_section_key";
- $wp_customize->add_section( $section_key, array(
- 'title' => "Section Title",
- 'priority' => 160,
- ) );
- $setting_id = "custom_setting_id";
- $wp_customize->add_setting( $setting_id, array(
- 'default' => '',
- 'transport' => 'refresh',
- 'capability' => 'manage_options',
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field'
- ) );
- $wp_customize->add_control( $setting_id, array(
- 'label' => 'Option Label',
- 'section' => $section_key,
- 'settings' => $setting_id,
- 'type' => 'text',
- 'active_callback' => function () { return true; },
- ) );
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement