WordPress.org

Make WordPress Core

Ticket #47678: 47678-get_theme_support.patch

File 47678-get_theme_support.patch, 1.1 KB (added by jrf, 8 months ago)

Simplify & modernize get_theme_support()

  • src/wp-includes/theme.php

    From 5315e939508e558d91be88be87af285ad6150d54 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 12:09:24 +0200
    Subject: [PATCH] Simplify & modernize get_theme_support()
    
    ---
     src/wp-includes/theme.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
    index 618861387a..2bc005f936 100644
    a b function _custom_logo_header_styles() { 
    26652665 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
    26662666 * @return mixed The array of extra arguments or the value for the registered feature.
    26672667 */
    2668 function get_theme_support( $feature ) {
     2668function get_theme_support( $feature, ...$args ) {
    26692669        global $_wp_theme_features;
    26702670        if ( ! isset( $_wp_theme_features[ $feature ] ) ) {
    26712671                return false;
    function get_theme_support( $feature ) { 
    26752675                return $_wp_theme_features[ $feature ];
    26762676        }
    26772677
    2678         $args = array_slice( func_get_args(), 1 );
    26792678        switch ( $feature ) {
    26802679                case 'custom-logo':
    26812680                case 'custom-header':