Created
February 22, 2016 17:49
-
-
Save thefrosty/8db3b18e91ba45b050ec to your computer and use it in GitHub Desktop.
Basic WordPress customizer setting.
This file contains hidden or 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
<?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