Posts: Rename $ID to $post in get_post_mime_type() and get_post_status() for consistency with other functions.

See #42797.
Built from https://develop.svn.wordpress.org/trunk@42398


git-svn-id: http://core.svn.wordpress.org/trunk@42227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-12-15 01:03:47 +00:00
parent 0d09b75c4b
commit ff89ce1879
2 changed files with 9 additions and 9 deletions

View File

@ -651,7 +651,7 @@ function get_post_ancestors( $post ) {
* @see sanitize_post_field()
*
* @param string $field Post field name.
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to current post.
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
* @param string $context Optional. How to filter the field. Accepts 'raw', 'edit', 'db',
* or 'display'. Default 'display'.
* @return string The value of the post field on success, empty string on failure.
@ -678,11 +678,11 @@ function get_post_field( $field, $post = null, $context = 'display' ) {
*
* @since 2.0.0
*
* @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
* @return string|false The mime type on success, false on failure.
*/
function get_post_mime_type( $ID = '' ) {
$post = get_post( $ID );
function get_post_mime_type( $post = null ) {
$post = get_post( $post );
if ( is_object( $post ) ) {
return $post->post_mime_type;
@ -692,18 +692,18 @@ function get_post_mime_type( $ID = '' ) {
}
/**
* Retrieve the post status based on the Post ID.
* Retrieve the post status based on the post ID.
*
* If the post ID is of an attachment, then the parent post status will be given
* instead.
*
* @since 2.0.0
*
* @param int|WP_Post $ID Optional. Post ID or post object. Default empty.
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post..
* @return string|false Post status on success, false on failure.
*/
function get_post_status( $ID = '' ) {
$post = get_post( $ID );
function get_post_status( $post = null ) {
$post = get_post( $post );
if ( ! is_object( $post ) ) {
return false;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42397';
$wp_version = '5.0-alpha-42398';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.