Skip to content

Instantly share code, notes, and snippets.

@terrylinooo
Created September 30, 2023 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrylinooo/390c83b086a1baee67c263ae39a6cd57 to your computer and use it in GitHub Desktop.
Save terrylinooo/390c83b086a1baee67c263ae39a6cd57 to your computer and use it in GitHub Desktop.
ironman_customize_register
/**
* Customizer settings.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*
* @return void
*/
function ironman_customize_register( $wp_customize ) {
$wp_customize->add_section(
'ironman_background_color_section',
array(
'title' => __( 'Website Background Color', 'ironman' ),
'description' => 'Adjust the background color of your site.',
'priority' => 30,
)
);
$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