WordPress.org

Make WordPress Core

Ticket #17584: 17584.diff

File 17584.diff, 734 bytes (added by mitchoyoshitaka, 4 years ago)

Patch v2, passing all args using array_slice

  • wp-includes/post.php

     
    12771277function post_type_supports( $post_type, $feature ) { 
    12781278        global $_wp_post_type_features; 
    12791279 
     1280        $support = true; 
    12801281        if ( !isset( $_wp_post_type_features[$post_type][$feature] ) ) 
    1281                 return false; 
     1282                $support = false; 
    12821283 
    1283         // If no args passed then no extra checks need be performed 
    1284         if ( func_num_args() <= 2 ) 
    1285                 return true; 
    1286  
    1287         // @todo Allow pluggable arg checking 
    1288         //$args = array_slice( func_get_args(), 2 ); 
    1289  
    1290         return true; 
     1284        return apply_filters( 'post_type_supports', $support, array_slice( func_get_args(), 2 ) ); 
    12911285} 
    12921286 
    12931287/**