Make WordPress Core

Changeset 28654


Ignore:
Timestamp:
06/03/2014 04:43:47 AM (11 years ago)
Author:
DrewAPicture
Message:

Ensure $post_id is documented as optional where applicable.

See #28388.

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

Legend:

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

    r28638 r28654  
    642642 * @since 1.5.0
    643643 *
    644  * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post.
     644 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
    645645 * @return string The link to the comments.
    646646 */
  • trunk/src/wp-includes/comment.php

    r28519 r28654  
    21962196 * @since 1.2.0
    21972197 *
    2198  * @param int $post_id Post ID. Not actually used.
     2198 * @param int $post_id Post ID.
    21992199 * @return int Same as Post ID from parameter
    22002200 */
    2201 function generic_ping($post_id = 0) {
     2201function generic_ping( $post_id = 0 ) {
    22022202    $services = get_option('ping_sites');
    22032203
  • trunk/src/wp-includes/link-template.php

    r28641 r28654  
    291291 * @since 1.0.0
    292292 *
    293  * @param int $post_id Optional. Post ID.
     293 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
    294294 * @param mixed $deprecated Not used.
    295295 * @return string
  • trunk/src/wp-includes/post-template.php

    r28653 r28654  
    17201720 * @uses get_the_author_meta()
    17211721 *
    1722  * @param int|WP_Post $post_id Optional. Post ID or post object.
     1722 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
    17231723 * @param string $type 'all' (default), 'revision' or 'autosave'
    17241724 * @return null
  • trunk/src/wp-includes/post.php

    r28601 r28654  
    18581858 * @link http://codex.wordpress.org/Function_Reference/get_post_custom
    18591859 *
    1860  * @param int $post_id Post ID.
    1861  * @return array
     1860 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
     1861 * @return array Post meta for the given post.
    18621862 */
    18631863function get_post_custom( $post_id = 0 ) {
     
    18771877 * @link http://codex.wordpress.org/Function_Reference/get_post_custom_keys
    18781878 *
    1879  * @param int $post_id post ID
     1879 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
    18801880 * @return array|null Either array of the keys, or null if keys could not be retrieved.
    18811881 */
     
    19001900 *
    19011901 * @param string $key Meta field key.
    1902  * @param int $post_id Post ID
     1902 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
    19031903 * @return array Meta field values.
    19041904 */
     
    19201920 * @since 2.7.0
    19211921 *
    1922  * @param int $post_id Optional. Post ID.
     1922 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
    19231923 * @return bool Whether post is sticky.
    19241924 */
     
    25662566 * @uses wp_delete_post() if trash is disabled
    25672567 *
    2568  * @param int $post_id Post ID.
    2569  * @return mixed False on failure
     2568 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`
     2569 *                     if EMPTY_TRASH_DAYS equals true.
     2570 * @return bool|array Post data array, otherwise false.
    25702571 */
    25712572function wp_trash_post($post_id = 0) {
     
    26132614 * @since 2.9.0
    26142615 *
    2615  * @param int $post_id Post ID.
     2616 * @param int $post_id Optional. Post ID. Default is ID of the global `$post`.
    26162617 * @return mixed False on failure
    26172618 */
    2618 function wp_untrash_post($post_id = 0) {
     2619function wp_untrash_post( $post_id = 0 ) {
    26192620    if ( !$post = get_post($post_id, ARRAY_A) )
    26202621        return $post;
     
    27772778 * @uses wp_get_object_terms() Retrieves the categories. Args details can be found here.
    27782779 *
    2779  * @param int $post_id Optional. The Post ID.
     2780 * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
    27802781 * @param array $args Optional. Overwrite the defaults.
    27812782 * @return array
     
    28022803 * @uses wp_get_object_terms() Gets the tags for returning. Args can be found here
    28032804 *
    2804  * @param int $post_id Optional. The Post ID
     2805 * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
    28052806 * @param array $args Optional. Overwrite the defaults
    28062807 * @return array List of post tags.
     
    28212822 * @uses wp_get_object_terms() Gets the tags for returning. Args can be found here
    28222823 *
    2823  * @param int $post_id Optional. The Post ID
     2824 * @param int    $post_id  Optional. The Post ID. Does not default to the global `$post`.
    28242825 * @param string $taxonomy The taxonomy for which to retrieve terms. Defaults to post_tag.
    2825  * @param array $args Optional. Overwrite the defaults
     2826 * @param array  $args     Optional. {@link wp_get_object_terms()} arguments.
    28262827 * @return array List of post tags.
    28272828 */
     
    35793580 * @since 2.3.0
    35803581 *
    3581  * @param int $post_id Post ID
     3582 * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
    35823583 * @param string $tags The tags to set for the post, separated by commas.
    35833584 * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise
    35843585 */
    3585 function wp_add_post_tags($post_id = 0, $tags = '') {
     3586function wp_add_post_tags( $post_id = 0, $tags = '' ) {
    35863587    return wp_set_post_tags($post_id, $tags, true);
    35873588}
     
    35933594 * @uses wp_set_object_terms() Sets the tags for the post.
    35943595 *
    3595  * @param int $post_id Post ID.
     3596 * @param int $post_id Optional. The Post ID. Does not default to the global `$post`.
    35963597 * @param string $tags The tags to set for the post, separated by commas.
    35973598 * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
     
    36083609 * @uses wp_set_object_terms() Sets the tags for the post.
    36093610 *
    3610  * @param int $post_id Post ID.
    3611  * @param string $tags The tags to set for the post, separated by commas.
     3611 * @param int    $post_id  Optional. The Post ID. Does not default to the global `$post`.
     3612 * @param string $tags     The tags to set for the post, separated by commas.
    36123613 * @param string $taxonomy Taxonomy name. Defaults to 'post_tag'.
    3613  * @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
     3614 * @param bool   $append  If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
    36143615 * @return mixed Array of affected term IDs. WP_Error or false on failure.
    36153616 */
     
    36473648 * @since 2.1.0
    36483649 *
    3649  * @param int $post_ID Post ID.
     3650 * @param int $post_ID Optional. The Post ID. Does not default to the global `$post`.
    36503651 * @param array|int $post_categories Optional. List of categories or ID of category.
    36513652 * @param bool $append If true, don't delete existing categories, just add on. If false, replace the categories with the new categories.
     
    48354836 * @since 2.1.0
    48364837 *
    4837  * @param int $post_id Attachment ID
     4838 * @param int $post_id Attachment ID. Default 0.
    48384839 * @param bool $unfiltered Optional, default is false. If true, filters are not run.
    48394840 * @return string|bool Attachment meta field. False on failure.
     
    48944895 * @since 2.1.0
    48954896 *
    4896  * @param int $post_id Attachment ID.
     4897 * @param int $post_id Optional. Attachment ID. Default 0.
    48974898 * @return string
    48984899 */
     
    49414942 * @since 2.1.0
    49424943 *
    4943  * @param int $post_id Attachment ID.
     4944 * @param int $post_id Optional. Attachment ID. Default 0.
    49444945 * @return mixed False on failure. Thumbnail file path on success.
    49454946 */
     
    49724973 * @since 2.1.0
    49734974 *
    4974  * @param int $post_id Attachment ID
     4975 * @param int $post_id Optional. Attachment ID. Default 0.
    49754976 * @return string|bool False on failure. Thumbnail URL on success.
    49764977 */
     
    50075008 * @since 2.1.0
    50085009 *
    5009  * @param int $post_id Attachment ID
    5010  * @return bool
     5010 * @param int $post_id Optional. Attachment ID. Default 0.
     5011 * @return bool Whether the attachment is an image.
    50115012 */
    50125013function wp_attachment_is_image( $post_id = 0 ) {
  • trunk/src/wp-includes/revision.php

    r28543 r28654  
    410410 * @uses get_children()
    411411 *
    412  * @param int|object $post_id Post ID or post object
     412 * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`.
    413413 * @return array An array of revisions, or an empty array if none.
    414414 */
Note: See TracChangeset for help on using the changeset viewer.