From 810b1333ff0974d861b5648599ae90640fb8f4bb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 30 Aug 2018 09:01:25 +0000 Subject: [PATCH] Post Formats: Don't assign a variable inside `if` statement in `get_post_format()`. Props Mirucon. Fixes #44840. Built from https://develop.svn.wordpress.org/trunk@43592 git-svn-id: http://core.svn.wordpress.org/trunk@43421 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-formats.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index eb6fef0380..1fafd4430c 100644 --- a/wp-includes/post-formats.php +++ b/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.' ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index d036db7b08..4430afc20e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43591'; +$wp_version = '5.0-alpha-43592'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.