WordPress.org

Make WordPress Core

Ticket #16073: 16073.2.patch

File 16073.2.patch, 491 bytes (added by garyc40, 3 years ago)

use array_intersect() instead of foreach

  • wp-includes/theme.php

    diff --git wp-includes/theme.php wp-includes/theme.php
    index 9d2f905..b091df1 100644
    function add_theme_support( $feature ) { 
    17541754                $_wp_theme_features[$feature] = true; 
    17551755        else 
    17561756                $_wp_theme_features[$feature] = array_slice( func_get_args(), 1 ); 
     1757                 
     1758        if ( $feature == 'post-formats' ) { 
     1759                $_wp_theme_features[$feature][0] = array_intersect( $_wp_theme_features[$feature][0], get_post_format_slugs() ); 
     1760        } 
    17571761} 
    17581762 
    17591763/**