Skip to content

Commit

Permalink
Move customization function from child to parent theme
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-bernhardt committed Jan 31, 2024
1 parent 6e526b3 commit a73841a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
38 changes: 0 additions & 38 deletions web/app/themes/mitlib-child/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,44 +122,6 @@ function theme_setup() {
}
add_action( 'after_setup_theme', 'Mitlib\Child\theme_setup' );

/**
* Define a new Menu Style section within the Customizer.
*
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
* @param type $wp_customize The Customizer object which we are extending.
*/
function theme_menu_style_customizer( $wp_customize ) {

$wp_customize->add_section(
'menu_style_section',
array(
'title' => 'Menu Style',
)
);

$wp_customize->add_setting(
'menu_style_setting',
array(
'default' => 'Full Menu',
'type' => 'option',
)
);

$wp_customize->add_control(
'menu_style_setting',
array(
'label' => 'Menu Style',
'section' => 'menu_style_section',
'type' => 'radio',
'choices' => array(
'full' => 'Full Menu',
'slim' => 'Slim No Menu',
),
)
);
}
add_action( 'customize_register', 'Mitlib\Child\theme_menu_style_customizer' );

/**
* Define register_child_nav function.
*/
Expand Down
38 changes: 38 additions & 0 deletions web/app/themes/mitlib-parent/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,44 @@ function setup_scripts_styles() {
}
add_action( 'wp_enqueue_scripts', 'Mitlib\Parent\setup_scripts_styles' );

/**
* Define a new Menu Style section within the Customizer.
*
* @link https://developer.wordpress.org/themes/customize-api/customizer-objects/
* @param type $wp_customize The Customizer object which we are extending.
*/
function customize_menu_style( $wp_customize ) {

$wp_customize->add_section(
'menu_style_section',
array(
'title' => 'Menu Style',
)
);

$wp_customize->add_setting(
'menu_style_setting',
array(
'default' => 'Full Menu',
'type' => 'option',
)
);

$wp_customize->add_control(
'menu_style_setting',
array(
'label' => 'Menu Style',
'section' => 'menu_style_section',
'type' => 'radio',
'choices' => array(
'full' => 'Full Menu',
'slim' => 'Slim No Menu',
),
)
);
}
add_action( 'customize_register', 'Mitlib\Parent\customize_menu_style' );

/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
Expand Down

0 comments on commit a73841a

Please sign in to comment.