Skip to content

Commit

Permalink
Twenty Nineteen: Add missing documentation for helper function parame…
Browse files Browse the repository at this point in the history
…ters.

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
  • Loading branch information
SergeyBiryukov committed Sep 25, 2024
1 parent 34c861b commit b275b38
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions src/wp-content/themes/twentynineteen/header.php
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
* @subpackage Twenty_Nineteen
* @since Twenty Nineteen 1.0
*/

?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
10 changes: 9 additions & 1 deletion src/wp-content/themes/twentynineteen/inc/helper-functions.php
Original file line number Diff line number Diff line change
@@ -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 ) {

0 comments on commit b275b38

Please sign in to comment.