WordPress.org

Make WordPress Core

Ticket #14077: 14077_2.diff

File 14077_2.diff, 975 bytes (added by edwardw, 3 years ago)

Update of Utkarsh's previous patch

  • wp-includes/post.php

     
    12761276 * 
    12771277 * @since 3.0.0 
    12781278 * @param string $post_type The post type for which to remove the feature 
    1279  * @param string $feature The feature being removed 
     1279 * @param string|array $feature The feature being removed, can be an array of feature strings or a single string 
    12801280 */ 
    12811281function remove_post_type_support( $post_type, $feature ) { 
    12821282        global $_wp_post_type_features; 
     
    12841284        if ( !isset($_wp_post_type_features[$post_type]) ) 
    12851285                return; 
    12861286 
    1287         if ( isset($_wp_post_type_features[$post_type][$feature]) ) 
    1288                 unset($_wp_post_type_features[$post_type][$feature]); 
     1287        foreach ( (array) $feature as $the_feature ) { 
     1288                if ( isset( $_wp_post_type_features[$post_type][$the_feature] ) ) { 
     1289                        unset( $_wp_post_type_features[$post_type][$the_feature] ); 
     1290                } 
     1291        } 
    12891292} 
    12901293 
    12911294/**