Changeset 45628 for trunk/src/wp-includes/theme.php
- Timestamp:
- 07/12/2019 12:09:31 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r45621 r45628 2354 2354 * @return void|bool False on failure, void otherwise. 2355 2355 */ 2356 function add_theme_support( $feature ) {2356 function add_theme_support( $feature, ...$args ) { 2357 2357 global $_wp_theme_features; 2358 2358 2359 if ( func_num_args() == 1) {2359 if ( ! $args ) { 2360 2360 $args = true; 2361 } else {2362 $args = array_slice( func_get_args(), 1 );2363 2361 } 2364 2362 … … 2666 2664 * @return mixed The array of extra arguments or the value for the registered feature. 2667 2665 */ 2668 function get_theme_support( $feature ) {2666 function get_theme_support( $feature, ...$args ) { 2669 2667 global $_wp_theme_features; 2670 2668 if ( ! isset( $_wp_theme_features[ $feature ] ) ) { … … 2672 2670 } 2673 2671 2674 if ( func_num_args() <= 1) {2672 if ( ! $args ) { 2675 2673 return $_wp_theme_features[ $feature ]; 2676 2674 } 2677 2675 2678 $args = array_slice( func_get_args(), 1 );2679 2676 switch ( $feature ) { 2680 2677 case 'custom-logo': … … 2787 2784 * @return bool True if the current theme supports the feature, false otherwise. 2788 2785 */ 2789 function current_theme_supports( $feature ) {2786 function current_theme_supports( $feature, ...$args ) { 2790 2787 global $_wp_theme_features; 2791 2788 … … 2799 2796 2800 2797 // If no args passed then no extra checks need be performed 2801 if ( func_num_args() <= 1) {2798 if ( ! $args ) { 2802 2799 return true; 2803 2800 } 2804 2805 $args = array_slice( func_get_args(), 1 );2806 2801 2807 2802 switch ( $feature ) {
Note: See TracChangeset
for help on using the changeset viewer.