Post Formats: Don't assign a variable inside `if` statement in `get_post_format()`.

Props Mirucon.
Fixes #44840.

git-svn-id: https://develop.svn.wordpress.org/trunk@43592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-08-30 09:00:42 +00:00
parent 9364b6ed87
commit 8eebd125f0
1 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,9 @@
* @return string|false The format if successful. False otherwise.
*/
function get_post_format( $post = null ) {
if ( ! $post = get_post( $post ) ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
@ -67,7 +69,7 @@ function has_post_format( $format = array(), $post = null ) {
function set_post_format( $post, $format ) {
$post = get_post( $post );
if ( empty( $post ) ) {
if ( ! $post ) {
return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
}