Make WordPress Core

Changeset 37308

Timestamp:
04/26/2016 05:04:25 PM (8 years ago)
Author:
rachelbaker
Message:

Post Thumbnails: When using add_theme_support( ‘post-thumbnails’, array( $post_types) ) merge the supported post_types.

Allow the adding of post-thumbnail support for one or more post_types without unsetting any previously added post_types. This matches the behavior of other uses of add_theme_support() and the expectations of a function with a prefix of “add”.
To unset post-thumbnail support use remove_theme_support() instead.

Fixes #22080

Props alexkingorg, jmichaelward, and flixos90.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r37092 r37308  
    15361536
    15371537    switch ( $feature ) {
     1538
     1539
     1540
     1541
     1542
     1543
     1544
     1545
     1546
     1547
     1548
     1549
     1550
     1551
     1552
     1553
     1554
     1555
    15381556        case 'post-formats' :
    15391557            if ( is_array( $args[0] ) ) {
  • trunk/tests/phpunit/tests/theme/support.php

    r30148 r37308  
    5151        remove_theme_support( 'post-thumbnails' );
    5252        $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
    5370    }
    5471
Note: See TracChangeset for help on using the changeset viewer.