Twenty Twenty-One: Improve various globals documentation, as per docblock standards.

This changeset adds globals documentation, and also a couple Docblock standards improvements.

Props upadalavipul, audrasjb.
Fixes #58684.
See #57840.



Built from https://develop.svn.wordpress.org/trunk@56118


git-svn-id: http://core.svn.wordpress.org/trunk@55630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-06-30 12:54:27 +00:00
parent 7992c49b5f
commit 4a75dae77a
3 changed files with 28 additions and 21 deletions

View File

@ -13,7 +13,7 @@
class Twenty_Twenty_One_Dark_Mode { class Twenty_Twenty_One_Dark_Mode {
/** /**
* Instantiate the object. * Instantiates the object.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
*/ */
@ -45,7 +45,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Editor custom color variables & scripts. * Enqueues editor custom color variables & scripts.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -82,7 +82,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Enqueue scripts and styles. * Enqueues scripts and styles.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -100,7 +100,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Enqueue scripts for the customizer. * Enqueues scripts for the customizer.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -120,7 +120,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Register customizer options. * Registers customizer options.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -209,7 +209,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Calculate classes for the main <html> element. * Calculates classes for the main <html> element.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -235,6 +235,8 @@ class Twenty_Twenty_One_Dark_Mode {
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
* @global WP_Screen $current_screen WordPress current screen object.
*
* @param string $classes The admin body-classes. * @param string $classes The admin body-classes.
* @return string * @return string
*/ */
@ -261,10 +263,12 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Determine if we want to print the dark-mode switch or not. * Determines if we want to print the dark-mode switch or not.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
* @global bool $is_IE
*
* @return bool * @return bool
*/ */
public function switch_should_render() { public function switch_should_render() {
@ -277,7 +281,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Add night/day switch. * Adds night/day switch.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -292,7 +296,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Print the dark-mode switch HTML. * Prints the dark-mode switch HTML.
* *
* Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed) * Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed)
* *
@ -352,7 +356,7 @@ class Twenty_Twenty_One_Dark_Mode {
} }
/** /**
* Print the dark-mode switch script. * Prints the dark-mode switch script.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *

View File

@ -339,7 +339,7 @@ if ( ! function_exists( 'twenty_twenty_one_setup' ) ) {
add_action( 'after_setup_theme', 'twenty_twenty_one_setup' ); add_action( 'after_setup_theme', 'twenty_twenty_one_setup' );
/** /**
* Register widget area. * Registers widget area.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -364,7 +364,7 @@ function twenty_twenty_one_widgets_init() {
add_action( 'widgets_init', 'twenty_twenty_one_widgets_init' ); add_action( 'widgets_init', 'twenty_twenty_one_widgets_init' );
/** /**
* Set the content width in pixels, based on the theme's design and stylesheet. * Sets the content width in pixels, based on the theme's design and stylesheet.
* *
* Priority 0 to make it available to lower priority callbacks. * Priority 0 to make it available to lower priority callbacks.
* *
@ -383,10 +383,13 @@ function twenty_twenty_one_content_width() {
add_action( 'after_setup_theme', 'twenty_twenty_one_content_width', 0 ); add_action( 'after_setup_theme', 'twenty_twenty_one_content_width', 0 );
/** /**
* Enqueue scripts and styles. * Enqueues scripts and styles.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
* @global bool $is_IE
* @global WP_Scripts $wp_scripts
*
* @return void * @return void
*/ */
function twenty_twenty_one_scripts() { function twenty_twenty_one_scripts() {
@ -462,7 +465,7 @@ function twenty_twenty_one_scripts() {
add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' ); add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' );
/** /**
* Enqueue block editor script. * Enqueues block editor script.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -476,7 +479,7 @@ function twentytwentyone_block_editor_script() {
add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' ); add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' );
/** /**
* Fix skip link focus in IE11. * Fixes skip link focus in IE11.
* *
* This does not enqueue the script because it is tiny and because it is only for IE11, * This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded. * thus it does not warrant having an entire dedicated blocking script being loaded.
@ -504,7 +507,7 @@ function twenty_twenty_one_skip_link_focus_fix() {
} }
/** /**
* Enqueue non-latin language styles. * Enqueues non-latin language styles.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -550,7 +553,7 @@ require_once get_template_directory() . '/classes/class-twenty-twenty-one-dark-m
new Twenty_Twenty_One_Dark_Mode(); new Twenty_Twenty_One_Dark_Mode();
/** /**
* Enqueue scripts for the customizer preview. * Enqueues scripts for the customizer preview.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -576,7 +579,7 @@ function twentytwentyone_customize_preview_init() {
add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' ); add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' );
/** /**
* Enqueue scripts for the customizer. * Enqueues scripts for the customizer.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -595,7 +598,7 @@ function twentytwentyone_customize_controls_enqueue_scripts() {
add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' ); add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' );
/** /**
* Calculate classes for the main <html> element. * Calculates classes for the main <html> element.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *
@ -617,7 +620,7 @@ function twentytwentyone_the_html_classes() {
} }
/** /**
* Add "is-IE" class to body if the user is on Internet Explorer. * Adds "is-IE" class to body if the user is on Internet Explorer.
* *
* @since Twenty Twenty-One 1.0 * @since Twenty Twenty-One 1.0
* *

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-beta2-56117'; $wp_version = '6.3-beta2-56118';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.