mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Better document parameters and the return for the newly-introduced wp_attachment_is()
.
Also adds a changelog entry to the DocBlock for `wp_attachment_is_image()` to denote that it serves as a wrapper for `wp_attachment_is()` as of 4.2.0. See [31645]. See #25275. Built from https://develop.svn.wordpress.org/trunk@31659 git-svn-id: http://core.svn.wordpress.org/trunk@31640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
80d13281ed
commit
b84904051b
@ -5071,11 +5071,11 @@ function wp_get_attachment_thumb_url( $post_id = 0 ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verfify the attachment as being of a specific type
|
* Verifies an attachment is of a given type.
|
||||||
*
|
*
|
||||||
* @param string $type Type: image, audio, or video.
|
* @param string $type Attachment type. Accepts 'image', 'audio', or 'video'.
|
||||||
* @param int|WP_Post $post_id Optional. Default 0.
|
* @param int|WP_Post $post_id Optional. Attachment ID. Default 0.
|
||||||
* @return bool
|
* @return bool True if one of the accepted types, false otherwise.
|
||||||
*/
|
*/
|
||||||
function wp_attachment_is( $type, $post_id = 0 ) {
|
function wp_attachment_is( $type, $post_id = 0 ) {
|
||||||
if ( ! $post = get_post( $post_id ) ) {
|
if ( ! $post = get_post( $post_id ) ) {
|
||||||
@ -5118,9 +5118,10 @@ function wp_attachment_is( $type, $post_id = 0 ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the attachment is an image.
|
* Checks if the attachment is an image.
|
||||||
*
|
*
|
||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
|
* @since 4.2.0 Modified into wrapper for wp_attachment_is()
|
||||||
*
|
*
|
||||||
* @param int|WP_Post $post Optional. Attachment ID. Default 0.
|
* @param int|WP_Post $post Optional. Attachment ID. Default 0.
|
||||||
* @return bool Whether the attachment is an image.
|
* @return bool Whether the attachment is an image.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31658';
|
$wp_version = '4.2-alpha-31659';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user