Make WordPress Core


Ignore:
Timestamp:
03/08/2014 07:31:51 PM (11 years ago)
Author:
DrewAPicture
Message:

Better standardize parameter value types in PHPDocs where both a post ID or WP_Post would be acceptable.

Covers cases where previously only int or int|object types were notated.

Props coffee2code for the original patch.
See #20495.

File:
1 edited

Legend:

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

    r27470 r27473  
    381381 * @link http://codex.wordpress.org/Function_Reference/get_post
    382382 *
    383  * @param int|object $post Post ID or post object. Optional, default is the current post from the loop.
     383 * @param int|WP_Post $post Optional. Post ID or post object.
    384384 * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N.
    385385 * @param string $filter Optional, default is raw.
     
    711711 * @since 2.5.0
    712712 *
    713  * @param int|object $post Post ID or post object
     713 * @param int|WP_Post $post Post ID or post object.
    714714 * @return array Ancestor IDs or empty array if none are found.
    715715 */
     
    748748 *
    749749 * @param string $field Post field name.
    750  * @param int|object $post Post ID or post object.
     750 * @param int|WP_Post $post Post ID or post object.
    751751 * @param string $context Optional. How to filter the field. Default is 'display'.
    752752 * @return string The value of the post field on success, empty string on failure.
     
    772772 * @since 2.0.0
    773773 *
    774  * @param int $ID Optional. Post ID. Default is the current post from the loop.
     774 * @param int|WP_Post $ID Optional. Post ID or post object.
    775775 * @return string|bool The mime type on success, false on failure.
    776776 */
     
    792792 * @since 2.0.0
    793793 *
    794  * @param int $ID Optional. Post ID. Default is the current post from the loop.
     794 * @param int|WP_Post $ID Optional. Post ID or post object.
    795795 * @return string|bool Post status on success, false on failure.
    796796 */
     
    10261026 * @since 2.1.0
    10271027 *
    1028  * @param int|object $post Optional. Post ID or post object. Default is the current post from the loop.
     1028 * @param int|WP_Post $post Optional. Post ID or post object.
    10291029 * @return string|bool Post type on success, false on failure.
    10301030 */
     
    24812481 * @uses do_action() on 'trashed_post_comments' after trashing
    24822482 *
    2483  * @param int|object $post Post ID or object.
     2483 * @param int|WP_Post $post Optional. Post ID or post object.
    24842484 * @return mixed False on failure
    24852485 */
     
    25222522 * @uses do_action() on 'untrashed_post_comments' after trashing
    25232523 *
    2524  * @param int|object $post Post ID or object.
     2524 * @param int|WP_Post $post Optional. Post ID or post object.
    25252525 * @return mixed False on failure
    25262526 */
     
    30403040 * @uses do_action() Calls 'edit_post', 'save_post_{$post_type}', 'save_post' and 'wp_insert_post' on post_id and post data.
    30413041 *
    3042  * @param int|object $post Post ID or object.
     3042 * @param int|WP_Post $post Post ID or post object.
    30433043 */
    30443044function wp_publish_post( $post ) {
     
    30733073 * @since 2.5.0
    30743074 *
    3075  * @param int $post_id Post ID.
     3075 * @param int|WP_Post $post_id Post ID or post object.
    30763076 * @return null Nothing is returned. Which can mean that no action is required or post was published.
    30773077 */
     
    47614761 * @uses do_action() Calls 'clean_post_cache' on $id before adding children (if any).
    47624762 *
    4763  * @param int|object $post Post ID or object to remove from the cache
     4763 * @param int|WP_Post $post Post ID or post object to remove from the cache.
    47644764 */
    47654765function clean_post_cache( $post ) {
     
    50405040 * @since 3.1.0
    50415041 *
    5042  * @param int|object $post Post ID or object where thumbnail should be attached.
     5042 * @param int|WP_Post $post Post ID or post object where thumbnail should be attached.
    50435043 * @param int $thumbnail_id Thumbnail to attach.
    50445044 * @return bool True on success, false on failure.
     
    50615061 * @since 3.3.0
    50625062 *
    5063  * @param int|object $post Post ID or object where thumbnail should be removed from.
     5063 * @param int|WP_Post $post Post ID or post object where thumbnail should be removed from.
    50645064 * @return bool True on success, false on failure.
    50655065 */
Note: See TracChangeset for help on using the changeset viewer.