WordPress.org

Make WordPress Core

Changeset 49544


Ignore:
Timestamp:
11/09/2020 03:13:56 PM (13 months ago)
Author:
johnbillion
Message:

Docs: Docblock corrections relating to WP_Post objects.

See #51373, #50768

Location:
trunk/src
Files:
5 edited

Legend:

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

    r48585 r49544  
    142142 * @global wpdb $wpdb WordPress database abstraction object.
    143143 *
    144  * @param int|array $post_id Either a single Post ID or an array of Post IDs
    145  * @return int|array Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs
     144 * @param int|int[] $post_id Either a single Post ID or an array of Post IDs
     145 * @return int|int[] Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs
    146146 */
    147147function get_pending_comments_num( $post_id ) {
  • trunk/src/wp-admin/includes/post.php

    r49288 r49544  
    13471347 * @since 2.5.0
    13481348 *
    1349  * @param int    $id    Post ID or post object.
    1350  * @param string $title Optional. Title to override the post's current title when generating the post name. Default null.
    1351  * @param string $name  Optional. Name to override the post name. Default null.
     1349 * @param int|WP_Post $id    Post ID or post object.
     1350 * @param string      $title Optional. Title to override the post's current title when generating the post name. Default null.
     1351 * @param string      $name  Optional. Name to override the post name. Default null.
    13521352 * @return array {
    13531353 *     Array containing the sample permalink with placeholder for the post name, and the post name.
     
    15971597 * @since 2.5.0
    15981598 *
    1599  * @param int $post_id ID of the post to check for editing.
     1599 * @param int|WP_Post $post_id ID or object of the post to check for editing.
    16001600 * @return int|false ID of the user with lock. False if the post does not exist, post is not locked,
    16011601 *                   the user with lock does not exist, or the post is locked by current user.
     
    16351635 * @since 2.5.0
    16361636 *
    1637  * @param int $post_id ID of the post being edited.
     1637 * @param int|WP_Post $post_id ID or object of the post being edited.
    16381638 * @return array|false Array of the lock time and user ID. False if the post does not exist, or
    16391639 *                     there is no current user.
  • trunk/src/wp-includes/class-wp-post.php

    r48941 r49544  
    353353     *
    354354     * @param string $filter Filter.
    355      * @return array|bool|object|WP_Post
     355     * @return WP_Post
    356356     */
    357357    public function filter( $filter ) {
  • trunk/src/wp-includes/post-formats.php

    r49183 r49544  
    1212 * @since 3.1.0
    1313 *
    14  * @param int|object|null $post Optional. Post ID or post object. Defaults to the current post in the loop.
     14 * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to the current post in the loop.
    1515 * @return string|false The format if successful. False otherwise.
    1616 */
  • trunk/src/wp-includes/post.php

    r49496 r49544  
    23242324
    23252325/**
    2326  * Sanitize every post field.
     2326 * Sanitizes every post field.
    23272327 *
    23282328 * If the context is 'raw', then the post object or array will get minimal
     
    23332333 * @see sanitize_post_field()
    23342334 *
    2335  * @param object|WP_Post|array $post    The Post Object or Array
     2335 * @param object|WP_Post|array $post    The post object or array
    23362336 * @param string               $context Optional. How to sanitize post fields.
    23372337 *                                      Accepts 'raw', 'edit', 'db', or 'display'.
    23382338 *                                      Default 'display'.
    2339  * @return object|WP_Post|array The now sanitized Post Object or Array (will be the
    2340  *                              same type as $post).
     2339 * @return object|WP_Post|array The now sanitized post object or array (will be the
     2340 *                              same type as `$post`).
    23412341 */
    23422342function sanitize_post( $post, $context = 'display' ) {
Note: See TracChangeset for help on using the changeset viewer.