Skip to content

Instantly share code, notes, and snippets.

@keks55
Created October 9, 2017 15:09
Show Gist options
  • Select an option

  • Save keks55/612d5b263f6692bf79d939678d20ba24 to your computer and use it in GitHub Desktop.

Select an option

Save keks55/612d5b263f6692bf79d939678d20ba24 to your computer and use it in GitHub Desktop.
Customize wordpress example
function q_customize_register( $wp_customize ){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('q Shortcodes', 'themename'),
'description' => '',
'priority' => 100,
));
$wp_customize->add_setting('themename_theme_options[link_color]', array(
'default' => '#000',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_color', array(
'label' => __('Link Color', 'themename'),
'section' => 'themename_color_scheme',
'settings' => 'themename_theme_options[link_color]',
)));
}
add_action( 'customize_register', 'q_customize_register' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment