Make sure `$post` is properly documented as optional where applicable.

See #28388.


git-svn-id: https://develop.svn.wordpress.org/trunk@28653 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes (DrewAPicture) 2014-06-03 03:52:46 +00:00
parent 6a9c55cd9f
commit 9bb9177199
4 changed files with 19 additions and 17 deletions

View File

@ -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 );

View File

@ -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 );

View File

@ -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 ) {

View File

@ -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);