WordPress.org

Make WordPress Core

Changeset 46315


Ignore:
Timestamp:
09/26/2019 12:56:36 AM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for _post_states() and get_post_states().

Add documentation for _media_states().

See #47110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r46309 r46315  
    20632063
    20642064/**
    2065  * Function to echo or return the Post States as HTML.
     2065 * Function to echo or return the post states as HTML.
    20662066 *
    20672067 * @since 2.7.0
    2068  * @since 5.3.0 Adopted use of get_post_states
     2068 * @since 5.3.0 Added the `$echo` parameter and a return value.
     2069 *
     2070 * @see get_post_states()
    20692071 *
    20702072 * @param WP_Post $post The post to retrieve states for.
    2071  * @param boolean $echo Optional. Whether to echo or return the Post States as an HTML string. Default true for echo.
    2072  *
    2073  * @return string|void Post States string when echo is false.
     2073 * @param bool    $echo Optional. Whether to echo the post states as an HTML string. Default true.
     2074 * @return string Post states string.
    20742075 */
    20752076function _post_states( $post, $echo = true ) {
     
    20972098
    20982099/**
    2099  * Function to retrieve an array of Post States from a Post.
     2100 * Function to retrieve an array of post states from a post.
    21002101 *
    21012102 * @since 5.3.0
    21022103 *
    21032104 * @param WP_Post $post The post to retrieve states for.
    2104  *
    2105  * @return array $post_states The array of translated post states.
    2106  *
     2105 * @return array The array of translated post states.
    21072106 */
    21082107function get_post_states( $post ) {
     
    21712170
    21722171/**
    2173  * @param WP_Post $post
     2172 * Function to echo the attachment media states as HTML.
     2173 *
     2174 * @since 3.2.0
     2175 *
     2176 * @param WP_Post $post The attachment post to retrieve states for.
     2177 * @return string Media states string.
    21742178 */
    21752179function _media_states( $post ) {
Note: See TracChangeset for help on using the changeset viewer.