Make WordPress Core

Changeset 27473


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.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r27429 r27473  
    9797 * @since 0.71
    9898 *
    99  * @param int|object $post Optional. Post ID or object.
     99 * @param int|WP_Post $post Optional. Post ID or post object.
    100100 * @return string
    101101 */
     
    130130 * @since 1.5.0
    131131 *
    132  * @param int $id Optional. Post ID.
     132 * @param int|WP_Post $id Optional. Post ID or post object.
    133133 */
    134134function the_guid( $id = 0 ) {
     
    145145 * @since 1.5.0
    146146 *
    147  * @param int $id Optional. Post ID.
     147 * @param int|WP_Post $id Optional. Post ID or post object.
    148148 * @return string
    149149 */
     
    281281 * @since 2.3.0
    282282 *
    283  * @param int $id Optional. Post ID.
     283 * @param int|WP_Post $id Optional. Post ID or post object.
    284284 * @return bool
    285285 */
     
    295295 *
    296296 * @param string|array $class One or more classes to add to the class list.
    297  * @param int $post_id An optional post ID.
     297 * @param int|WP_Post $post_id Optional. Post ID or post object.
    298298 */
    299299function post_class( $class = '', $post_id = null ) {
     
    317317 *
    318318 * @param string|array $class One or more classes to add to the class list.
    319  * @param int $post_id An optional post ID.
     319 * @param int|WP_Post $post_id Optional. Post ID or post object.
    320320 * @return array Array of classes.
    321321 */
     
    11741174 * @since 2.0.0
    11751175 *
    1176  * @param int $id Optional. Post ID.
     1176 * @param int|WP_Post $id Optional. Post ID or post object.
    11771177 * @param bool $fullsize Optional, default is false. Whether to use full size.
    11781178 * @param bool $deprecated Deprecated. Not used.
     
    11951195 * @uses apply_filters() Calls 'wp_get_attachment_link' filter on HTML content with same parameters as function.
    11961196 *
    1197  * @param int $id Optional. Post ID.
     1197 * @param int|WP_Post $id Optional. Post ID or post object.
    11981198 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string.
    11991199 * @param bool $permalink Optional, default is false. Whether to add permalink to image.
     
    12601260 * @since 1.0.0
    12611261 * @uses apply_filters() Calls 'the_password_form' filter on output.
    1262  * @param int|WP_Post $post Optional. A post id or post object. Defaults to the current post when in The Loop, undefined otherwise.
     1262 * @param int|WP_Post $post Optional. A post ID or post object.
    12631263 * @return string HTML content for password form for password protected post.
    12641264 */
     
    14211421 * @uses get_the_author_meta()
    14221422 *
    1423  * @param int|object $post_id Post ID or post object.
     1423 * @param int|WP_Post $post_id Optional. Post ID or post object.
    14241424 * @param string $type 'all' (default), 'revision' or 'autosave'
    14251425 * @return null
  • 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 */
  • trunk/src/wp-includes/taxonomy.php

    r27458 r27473  
    31943194 * @since 2.5.0
    31953195 *
    3196  * @param int $post Optional. Post ID or will use Global Post ID (in loop).
     3196 * @param int|WP_Post $post Optional. Post ID or post object.
    31973197 * @param array $args Override the defaults.
    31983198 * @return array
     
    32413241 * @uses get_object_taxonomies()
    32423242 *
    3243  * @param int $post Optional. Post ID
     3243 * @param int|WP_Post $post Optional. Post ID or post object.
    32443244 * @return array
    32453245 */
Note: See TracChangeset for help on using the changeset viewer.