mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 23:57:41 +02:00
Twenty Twenty-One: Improve documentation per the documentation standards:
* Remove unnecessary `@access` tags that were previously removed from core. * Remove an empty line between `@param` and `@return` tags. * Correct alignment of `@param` tags. Follow-up to [41161], [41162], [41168], [49216], [49220]. See #52628, #53461. Built from https://develop.svn.wordpress.org/trunk@51294 git-svn-id: http://core.svn.wordpress.org/trunk@50903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4871e33916
commit
61b5311c57
@ -15,8 +15,6 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
/**
|
||||
* Instantiate the object.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*/
|
||||
public function __construct() {
|
||||
@ -34,12 +32,9 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
/**
|
||||
* Determine the luminance of the given color and then return #fff or #000 so that the text is always readable.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $background_color The background color.
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $background_color The background color.
|
||||
* @return string (hex color)
|
||||
*/
|
||||
public function custom_get_readable_color( $background_color ) {
|
||||
@ -53,12 +48,9 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
* Both text and link colors needs to be updated.
|
||||
* The code below needs to be updated, because the colors are no longer theme mods.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string|null $context Can be "editor" or null.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generate_custom_color_variables( $context = null ) {
|
||||
@ -87,8 +79,6 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
/**
|
||||
* Customizer & frontend custom color variables.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -102,8 +92,6 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
/**
|
||||
* Editor custom color variables.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -127,12 +115,9 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $hex The HEX color.
|
||||
*
|
||||
* @return int Returns a number (0-255).
|
||||
*/
|
||||
public static function get_relative_luminance_from_hex( $hex ) {
|
||||
@ -158,12 +143,9 @@ class Twenty_Twenty_One_Custom_Colors {
|
||||
/**
|
||||
* Adds a class to <body> if the background-color is dark.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param array $classes The existing body classes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function body_class( $classes ) {
|
||||
|
@ -27,8 +27,6 @@ class Twenty_Twenty_One_Customize_Color_Control extends WP_Customize_Color_Contr
|
||||
/**
|
||||
* Colorpicker palette
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @var array
|
||||
@ -38,8 +36,6 @@ class Twenty_Twenty_One_Customize_Color_Control extends WP_Customize_Color_Contr
|
||||
/**
|
||||
* Enqueue control related scripts/styles.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -60,8 +56,6 @@ class Twenty_Twenty_One_Customize_Color_Control extends WP_Customize_Color_Contr
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @uses WP_Customize_Control::to_json()
|
||||
|
@ -29,8 +29,6 @@ class Twenty_Twenty_One_Customize_Notice_Control extends WP_Customize_Control {
|
||||
*
|
||||
* This simply prints the notice we need.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
|
@ -18,8 +18,6 @@ if ( ! class_exists( 'Twenty_Twenty_One_Customize' ) ) {
|
||||
/**
|
||||
* Constructor. Instantiate the object.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*/
|
||||
public function __construct() {
|
||||
@ -29,12 +27,9 @@ if ( ! class_exists( 'Twenty_Twenty_One_Customize' ) ) {
|
||||
/**
|
||||
* Register customizer options.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register( $wp_customize ) {
|
||||
@ -151,12 +146,9 @@ if ( ! class_exists( 'Twenty_Twenty_One_Customize' ) ) {
|
||||
/**
|
||||
* Sanitize boolean for checkbox.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param bool $checked Whether or not a box is checked.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function sanitize_checkbox( $checked = null ) {
|
||||
@ -166,8 +158,6 @@ if ( ! class_exists( 'Twenty_Twenty_One_Customize' ) ) {
|
||||
/**
|
||||
* Render the site title for the selective refresh partial.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -179,8 +169,6 @@ if ( ! class_exists( 'Twenty_Twenty_One_Customize' ) ) {
|
||||
/**
|
||||
* Render the site tagline for the selective refresh partial.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
|
@ -15,8 +15,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Instantiate the object.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*/
|
||||
public function __construct() {
|
||||
@ -49,8 +47,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Editor custom color variables & scripts.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -88,8 +84,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Enqueue scripts and styles.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -108,8 +102,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Enqueue scripts for the customizer.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -130,12 +122,9 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Register customizer options.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function customizer_controls( $wp_customize ) {
|
||||
@ -222,12 +211,9 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Calculate classes for the main <html> element.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $classes The classes for <html> element.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function html_classes( $classes ) {
|
||||
@ -247,12 +233,9 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Adds a class to the <body> element in the editor to accommodate dark-mode.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $classes The admin body-classes.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function admin_body_classes( $classes ) {
|
||||
@ -280,8 +263,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Determine if we want to print the dark-mode switch or not.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return bool
|
||||
@ -298,8 +279,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Add night/day switch.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -317,12 +296,9 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
*
|
||||
* Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed)
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param array $attrs The attributes to add to our <button> element.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function the_html( $attrs = array() ) {
|
||||
@ -378,8 +354,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Print the dark-mode switch script.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
@ -393,8 +367,6 @@ class Twenty_Twenty_One_Dark_Mode {
|
||||
/**
|
||||
* Adds information to the privacy policy.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @return void
|
||||
|
@ -24,8 +24,6 @@ class Twenty_Twenty_One_SVG_Icons {
|
||||
/**
|
||||
* User Interface icons – svg sources.
|
||||
*
|
||||
* @access protected
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @var array
|
||||
@ -42,8 +40,6 @@ class Twenty_Twenty_One_SVG_Icons {
|
||||
/**
|
||||
* Social Icons – svg sources.
|
||||
*
|
||||
* @access protected
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @var array
|
||||
@ -148,14 +144,11 @@ class Twenty_Twenty_One_SVG_Icons {
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $group the icon group.
|
||||
* @param string $icon The icon.
|
||||
* @param int $size The icon-size in pixels.
|
||||
*
|
||||
* @param string $group The icon group.
|
||||
* @param string $icon The icon.
|
||||
* @param int $size The icon-size in pixels.
|
||||
* @return string
|
||||
*/
|
||||
public static function get_svg( $group, $icon, $size ) {
|
||||
@ -196,13 +189,10 @@ class Twenty_Twenty_One_SVG_Icons {
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $uri Social link.
|
||||
* @param string $uri Social link.
|
||||
* @param int $size The icon-size in pixels.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public static function get_social_link_svg( $uri, $size ) {
|
||||
|
@ -13,12 +13,11 @@
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $selector The CSS selector.
|
||||
* @param string $style The CSS style.
|
||||
* @param string $value The CSS value.
|
||||
* @param string $prefix The CSS prefix.
|
||||
* @param string $suffix The CSS suffix.
|
||||
* @param bool $echo Echo the styles.
|
||||
*
|
||||
* @param string $style The CSS style.
|
||||
* @param string $value The CSS value.
|
||||
* @param string $prefix The CSS prefix.
|
||||
* @param string $suffix The CSS suffix.
|
||||
* @param bool $echo Echo the styles.
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {
|
||||
@ -31,7 +30,7 @@ function twenty_twenty_one_generate_css( $selector, $style, $value, $prefix = ''
|
||||
$css = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix );
|
||||
|
||||
if ( $echo ) {
|
||||
/**
|
||||
/*
|
||||
* Note to reviewers: $css contains auto-generated CSS.
|
||||
* It is included inside <style> tags and can only be interpreted as CSS on the browser.
|
||||
* Using wp_strip_all_tags() here is sufficient escaping to avoid
|
||||
|
@ -22,7 +22,6 @@
|
||||
* @param object $item Nav menu item.
|
||||
* @param int $depth Depth.
|
||||
* @param object $args Nav menu args.
|
||||
*
|
||||
* @return string Nav menu item start element.
|
||||
*/
|
||||
function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args ) {
|
||||
@ -44,9 +43,8 @@ add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle',
|
||||
*
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $uri Social link.
|
||||
* @param string $uri Social link.
|
||||
* @param int $size The icon size in pixels.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_get_social_link_svg( $uri, $size = 24 ) {
|
||||
@ -84,7 +82,6 @@ add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons
|
||||
* @param stdClass $args An object of wp_nav_menu() arguments.
|
||||
* @param WP_Post $item Menu item data object.
|
||||
* @param int $depth Depth of menu item. Used for padding.
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
function twenty_twenty_one_add_menu_description_args( $args, $item, $depth ) {
|
||||
|
@ -13,7 +13,6 @@
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param array $classes Classes for the body element.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function twenty_twenty_one_body_classes( $classes ) {
|
||||
@ -44,7 +43,6 @@ add_filter( 'body_class', 'twenty_twenty_one_body_classes' );
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param array $classes An array of CSS classes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function twenty_twenty_one_post_classes( $classes ) {
|
||||
@ -86,7 +84,6 @@ add_action( 'wp_footer', 'twenty_twenty_one_supports_js' );
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param array $defaults The form defaults.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function twenty_twenty_one_comment_form_defaults( $defaults ) {
|
||||
@ -167,7 +164,6 @@ if ( ! function_exists( 'twenty_twenty_one_post_title' ) ) {
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $title The title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_post_title( $title ) {
|
||||
@ -182,9 +178,8 @@ add_filter( 'the_title', 'twenty_twenty_one_post_title' );
|
||||
* @since Twenty Twenty-One 1.0
|
||||
*
|
||||
* @param string $group The icon group.
|
||||
* @param string $icon The icon.
|
||||
* @param int $size The icon size in pixels.
|
||||
*
|
||||
* @param string $icon The icon.
|
||||
* @param int $size The icon size in pixels.
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_get_icon_svg( $group, $icon, $size = 24 ) {
|
||||
@ -195,7 +190,6 @@ function twenty_twenty_one_get_icon_svg( $group, $icon, $size = 24 ) {
|
||||
* Changes the default navigation arrows to svg icons
|
||||
*
|
||||
* @param string $calendar_output The generated HTML of the calendar.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_change_calendar_nav_arrows( $calendar_output ) {
|
||||
@ -211,7 +205,6 @@ add_filter( 'get_calendar', 'twenty_twenty_one_change_calendar_nav_arrows' );
|
||||
* Return CSS for non-latin language, if available, or null
|
||||
*
|
||||
* @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function twenty_twenty_one_get_non_latin_css( $type = 'front-end' ) {
|
||||
@ -328,8 +321,7 @@ function twenty_twenty_one_get_non_latin_css( $type = 'front-end' ) {
|
||||
* @param string $block_name The full block type name, or a partial match.
|
||||
* Example: `core/image`, `core-embed/*`.
|
||||
* @param string|null $content The content to search in. Use null for get_the_content().
|
||||
* @param int $instances How many instances of the block will be printed (max). Defaults to 1.
|
||||
*
|
||||
* @param int $instances How many instances of the block will be printed (max). Default 1.
|
||||
* @return bool Returns true if a block was located & printed, otherwise false.
|
||||
*/
|
||||
function twenty_twenty_one_print_first_instance_of_block( $block_name, $content = null, $instances = 1 ) {
|
||||
@ -415,7 +407,6 @@ add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2 );
|
||||
* @param WP_Post $attachment Image attachment post.
|
||||
* @param string|array $size Requested size. Image size or array of width and height values
|
||||
* (in that order). Default 'thumbnail'.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size ) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51293';
|
||||
$wp_version = '5.9-alpha-51294';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user