Changeset 37308
- Timestamp:
- 04/26/2016 05:04:25 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r37092 r37308 1536 1536 1537 1537 switch ( $feature ) { 1538 case 'post-thumbnails': 1539 // All post types are already supported. 1540 if ( true === get_theme_support( 'post-thumbnails' ) ) { 1541 return; 1542 } 1543 1544 /* 1545 * Merge post types with any that already declared their support 1546 * for post thumbnails. 1547 */ 1548 if ( is_array( $args[0] ) && is_array( $_wp_theme_features['post-thumbnails'][0] ) ) { 1549 $post_types = array_unique( array_merge( $args[0], $_wp_theme_features['post-thumbnails'][0] ) ); 1550 1551 $args = array( $post_types ); 1552 } 1553 1554 break; 1555 1538 1556 case 'post-formats' : 1539 1557 if ( is_array( $args[0] ) ) { -
trunk/tests/phpunit/tests/theme/support.php
r30148 r37308 51 51 remove_theme_support( 'post-thumbnails' ); 52 52 $this->assertFalse( current_theme_supports( 'post-thumbnails' ) ); 53 } 54 55 /** 56 * @ticket 22080 57 */ 58 public function test_post_thumbnails_mixed_args() { 59 add_theme_support( 'post-thumbnails', array( 'post', 'page' ) ); 60 add_theme_support( 'post-thumbnails', array( 'page' ) ); 61 $this->assertTrue( current_theme_support( 'post-thumbnails', 'post' ) ); 62 $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) ); 63 $this->assertEquals( 64 array( 0 => array( 'post', 'page' ) ), 65 get_theme_support( 'post-thumbnails' ) 66 ); 67 68 add_theme_support( 'post-thumbnails' ); 69 $this->assertTrue( current_theme_supports( 'post-thumbnails', 'book' ) ); 53 70 } 54 71
Note: See TracChangeset
for help on using the changeset viewer.