Skip to content

Instantly share code, notes, and snippets.

@jessengatai
Created April 4, 2017 12:00
Show Gist options
  • Save jessengatai/a4657de2a3ee615c833bbf038bec5b5b to your computer and use it in GitHub Desktop.
Save jessengatai/a4657de2a3ee615c833bbf038bec5b5b to your computer and use it in GitHub Desktop.
/**
* Register our sectional titles in the customizer
* @param class $wp_customize Instance of WP_Customize_Manager created when using the 'customize_register' hook
*/
add_action( 'customize_register', 'jn_customizer_titles' );
function jn_customizer_titles( $wp_customize ) {
$text_domain = 'your_themes_text_domain';
// layout
$wp_customize->add_section( new JN_Customizer_Section_Title( $wp_customize, 'title_layout', array(
'title' => __( 'Layout', $text_domain),
'priority' => 1,
'panel' => '',
'description' => '',
) ) );
// core settings
$wp_customize->add_section( new JN_Customizer_Section_Title( $wp_customize, 'title_core', array(
'title' => 'Core settings',
'priority' => 90,
'panel' => '',
'description' => '',
) ) );
// nav tip
$wp_customize->add_section( new JN_Customizer_Section_Title( $wp_customize, 'title_menus', array(
'title' => 'Available Menus',
'priority' => 10,
'panel' => 'nav_menus',
'description' => __('Tip: This can also work as a description in panels between sections.', $text_domain),
) ) );
// theme options
$wp_customize->add_section( new JN_Customizer_Section_Title( $wp_customize, 'title_theme_options', array(
'title' => __( 'Theme Options', $text_domain),
'priority' => 120,
'panel' => '',
'description' => '',
) ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment