From 8eebd125f0465e2f69d41eb38f6487eb7d8c588f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 30 Aug 2018 09:00:42 +0000 Subject: [PATCH] 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 --- src/wp-includes/post-formats.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/post-formats.php b/src/wp-includes/post-formats.php index eb6fef0380..1fafd4430c 100644 --- a/src/wp-includes/post-formats.php +++ b/src/wp-includes/post-formats.php @@ -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.' ) ); }