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

See #42797.

git-svn-id: https://develop.svn.wordpress.org/trunk@42398 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-12-15 01:02:24 +00:00
parent 4fbe6e0801
commit b20f6ea038
1 changed files with 8 additions and 8 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;