From b275b38768fc2c2208e44bf6e9121a117c8ce119 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 25 Sep 2024 18:06:27 +0000 Subject: [PATCH] Twenty Nineteen: Add missing documentation for helper function parameters. Follow-up to [43808], [44149], [47214], [47242]. Props pitamdey. Fixes #62112. git-svn-id: https://develop.svn.wordpress.org/trunk@59090 602fd350-edb4-49c9-b593-d223f7449a82 --- .../classes/class-twentynineteen-svg-icons.php | 7 +++++++ src/wp-content/themes/twentynineteen/header.php | 1 + .../themes/twentynineteen/inc/helper-functions.php | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php b/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php index 9361305d424da..eaca9fb414eef 100644 --- a/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php +++ b/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php @@ -23,6 +23,10 @@ class TwentyNineteen_SVG_Icons { /** * Gets the SVG code for a given icon. + * + * @param string $group The group of icons ('ui' or 'social'). + * @param string $icon The specific icon to retrieve. + * @param int $size The desired width and height for the SVG icon. */ public static function get_svg( $group, $icon, $size ) { if ( 'ui' === $group ) { @@ -44,6 +48,9 @@ public static function get_svg( $group, $icon, $size ) { /** * Detects the social network from a URL and returns the SVG code for its icon. + * + * @param string $uri The URL of the social network link. + * @param int $size The desired width and height for the SVG icon. */ public static function get_social_link_svg( $uri, $size ) { static $regex_map; // Only compute regex map once, for performance. diff --git a/src/wp-content/themes/twentynineteen/header.php b/src/wp-content/themes/twentynineteen/header.php index 119417460cbf0..483355892799e 100644 --- a/src/wp-content/themes/twentynineteen/header.php +++ b/src/wp-content/themes/twentynineteen/header.php @@ -10,6 +10,7 @@ * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ + ?> > diff --git a/src/wp-content/themes/twentynineteen/inc/helper-functions.php b/src/wp-content/themes/twentynineteen/inc/helper-functions.php index c18275604a673..51c93835f80f5 100644 --- a/src/wp-content/themes/twentynineteen/inc/helper-functions.php +++ b/src/wp-content/themes/twentynineteen/inc/helper-functions.php @@ -32,6 +32,9 @@ function twentynineteen_get_avatar_size() { * Returns true if comment is by author of the post. * * @see get_comment_class() + * + * @param WP_Comment|null $comment The comment object to check. Defaults to the current comment. + * @return bool True if the comment is by the author of the post, false otherwise. */ function twentynineteen_is_comment_by_post_author( $comment = null ) { if ( is_object( $comment ) && $comment->user_id > 0 ) { @@ -82,7 +85,12 @@ function twentynineteen_get_discussion_data() { } /** - * Converts HSL to HEX colors. + * Converts HSL to HEX or RGB colors. + * + * @param float $h The hue component (0-360). + * @param float $s The saturation component (0-100). + * @param float $l The lightness component (0-100). + * @param bool $to_hex Whether to convert to HEX format (true) or RGB (false). Default true. */ function twentynineteen_hsl_hex( $h, $s, $l, $to_hex = true ) {