Created
September 30, 2023 14:36
-
-
Save terrylinooo/b071ff771eab4e2407ee102ea41cd421 to your computer and use it in GitHub Desktop.
ironman_customize_register (2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Customizer settings. | |
* | |
* @param WP_Customize_Manager $wp_customize Theme Customizer object. | |
* | |
* @return void | |
*/ | |
function ironman_customize_register( $wp_customize ) { | |
$wp_customize->add_panel( | |
'ironman_color_settings_panel', | |
array( | |
'title' => __( '顏色設定', 'mytheme' ), | |
'description' => '顏色的相關設定。', | |
'priority' => 10, | |
) | |
); | |
$wp_customize->add_section( | |
'ironman_background_color_section', | |
array( | |
'title' => __( 'Website Background Color', 'ironman' ), | |
'description' => 'Adjust the background color of your site.', | |
'priority' => 30, | |
'panel' => 'ironman_color_settings_panel', | |
) | |
); | |
$wp_customize->add_setting( | |
'ironman_background_color_setting', | |
array( | |
'default' => '#ffffff', | |
'transport' => 'refresh', | |
) | |
); | |
$wp_customize->add_control( | |
new WP_Customize_Color_Control( | |
$wp_customize, | |
'ironman_background_color_control', | |
array( | |
'label' => __( 'Background Color', 'ironman' ), | |
'section' => 'ironman_background_color_section', | |
'settings' => 'ironman_background_color_setting', | |
) | |
) | |
); | |
} | |
add_action( 'customize_register', 'ironman_customize_register' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment