Skip to content

Instantly share code, notes, and snippets.

@nielslange
Last active February 18, 2017 14:23
Show Gist options
  • Save nielslange/21d4884eb6465e0d45006e92c2ab3b02 to your computer and use it in GitHub Desktop.
Save nielslange/21d4884eb6465e0d45006e92c2ab3b02 to your computer and use it in GitHub Desktop.
Enhance WordPress customizer
<?php
//* Enhance customizer
add_action( 'customize_register', 'nl_enhance_customizer' );
function nl_enhance_customizer( $wp_customize ) {
$wp_customize->add_section(
'footer_section',
array(
'title' => __('Title of the settings box', 'theme_name'),
'description' => __('Description of the settings box'),
'priority' => 150,
)
);
$wp_customize->add_setting(
'footer_textbox',
array(
'default' => __('Default value of the settings box', 'theme_name'),
)
);
$wp_customize->add_control(
'footer_textbox',
array(
'label' => __('Label of the control box', 'theme_name'),
'description' => __('Description of the control box'),
'section' => 'footer_section',
'type' => 'textarea',
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment