[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwentyone/classes/ -> class-twenty-twenty-one-dark-mode.php (summary)

Dark Mode Class

File Size: 384 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

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
Instantiate the object.

since: Twenty Twenty-One 1.0

editor_custom_color_variables()   X-Ref
Editor custom color variables & scripts.

return: void
since: Twenty Twenty-One 1.0

enqueue_scripts()   X-Ref
Enqueue scripts and styles.

return: void
since: Twenty Twenty-One 1.0

customize_controls_enqueue_scripts()   X-Ref
Enqueue scripts for the customizer.

return: void
since: Twenty Twenty-One 1.0

customizer_controls( $wp_customize )   X-Ref
Register customizer options.

return: void
param: WP_Customize_Manager $wp_customize Theme Customizer object.
since: Twenty Twenty-One 1.0

html_classes( $classes )   X-Ref
Calculate classes for the main <html> element.

return: string
param: string $classes The classes for <html> element.
since: Twenty Twenty-One 1.0

admin_body_classes( $classes )   X-Ref
Adds a class to the <body> element in the editor to accommodate dark-mode.

return: string
param: string $classes The admin body-classes.
since: Twenty Twenty-One 1.0

switch_should_render()   X-Ref
Determine if we want to print the dark-mode switch or not.

return: bool
since: Twenty Twenty-One 1.0

the_switch()   X-Ref
Add night/day switch.

return: void
since: Twenty Twenty-One 1.0

the_html( $attrs = array()   X-Ref
Print the dark-mode switch HTML.

Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed)

return: void
param: array $attrs The attributes to add to our <button> element.
since: Twenty Twenty-One 1.0

the_script()   X-Ref
Print the dark-mode switch script.

return: void
since: Twenty Twenty-One 1.0

add_privacy_policy_content()   X-Ref
Adds information to the privacy policy.

return: void
since: Twenty Twenty-One 1.0



Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1