From 521db026476adce2faec01fa6c8dbe31f015fa80 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 2 Apr 2022 13:55:11 +0000 Subject: [PATCH] Docs: Further remove HTML markup from various function summaries. Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#summary-formerly-short-description WordPress PHP documentation standards], no HTML markup or Markdown of any kind should be used in the summary. This ensures that the summary is displayed correctly in the [https://developer.wordpress.org/reference/ WordPress Code Reference]. This commit also improves formatting of HTML special characters in descriptions in `wp-includes/formatting.php`. Follow-up to [53048]. Props johnbillion, mukesh27. Fixes #55506. Built from https://develop.svn.wordpress.org/trunk@53053 git-svn-id: http://core.svn.wordpress.org/trunk@52642 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/embed.php | 2 +- wp-includes/formatting.php | 22 +++++++++---------- wp-includes/functions.wp-scripts.php | 4 ++-- .../class-wp-rest-url-details-controller.php | 2 +- wp-includes/theme.php | 2 +- wp-includes/version.php | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/wp-includes/embed.php b/wp-includes/embed.php index 7efee7107d..bc0806e1e2 100644 --- a/wp-includes/embed.php +++ b/wp-includes/embed.php @@ -328,7 +328,7 @@ function wp_oembed_register_route() { } /** - * Adds oEmbed discovery links in the website . + * Adds oEmbed discovery links in the head element of the website. * * @since 4.4.0 */ diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 32a8b86bb1..0441866344 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -374,8 +374,8 @@ function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quo * Searches for disabled element tags. Pushes element to stack on tag open * and pops on tag close. * - * Assumes first char of $text is tag opening and last char is tag closing. - * Assumes second char of $text is optionally '/' to indicate closing as in . + * Assumes first char of `$text` is tag opening and last char is tag closing. + * Assumes second char of `$text` is optionally `/` to indicate closing as in ``. * * @since 2.9.0 * @access private @@ -429,7 +429,7 @@ function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) { * * A group of regex replaces used to identify text formatted with newlines and * replace double line breaks with HTML paragraph tags. The remaining line breaks - * after conversion become <
> tags, unless $br is set to '0' or 'false'. + * after conversion become `
` tags, unless `$br` is set to '0' or 'false'. * * @since 0.71 * @@ -909,10 +909,10 @@ function seems_utf8( $str ) { /** * Converts a number of special characters into their HTML entities. * - * Specifically deals with: &, <, >, ", and '. + * Specifically deals with: `&`, `<`, `>`, `"`, and `'`. * - * $quote_style can be set to ENT_COMPAT to encode " to - * ", or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded. + * `$quote_style` can be set to ENT_COMPAT to encode `"` to + * `"`, or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded. * * @since 1.2.2 * @since 5.5.0 `$quote_style` also accepts `ENT_XML1`. @@ -994,10 +994,10 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals /** * Converts a number of HTML entities into their special characters. * - * Specifically deals with: &, <, >, ", and '. + * Specifically deals with: `&`, `<`, `>`, `"`, and `'`. * - * $quote_style can be set to ENT_COMPAT to decode " entities, - * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded. + * `$quote_style` can be set to ENT_COMPAT to decode `"` entities, + * or ENT_QUOTES to do both `"` and `'`. Default is ENT_NOQUOTES where no quotes are decoded. * * @since 2.8.0 * @@ -4510,10 +4510,10 @@ function htmlentities2( $myHTML ) { } /** - * Escapes single quotes, htmlspecialchar " < > &, and fixes line endings. + * Escapes single quotes, `"`, `<`, `>`, `&`, and fixes line endings. * * Escapes text strings for echoing in JS. It is intended to be used for inline JS - * (in a tag attribute, for example onclick="..."). Note that the strings have to + * (in a tag attribute, for example `onclick="..."`). Note that the strings have to * be in single quotes. The {@see 'js_escape'} filter is also applied here. * * @since 2.8.0 diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php index 82d3685672..296aba3891 100644 --- a/wp-includes/functions.wp-scripts.php +++ b/wp-includes/functions.wp-scripts.php @@ -166,7 +166,7 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) { * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. - * @param bool $in_footer Optional. Whether to enqueue the script before instead of in the . + * @param bool $in_footer Optional. Whether to enqueue the script before `` instead of in the ``. * Default 'false'. * @return bool Whether the script has been registered. True on success, false on failure. */ @@ -340,7 +340,7 @@ function wp_deregister_script( $handle ) { * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. - * @param bool $in_footer Optional. Whether to enqueue the script before instead of in the . + * @param bool $in_footer Optional. Whether to enqueue the script before `` instead of in the ``. * Default 'false'. */ function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = false ) { diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php index d65b40a437..4a87e4f695 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php @@ -482,7 +482,7 @@ class WP_REST_URL_Details_Controller extends WP_REST_Controller { } /** - * Retrieves the head tag section. + * Retrieves the head element section. * * @since 5.9.0 * diff --git a/wp-includes/theme.php b/wp-includes/theme.php index ed24f677ef..d511ab1a8d 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1948,7 +1948,7 @@ function wp_get_custom_css( $stylesheet = '' ) { } /** - * Filters the Custom CSS Output into the . + * Filters the custom CSS output into the head element. * * @since 4.7.0 * diff --git a/wp-includes/version.php b/wp-includes/version.php index 6aa97d15bd..1c12d788b3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53052'; +$wp_version = '6.0-alpha-53053'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.