Docs: Remove an empty line between @param and @return tags, per the documentation standards.

See #49572.
Built from https://develop.svn.wordpress.org/trunk@48102


git-svn-id: http://core.svn.wordpress.org/trunk@47871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-06-20 11:18:09 +00:00
parent afe406b82e
commit a576a13246
30 changed files with 79 additions and 106 deletions

View File

@ -658,7 +658,6 @@ class WP_Media_List_Table extends WP_List_Table {
/**
* @param WP_Post $post
* @param string $att_title
*
* @return array
*/
private function _get_row_actions( $post, $att_title ) {

View File

@ -148,7 +148,6 @@ class WP_Site_Health {
* @since 5.4.0
*
* @param $callback
*
* @return mixed|void
*/
private function perform_test( $callback ) {
@ -790,7 +789,6 @@ class WP_Site_Health {
* @param string $function Optional. The function name to test. Default null.
* @param string $constant Optional. The constant name to test for. Default null.
* @param string $class Optional. The class name to test for. Default null.
*
* @return bool Whether or not the extension and function are available.
*/
private function test_php_extension_availability( $extension = null, $function = null, $constant = null, $class = null ) {

View File

@ -21,7 +21,6 @@
* @param string $comment_author Author of the comment.
* @param string $comment_date Date of the comment.
* @param string $timezone Timezone. Accepts 'blog' or 'gmt'. Default 'blog'.
*
* @return mixed Comment post ID on success.
*/
function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) {

View File

@ -1976,7 +1976,6 @@ function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f
* @param array $extra_fields Optional. Extra `POST` fields to be checked for inclusion in
* the post. Default null.
* @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
*
* @return bool|array True if no filesystem credentials are required, false if they are required but have not been
* provided, array of credentials if they are required and have been provided.
*/

View File

@ -1401,7 +1401,6 @@ All at ###SITENAME###
*
* @param string $title Page title.
* @param WP_Post $page Page data object.
*
* @return string Page title.
*/
function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {

View File

@ -15,7 +15,6 @@
* @param WP_Post|int $post The post object or post ID.
* @param int $compare_from The revision ID to compare from.
* @param int $compare_to The revision ID to come to.
*
* @return array|bool Associative array of a post's revisioned fields and their diffs.
* Or, false on failure.
*/
@ -161,7 +160,6 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
* @param WP_Post|int $post The post object or post ID.
* @param int $selected_revision_id The selected revision ID.
* @param int $from Optional. The revision ID to compare from.
*
* @return array An associative array of revision data and related settings.
*/
function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {

View File

@ -141,7 +141,6 @@ add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );
* Sanitize custom color choice.
*
* @param string $choice Whether image filter is active.
*
* @return string
*/
function twentynineteen_sanitize_color_option( $choice ) {

View File

@ -589,8 +589,8 @@ add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnai
* @since Twenty Seventeen 1.0
*
* @param string $template front-page.php.
*
* @return string The template to be used: blank if is_home() is true (defaults to index.php), else $template.
* @return string The template to be used: blank if is_home() is true (defaults to index.php),
* otherwise $template.
*/
function twentyseventeen_front_page_template( $template ) {
return is_home() ? '' : $template;
@ -617,7 +617,7 @@ function twentyseventeen_widget_tag_cloud_args( $args ) {
add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' );
/**
* Get unique ID.
* Gets unique ID.
*
* This is a PHP implementation of Underscore's uniqueId method. A static variable
* contains an integer that is incremented with each call. This number is returned

View File

@ -416,7 +416,7 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
* @access public
* @since Twenty Twenty 1.0
* @param array $value The value we want to sanitize.
* @return array Returns sanitized value. Each item in the array gets sanitized separately.
* @return array Returns sanitized value. Each item in the array gets sanitized separately.
*/
public static function sanitize_accent_accessible_colors( $value ) {
@ -438,8 +438,7 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
*
* @param string $input The input from the setting.
* @param object $setting The selected setting.
*
* @return string $input|$setting->default The input from the setting or the default setting.
* @return string The input from the setting or the default setting.
*/
public static function sanitize_select( $input, $setting ) {
$input = sanitize_key( $input );
@ -451,7 +450,6 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
* Sanitize boolean for checkbox.
*
* @param bool $checked Whether or not a box is checked.
*
* @return bool
*/
public static function sanitize_checkbox( $checked ) {

View File

@ -21,7 +21,6 @@ if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
* 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 void
*/
public static function get_non_latin_css( $type = 'front-end' ) {

View File

@ -271,8 +271,7 @@ add_action( 'init', 'twentytwenty_menus' );
* Get the information about the logo.
*
* @param string $html The HTML output from get_custom_logo (core function).
*
* @return string $html
* @return string
*/
function twentytwenty_get_custom_logo( $html ) {
@ -427,8 +426,7 @@ add_action( 'init', 'twentytwenty_classic_editor_styles' );
* Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.
*
* @param array $mce_init TinyMCE styles.
*
* @return array $mce_init TinyMCE styles.
* @return array TinyMCE styles.
*/
function twentytwenty_add_classic_editor_customizer_styles( $mce_init ) {
@ -451,8 +449,7 @@ add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_customizer_
* Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.
*
* @param array $mce_init TinyMCE styles.
*
* @return array $mce_init TinyMCE styles.
* @return array TinyMCE styles.
*/
function twentytwenty_add_classic_editor_non_latin_styles( $mce_init ) {
@ -569,8 +566,7 @@ add_action( 'after_setup_theme', 'twentytwenty_block_editor_settings' );
* Overwrite default more tag with styling and screen reader markup.
*
* @param string $html The default output HTML for the more tag.
*
* @return string $html
* @return string
*/
function twentytwenty_read_more_tag( $html ) {
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 );

View File

@ -15,7 +15,8 @@
* Passes it through the `twentytwenty_starter_content` filter before returning.
*
* @since Twenty Twenty 1.0
* @return array a filtered array of args for the starter_content.
*
* @return array A filtered array of args for the starter_content.
*/
function twentytwenty_get_starter_content() {

View File

@ -21,13 +21,13 @@
/**
* Logo & Description
*/
/**
* Displays the site logo, either text or image.
*
* @param array $args Arguments for displaying the site logo either as an image or text.
* @param boolean $echo Echo or return the HTML.
*
* @return string $html Compiled HTML based on our arguments.
* @return string Compiled HTML based on our arguments.
*/
function twentytwenty_site_logo( $args = array(), $echo = true ) {
$logo = get_custom_logo();
@ -89,8 +89,7 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) {
* Displays the site description.
*
* @param boolean $echo Echo or return the html.
*
* @return string $html The HTML to display.
* @return string The HTML to display.
*/
function twentytwenty_site_description( $echo = true ) {
$description = get_bloginfo( 'description' );
@ -124,11 +123,11 @@ function twentytwenty_site_description( $echo = true ) {
/**
* Comments
*/
/**
* Check if the specified comment is written by the author of the post commented on.
* Checks if the specified comment is written by the author of the post commented on.
*
* @param object $comment Comment data.
*
* @return bool
*/
function twentytwenty_is_comment_by_post_author( $comment = null ) {
@ -149,13 +148,13 @@ function twentytwenty_is_comment_by_post_author( $comment = null ) {
}
/**
* Filter comment reply link to not JS scroll.
* Filters comment reply link to not JS scroll.
*
* Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it
* makes it scroll to the wrong position on the page.
*
* @param string $link Link to the top of the page.
*
* @return string $link Link to the top of the page.
* @return string Link to the top of the page.
*/
function twentytwenty_filter_comment_reply_link( $link ) {
@ -169,11 +168,13 @@ add_filter( 'comment_reply_link', 'twentytwenty_filter_comment_reply_link' );
/**
* Post Meta
*/
/**
* Get and Output Post Meta.
* If it's a single post, output the post meta values specified in the Customizer settings.
* Retrieves and displays the post meta.
*
* @param int $post_id The ID of the post for which the post meta should be output.
* If it's a single post, outputs the post meta values specified in the Customizer settings.
*
* @param int $post_id The ID of the post for which the post meta should be output.
* @param string $location Which post meta location to output single or preview.
*/
function twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' ) {
@ -220,7 +221,7 @@ function twentytwenty_edit_post_link( $link, $post_id, $text ) {
add_filter( 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );
/**
* Get the post meta.
* Retrieves the post meta.
*
* @param int $post_id The ID of the post.
* @param string $location The location where the meta is shown.
@ -233,15 +234,17 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
}
/**
* Filters post types array
* Filters post types array.
*
* This filter can be used to hide post meta information of post, page or custom post type registerd by child themes or plugins
* This filter can be used to hide post meta information of post, page or custom post type
* registered by child themes or plugins.
*
* @since Twenty Twenty 1.0
*
* @param array Array of post types
*/
$disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );
// Check whether the post type is allowed to output post meta.
if ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) {
return;
@ -253,19 +256,19 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
// Get the post meta settings for the location specified.
if ( 'single-top' === $location ) {
/**
* Filters post meta info visibility
*
* Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'author'
* @type string 'post-date'
* @type string 'comments'
* @type string 'sticky'
* }
*/
* Filters post meta info visibility.
*
* Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status.
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'author'
* @type string 'post-date'
* @type string 'comments'
* @type string 'sticky'
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_top',
array(
@ -281,16 +284,16 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
} elseif ( 'single-bottom' === $location ) {
/**
* Filters post tags visibility
*
* Use this filter to hide post tags
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'tags'
* }
*/
* Filters post tags visibility.
*
* Use this filter to hide post tags.
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'tags'
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_bottom',
array(
@ -489,8 +492,10 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
/**
* Menus
*/
/**
* Filter Classes of wp_list_pages items to match menu items.
* Filters classes of wp_list_pages items to match menu items.
*
* Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify.
* styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.
*
@ -499,7 +504,6 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
* @param int $depth Depth of the current comment.
* @param array $args An array of arguments.
* @param string $current_page Whether or not the item is the current item.
*
* @return array $css_class CSS Class names.
*/
function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $item, $depth, $args, $current_page ) {
@ -528,12 +532,11 @@ function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $item, $dep
add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 5 );
/**
* Add a Sub Nav Toggle to the Expanded Menu and Mobile Menu.
* Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu.
*
* @param stdClass $args An array of arguments.
* @param string $item Menu item.
* @param int $depth Depth of the current menu item.
*
* @return stdClass $args An object of wp_nav_menu() arguments.
*/
function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
@ -575,7 +578,7 @@ function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 3 );
/**
* Display SVG icons in social links menu.
* Displays SVG icons in social links menu.
*
* @param string $item_output The menu item output.
* @param WP_Post $item Menu item object.
@ -601,9 +604,11 @@ add_filter( 'walker_nav_menu_start_el', 'twentytwenty_nav_menu_social_icons', 10
/**
* Classes
*/
/**
* Add No-JS Class.
* If we're missing JavaScript support, the HTML element will have a no-js class.
* Adds 'no-js' class.
*
* If we're missing JavaScript support, the HTML element will have a 'no-js' class.
*/
function twentytwenty_no_js_class() {
@ -616,11 +621,10 @@ function twentytwenty_no_js_class() {
add_action( 'wp_head', 'twentytwenty_no_js_class' );
/**
* Add conditional body classes.
* Adds conditional body classes.
*
* @param array $classes Classes added to the body tag.
*
* @return array $classes Classes added to the body tag.
* @return array Classes added to the body tag.
*/
function twentytwenty_body_classes( $classes ) {
@ -716,12 +720,12 @@ add_filter( 'body_class', 'twentytwenty_body_classes' );
/**
* Archives
*/
/**
* Filters the archive title and styles the word before the first colon.
*
* @param string $title Current archive title.
*
* @return string $title Current archive title.
* @return string Current archive title.
*/
function twentytwenty_get_the_archive_title( $title ) {
@ -748,10 +752,11 @@ add_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );
/**
* Miscellaneous
*/
/**
* Toggle animation duration in milliseconds.
* Toggles animation duration in milliseconds.
*
* @return integer Duration in milliseconds
* @return int Duration in milliseconds
*/
function twentytwenty_toggle_duration() {
/**
@ -759,7 +764,7 @@ function twentytwenty_toggle_duration() {
*
* @since Twenty Twenty 1.0
*
* @param integer $duration Duration in milliseconds.
* @param int $duration Duration in milliseconds.
*/
$duration = apply_filters( 'twentytwenty_toggle_duration', 250 );
@ -767,7 +772,7 @@ function twentytwenty_toggle_duration() {
}
/**
* Get unique ID.
* Gets unique ID.
*
* This is a PHP implementation of Underscore's uniqueId method. A static variable
* contains an integer that is incremented with each call. This number is returned

View File

@ -589,8 +589,9 @@ function block_version( $content ) {
* @since 5.3.0
*
* @param string $block_name Block type name including namespace.
* @param array $style_properties Array containing the properties of the style name, label, style (name of the stylesheet to be enqueued), inline_style (string containing the CSS to be added).
*
* @param array $style_properties Array containing the properties of the style name,
* label, style (name of the stylesheet to be enqueued),
* inline_style (string containing the CSS to be added).
* @return boolean True if the block style was registered with success and false otherwise.
*/
function register_block_style( $block_name, $style_properties ) {
@ -604,7 +605,6 @@ function register_block_style( $block_name, $style_properties ) {
*
* @param string $block_name Block type name including namespace.
* @param array $block_style_name Block style name.
*
* @return boolean True if the block style was unregistered with success and false otherwise.
*/
function unregister_block_style( $block_name, $block_style_name ) {

View File

@ -511,7 +511,6 @@ class WP_Http {
*
* @param array $args Request arguments.
* @param string $url URL to Request.
*
* @return string|false Class name for the first transport that claims to support the request.
* False if no transport claims to support the request.
*/

View File

@ -177,14 +177,12 @@ class WP_Date_Query {
* Recursive-friendly query sanitizer.
*
* Ensures that each query-level clause has a 'relation' key, and that
* each first-order clause contains all the necessary keys from
* `$defaults`.
* each first-order clause contains all the necessary keys from `$defaults`.
*
* @since 4.1.0
*
* @param array $queries
* @param array $parent_query
*
* @return array Sanitized queries.
*/
public function sanitize_query( $queries, $parent_query = null ) {

View File

@ -209,7 +209,6 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
*
* @param int $width
* @param int $height
*
* @return true|WP_Error
*/
protected function update_size( $width = null, $height = null ) {

View File

@ -509,7 +509,6 @@ class WP_Network_Query {
*
* @param string $string Search string.
* @param string[] $columns Array of columns to search.
*
* @return string Search SQL.
*/
protected function get_search_sql( $string, $columns ) {

View File

@ -80,7 +80,6 @@ class WP_Paused_Extensions_Storage {
* @since 5.2.0
*
* @param string $extension Plugin or theme directory name.
*
* @return bool True on success, false on failure.
*/
public function delete( $extension ) {
@ -121,7 +120,6 @@ class WP_Paused_Extensions_Storage {
* @since 5.2.0
*
* @param string $extension Plugin or theme directory name.
*
* @return array|null Error that is stored, or null if the extension is not paused.
*/
public function get( $extension ) {

View File

@ -101,7 +101,6 @@ final class WP_Recovery_Mode_Email_Service {
* @param int $rate_limit Number of seconds before another email can be sent.
* @param array $error Error details from {@see error_get_last()}
* @param array $extension Extension that caused the error.
*
* @return bool Whether the email was sent successfully.
*/
private function send_recovery_mode_email( $rate_limit, $error, $extension ) {

View File

@ -340,7 +340,6 @@ class WP_Recovery_Mode {
* @global array $wp_theme_directories
*
* @param array $error Error that was triggered.
*
* @return array|false {
* @type string $slug The extension slug. This is the plugin or theme's directory.
* @type string $type The extension type. Either 'plugin' or 'theme'.

View File

@ -345,7 +345,6 @@ if ( ! function_exists( 'is_countable' ) ) {
* @since 4.9.6
*
* @param mixed $var The value to check.
*
* @return bool True if `$var` is countable, false otherwise.
*/
function is_countable( $var ) {
@ -367,7 +366,6 @@ if ( ! function_exists( 'is_iterable' ) ) {
* @since 4.9.6
*
* @param mixed $var The value to check.
*
* @return bool True if `$var` is iterable, false otherwise.
*/
function is_iterable( $var ) {

View File

@ -57,7 +57,6 @@ function wp_embed_unregister_handler( $id, $priority = 10 ) {
* @global int $content_width
*
* @param string $url Optional. The URL that should be embedded. Default empty.
*
* @return array {
* Indexed array of the embed width and height in pixels.
*

View File

@ -42,7 +42,6 @@ function wp_paused_themes() {
* @since 5.2.0
*
* @param array $error Error details {@see error_get_last()}
*
* @return string Formatted error description.
*/
function wp_get_extension_error_description( $error ) {

View File

@ -100,7 +100,6 @@ function permalink_anchor( $mode = 'id' ) {
*
* @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`.
* @param bool $leavename Optional. Whether to keep post name or page name. Default false.
*
* @return string|false The permalink URL or false if post does not exist.
*/
function get_the_permalink( $post = 0, $leavename = false ) {
@ -4437,7 +4436,6 @@ function the_privacy_policy_link( $before = '', $after = '' ) {
*
* @param string $before Optional. Display before privacy policy link. Default empty.
* @param string $after Optional. Display after privacy policy link. Default empty.
*
* @return string Markup for the link and surrounding elements. Empty string if it
* doesn't exist.
*/

View File

@ -715,10 +715,12 @@ function rest_send_allow_header( $response, $server, $request ) {
/**
* Recursively computes the intersection of arrays using keys for comparison.
*
* @since 5.3.0
*
* @param array $array1 The array with master keys to check.
* @param array $array2 An array to compare keys against.
*
* @return array An associative array containing all the entries of array1 which have keys that are present in all arguments.
* @return array An associative array containing all the entries of array1 which have keys
* that are present in all arguments.
*/
function _rest_array_intersect_key_recursive( $array1, $array2 ) {
$array1 = array_intersect_key( $array1, $array2 );
@ -738,7 +740,6 @@ function _rest_array_intersect_key_recursive( $array1, $array2 ) {
* @param WP_REST_Response $response Current response being served.
* @param WP_REST_Server $server ResponseHandler instance (usually WP_REST_Server).
* @param WP_REST_Request $request The request that was used to make current response.
*
* @return WP_REST_Response Response to be served, trimmed down to contain a subset of fields.
*/
function rest_filter_response_fields( $response, $server, $request ) {

View File

@ -402,7 +402,6 @@ class WP_REST_Request implements ArrayAccess {
* @since 5.3.0
*
* @param string $key Parameter name.
*
* @return bool True if a param exists for the given key.
*/
public function has_param( $key ) {

View File

@ -399,7 +399,6 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller {
*
* @param WP_Post $post Post revision object.
* @param WP_REST_Request $request Request object.
*
* @return WP_REST_Response Response object.
*/
public function prepare_item_for_response( $post, $request ) {

View File

@ -161,7 +161,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
* @param int|bool $value The value passed to the reassign parameter.
* @param WP_REST_Request $request Full details about the request.
* @param string $param The parameter that is being sanitized.
*
* @return int|bool|WP_Error
*/
public function check_reassign( $value, $request, $param ) {

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-48101';
$wp_version = '5.5-alpha-48102';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.