Skip to content
Permalink
Browse files

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
  • Loading branch information...
SergeyBiryukov committed Sep 26, 2019
1 parent 628a545 commit 0257fba2ddc9832c06fb07c9d31bd172c97e1fbb
Showing with 14 additions and 10 deletions.
  1. +14 −10 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.
*
* @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.
* @see get_post_states()
*
* @return string|void Post States string when echo is false.
* @param WP_Post $post The post to retrieve states for.
* @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();

0 comments on commit 0257fba

Please sign in to comment.
You can’t perform that action at this time.