Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic WordPress customizer setting.
<?php
namespace Passy;
add_action( 'customize_register', __NAMESPACE__ . '\\customize_register' );
function customize_register( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_panel( 'custom_login_settings',
array(
'priority' => 10,
'capability' => 'manage_options',
'title' => __( 'Custom Login', 'custom-login' ),
'description' => __( 'Style your wp-login.php page with ease.', 'custom-login' ),
)
);
$wp_customize->add_section(
'custom_login_form',
array(
'title' => __( 'Custom Login Form', 'custom-login',
'panel' => 'custom_login_settings', // WordPress 4.3
'capability' => 'manage_options', // If different then the panel 'capability'
'priority' => 10,
)
);
$wp_customize->add_setting(
'form_background',
array(
'default' => '',
'type' => 'option', // this is a option not a theme mod AKA get_option()
'capability' => 'manage_options',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'form_background',
array(
'label' => __( 'Form Background Color', 'custom-login' ),
'section' => 'custom_login_form',
'settings' => 'custom_login_settings["design"]',
)
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.