From 0257fba2ddc9832c06fb07c9d31bd172c97e1fbb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 26 Sep 2019 00:56:36 +0000 Subject: [PATCH] Docs: Improve documentation for `_post_states()` and `get_post_states()`. Add documentation for `_media_states()`. See #47110. git-svn-id: https://develop.svn.wordpress.org/trunk@46315 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/template.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 8777aba514..459793bcbd 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -2062,15 +2062,16 @@ function iframe_footer() { } /** - * Function to echo or return the Post States as HTML. + * Function to echo or return the post states as HTML. * * @since 2.7.0 - * @since 5.3.0 Adopted use of get_post_states + * @since 5.3.0 Added the `$echo` parameter and a return value. + * + * @see get_post_states() * * @param WP_Post $post The post to retrieve states for. - * @param boolean $echo Optional. Whether to echo or return the Post States as an HTML string. Default true for echo. - * - * @return string|void Post States string when echo is false. + * @param bool $echo Optional. Whether to echo the post states as an HTML string. Default true. + * @return string Post states string. */ function _post_states( $post, $echo = true ) { $post_states = get_post_states( $post ); @@ -2096,14 +2097,12 @@ function _post_states( $post, $echo = true ) { } /** - * Function to retrieve an array of Post States from a Post. + * Function to retrieve an array of post states from a post. * * @since 5.3.0 * * @param WP_Post $post The post to retrieve states for. - * - * @return array $post_states The array of translated post states. - * + * @return array The array of translated post states. */ function get_post_states( $post ) { $post_states = array(); @@ -2170,7 +2169,12 @@ function get_post_states( $post ) { } /** - * @param WP_Post $post + * Function to echo the attachment media states as HTML. + * + * @since 3.2.0 + * + * @param WP_Post $post The attachment post to retrieve states for. + * @return string Media states string. */ function _media_states( $post ) { $media_states = array();