WordPress.org

Make WordPress Core

Ticket #14077: 14077.2.diff

File 14077.2.diff, 1.1 KB (added by paulwilde, 6 years ago)
  • wp-includes/post.php

    diff --git a/wp-includes/post.php b/wp-includes/post.php
    index 3716cba..1aa6afa 100644
    a b function add_post_type_support( $post_type, $feature ) { 
    17491749 *
    17501750 * @since 3.0.0
    17511751 *
    1752  * @param string $post_type The post type for which to remove the feature.
    1753  * @param string $feature   The feature being removed.
     1752 * @param string       $post_type The post type for which to remove the feature.
     1753 * @param string|array $feature   The feature being removed, accepts an array of
     1754 *                                feature strings or a single string.           
    17541755 */
    17551756function remove_post_type_support( $post_type, $feature ) {
    17561757        global $_wp_post_type_features;
    1757 
    1758         if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
    1759                 unset( $_wp_post_type_features[$post_type][$feature] );
     1758       
     1759        $features = (array) $feature;
     1760        foreach ( $features as $feature ) {
     1761                if ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) ) {
     1762                        unset( $_wp_post_type_features[ $post_type ][ $feature ] );
     1763                }
     1764        }
    17601765}
    17611766
    17621767/**