Make WordPress Core

Ticket #14077: remove-post-type-support-array.14077.diff

File remove-post-type-support-array.14077.diff, 963 bytes (added by wycks, 11 years ago)
  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index 55a09ae..935b3d3 100644
    function add_post_type_support( $post_type, $feature ) { 
    15741574 *
    15751575 * @since 3.0.0
    15761576 * @param string $post_type The post type for which to remove the feature
    1577  * @param string $feature The feature being removed
     1577 * @param string|array $features The features being removed. Can be an array of feature strings or a single string.
    15781578 */
    1579 function remove_post_type_support( $post_type, $feature ) {
     1579function remove_post_type_support( $post_type, $features ) {
    15801580        global $_wp_post_type_features;
    15811581
    1582         if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
    1583                 unset( $_wp_post_type_features[$post_type][$feature] );
     1582        foreach ( (array) $features as $feature ) {
     1583                if ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) )
     1584                        unset( $_wp_post_type_features[ $post_type ][ $feature ] );
     1585        }
    15841586}
    15851587
    15861588/**