From b0877f02a4d06e21f557e6a7d966c84383ef7ae0 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 3 Jun 2014 03:53:17 +0000 Subject: [PATCH] Make sure `$post` is properly documented as optional where applicable. See #28388. Built from https://develop.svn.wordpress.org/trunk@28653 git-svn-id: http://core.svn.wordpress.org/trunk@28471 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 5 +++-- wp-includes/media.php | 16 ++++++++-------- wp-includes/post-template.php | 6 +++--- wp-includes/taxonomy.php | 9 +++++---- wp-includes/version.php | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index cfafa9029b..75eeb5f28d 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1463,8 +1463,9 @@ function the_post_password() { * returned. * * @since 2.7.0 - * @param mixed $post Post id or object. If not supplied the global $post is used. - * @return string The post title if set + * + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. + * @return string The post title if set. */ function _draft_or_post_title( $post = 0 ) { $title = get_the_title( $post ); diff --git a/wp-includes/media.php b/wp-includes/media.php index 8a79f8f98e..aa8e86e724 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2974,9 +2974,9 @@ function wp_enqueue_media( $args = array() ) { * * @since 3.6.0 * - * @param string $type (Mime) type of media desired - * @param mixed $post Post ID or object - * @return array Found attachments + * @param string $type Mime type. + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. + * @return array Found attachments. */ function get_attached_media( $type, $post = 0 ) { if ( ! $post = get_post( $post ) ) @@ -3100,7 +3100,7 @@ function get_post_galleries( $post, $html = true ) { * * @since 3.6.0 * - * @param int|WP_Post $post Optional. Post ID or object. + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param bool $html Whether to return HTML or data. * @return string|array Gallery data and srcs parsed from the expanded shortcode. */ @@ -3125,8 +3125,8 @@ function get_post_gallery( $post = 0, $html = true ) { * * @since 3.6.0 * - * @param mixed $post Optional. Post ID or object. - * @return array A list of lists, each containing image srcs parsed + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. + * @return array A list of lists, each containing image srcs parsed. * from an expanded shortcode */ function get_post_galleries_images( $post = 0 ) { @@ -3139,8 +3139,8 @@ function get_post_galleries_images( $post = 0 ) { * * @since 3.6.0 * - * @param mixed $post Optional. Post ID or object. - * @return array A list of a gallery's image srcs in order + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. + * @return array A list of a gallery's image srcs in order. */ function get_post_gallery_images( $post = 0 ) { $gallery = get_post_gallery( $post, false ); diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 50ad3eb4a7..60dd108206 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -104,7 +104,7 @@ function the_title_attribute( $args = '' ) { * * @since 0.71 * - * @param int|WP_Post $post Optional. Post ID or post object. + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return string */ function get_the_title( $post = 0 ) { @@ -1545,8 +1545,8 @@ function prepend_attachment($content) { * Retrieve protected post password form content. * * @since 1.0.0 - * @uses apply_filters() Calls 'the_password_form' filter on output. - * @param int|WP_Post $post Optional. A post ID or post object. + * + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return string HTML content for password form for password protected post. */ function get_the_password_form( $post = 0 ) { diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 010d33f8c8..9cb31993ac 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -3766,9 +3766,9 @@ function the_taxonomies( $args = array() ) { * * @since 2.5.0 * - * @param int|WP_Post $post Optional. Post ID or post object. + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param array $args Override the defaults. - * @return array + * @return array List of taxonomies. */ function get_the_taxonomies( $post = 0, $args = array() ) { $post = get_post( $post ); @@ -3815,12 +3815,13 @@ function get_the_taxonomies( $post = 0, $args = array() ) { * Retrieve all taxonomies of a post with just the names. * * @since 2.5.0 + * * @uses get_object_taxonomies() * - * @param int|WP_Post $post Optional. Post ID or post object. + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return array */ -function get_post_taxonomies($post = 0) { +function get_post_taxonomies( $post = 0 ) { $post = get_post( $post ); return get_object_taxonomies($post); diff --git a/wp-includes/version.php b/wp-includes/version.php index a64b38fe54..e42cc25f3e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.0-alpha-20140602'; +$wp_version = '4.0-alpha-20140603'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.