Post Thumbnails: Fix logic bug and tests from [37308] where post-thumbnails support wasn’t added if there were no previous post_types with support already.

See #22080
Built from https://develop.svn.wordpress.org/trunk@37313


git-svn-id: http://core.svn.wordpress.org/trunk@37279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Rachel Baker 2016-04-26 20:29:27 +00:00
parent e510918b4e
commit ddbde15454
2 changed files with 3 additions and 5 deletions

View File

@ -1545,10 +1545,8 @@ function add_theme_support( $feature ) {
* Merge post types with any that already declared their support
* for post thumbnails.
*/
if ( is_array( $args[0] ) && is_array( $_wp_theme_features['post-thumbnails'][0] ) ) {
$post_types = array_unique( array_merge( $args[0], $_wp_theme_features['post-thumbnails'][0] ) );
$args = array( $post_types );
if ( is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) {
$args[0] = array_unique( array_merge( $_wp_theme_features['post-thumbnails'][0], $args[0] ) );
}
break;

View File

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