[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Dark Mode Class
File Size: | 387 lines (12 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
Twenty_Twenty_One_Dark_Mode:: (12 methods):
__construct()
editor_custom_color_variables()
enqueue_scripts()
customize_controls_enqueue_scripts()
customizer_controls()
html_classes()
admin_body_classes()
switch_should_render()
the_switch()
the_html()
the_script()
add_privacy_policy_content()
Class: Twenty_Twenty_One_Dark_Mode - X-Ref
This class is in charge of Dark Mode.__construct() X-Ref |
Instantiates the object. |
editor_custom_color_variables() X-Ref |
Enqueues editor custom color variables & scripts. return: void |
enqueue_scripts() X-Ref |
Enqueues scripts and styles. return: void |
customize_controls_enqueue_scripts() X-Ref |
Enqueues scripts for the customizer. return: void |
customizer_controls( $wp_customize ) X-Ref |
Registers customizer options. param: WP_Customize_Manager $wp_customize Theme Customizer object. return: void |
html_classes( $classes ) X-Ref |
Calculates classes for the main <html> element. param: string $classes The classes for <html> element. return: string |
admin_body_classes( $classes ) X-Ref |
Adds a class to the <body> element in the editor to accommodate dark-mode. param: string $classes The admin body-classes. return: string |
switch_should_render() X-Ref |
Determines if we want to print the dark-mode switch or not. return: bool |
the_switch() X-Ref |
Adds night/day switch. return: void |
the_html( $attrs = array() X-Ref |
Prints the dark-mode switch HTML. Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed) param: array $attrs The attributes to add to our <button> element. return: void |
the_script() X-Ref |
Prints the dark-mode switch script. return: void |
add_privacy_policy_content() X-Ref |
Adds information to the privacy policy. return: void |
Generated : Tue Dec 24 08:20:01 2024 | Cross-referenced by PHPXref |