From a73841addad8b4439f46a1650591971311af3925 Mon Sep 17 00:00:00 2001 From: Matthew Bernhardt Date: Wed, 31 Jan 2024 15:31:04 -0500 Subject: [PATCH] Move customization function from child to parent theme --- web/app/themes/mitlib-child/functions.php | 38 ---------------------- web/app/themes/mitlib-parent/functions.php | 38 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/web/app/themes/mitlib-child/functions.php b/web/app/themes/mitlib-child/functions.php index 51d827fe..d83b93f7 100644 --- a/web/app/themes/mitlib-child/functions.php +++ b/web/app/themes/mitlib-child/functions.php @@ -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. */ diff --git a/web/app/themes/mitlib-parent/functions.php b/web/app/themes/mitlib-parent/functions.php index 3a887ea0..89f5abf2 100644 --- a/web/app/themes/mitlib-parent/functions.php +++ b/web/app/themes/mitlib-parent/functions.php @@ -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.