Skip to content

Commit 5b1a821

Browse files
Docs: Add missing @return descriptions in bundled themes.
Adds missing descriptions to tags and adds missing tags in various files across Twenty Fourteen, Twenty Seventeen, Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One to comply with WordPress PHP Documentation Standards.
1 parent 33c8d7e commit 5b1a821

File tree

12 files changed

+25
-18
lines changed

12 files changed

+25
-18
lines changed

src/wp-content/themes/twentyfourteen/functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function twentyfourteen_widgets_init() {
315315
* @since Twenty Fourteen 1.0
316316
* @since Twenty Fourteen 3.6 Replaced Google URL with self-hosted fonts.
317317
*
318-
* @return string
318+
* @return string Fonts URL for the theme.
319319
*/
320320
function twentyfourteen_font_url() {
321321
$font_url = '';
@@ -755,6 +755,8 @@ function twentyfourteen_register_block_patterns() {
755755
* `is_customize_preview` function was introduced.
756756
*
757757
* @global WP_Customize_Manager $wp_customize Customizer object.
758+
*
759+
* @return bool True if the site is being previewed in the Customizer, false otherwise.
758760
*/
759761
if ( ! function_exists( 'is_customize_preview' ) ) :
760762
function is_customize_preview() {

src/wp-content/themes/twentyfourteen/inc/widgets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
2626
*
2727
* @since Twenty Fourteen 1.0
2828
*
29-
* @return Twenty_Fourteen_Ephemera_Widget
29+
* @return Twenty_Fourteen_Ephemera_Widget Widget instance.
3030
*/
3131
public function __construct() {
3232
parent::__construct(

src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class TwentyNineteen_SVG_Icons {
2727
* @param string $group The group of icons ('ui' or 'social').
2828
* @param string $icon The specific icon to retrieve.
2929
* @param int $size The desired width and height for the SVG icon.
30+
* @return string|null SVG code for the icon, or null if not found.
3031
*/
3132
public static function get_svg( $group, $icon, $size ) {
3233
if ( 'ui' === $group ) {
@@ -51,6 +52,7 @@ public static function get_svg( $group, $icon, $size ) {
5152
*
5253
* @param string $uri The URL of the social network link.
5354
* @param int $size The desired width and height for the SVG icon.
55+
* @return string|null SVG code for the social link icon, or null if not found.
5456
*/
5557
public static function get_social_link_svg( $uri, $size ) {
5658
static $regex_map; // Only compute regex map once, for performance.

src/wp-content/themes/twentynineteen/functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ function twentynineteen_setup() {
182182
* Added for backward compatibility to support pre-6.0.0 WordPress versions.
183183
*
184184
* @since 6.0.0
185+
*
186+
* @return string List item separator.
185187
*/
186188
function wp_get_list_item_separator() {
187189
/* translators: Used between list items, there is a space after the comma. */

src/wp-content/themes/twentynineteen/inc/customizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function twentynineteen_panels_js() {
142142
* Sanitizes custom color choice.
143143
*
144144
* @param string $choice Whether image filter is active.
145-
* @return string
145+
* @return string Sanitized color option.
146146
*/
147147
function twentynineteen_sanitize_color_option( $choice ) {
148148
$valid = array(

src/wp-content/themes/twentynineteen/inc/template-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Adds custom classes to the array of body classes.
1212
*
1313
* @param array $classes Classes for the body element.
14-
* @return array
14+
* @return array The filtered body class list.
1515
*/
1616
function twentynineteen_body_classes( $classes ) {
1717

src/wp-content/themes/twentyseventeen/inc/template-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Adds custom classes to the array of body classes.
1212
*
1313
* @param array $classes Classes for the body element.
14-
* @return array
14+
* @return array Filtered body classes with theme-specific additions.
1515
*/
1616
function twentyseventeen_body_classes( $classes ) {
1717
// Add class of group-blog to blogs with more than 1 published author.

src/wp-content/themes/twentyseventeen/inc/template-tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
184184
/**
185185
* Returns true if a blog has more than 1 category.
186186
*
187-
* @return bool
187+
* @return bool True if the blog has more than 1 category, false otherwise.
188188
*/
189189
function twentyseventeen_categorized_blog() {
190190
$category_count = get_transient( 'twentyseventeen_categories' );

src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ public static function sanitize_select( $input, $setting ) {
459459
* @since Twenty Twenty 1.0
460460
*
461461
* @param bool $checked Whether or not a box is checked.
462-
* @return bool
462+
* @return bool True if the checkbox is checked, false otherwise.
463463
*/
464464
public static function sanitize_checkbox( $checked ) {
465465
return ( ( isset( $checked ) && true === $checked ) ? true : false );

src/wp-content/themes/twentytwenty/functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ function twentytwenty_menus() {
304304
* @since Twenty Twenty 1.0
305305
*
306306
* @param string $html The HTML output from get_custom_logo() (core function).
307-
* @return string
307+
* @return string Custom logo HTML with retina support.
308308
*/
309309
function twentytwenty_get_custom_logo( $html ) {
310310

@@ -635,7 +635,7 @@ function twentytwenty_block_editor_settings() {
635635
* Overwrite default more tag with styling and screen reader markup.
636636
*
637637
* @param string $html The default output HTML for the more tag.
638-
* @return string
638+
* @return string The filtered HTML of the more tag, wrapped in a wrapper div.
639639
*/
640640
function twentytwenty_read_more_tag( $html ) {
641641
return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$1><span class="faux-button">$2</span> <span class="screen-reader-text">"%1$s"</span></a></div>', get_the_title( get_the_ID() ) ), $html );
@@ -736,7 +736,7 @@ function twentytwenty_get_color_for_area( $area = 'content', $context = 'text' )
736736
*
737737
* @since Twenty Twenty 1.0
738738
*
739-
* @return array
739+
* @return array Customizer color variables for the preview.
740740
*/
741741
function twentytwenty_get_customizer_color_vars() {
742742
$colors = array(
@@ -755,7 +755,7 @@ function twentytwenty_get_customizer_color_vars() {
755755
*
756756
* @since Twenty Twenty 1.0
757757
*
758-
* @return array
758+
* @return array Elements to apply custom colors to.
759759
*/
760760
function twentytwenty_get_elements_array() {
761761

0 commit comments

Comments
 (0)