WordPress.org

Make WordPress Core

Ticket #47678: 47678-add_theme_support.patch

File 47678-add_theme_support.patch, 1002 bytes (added by jrf, 8 months ago)

Simplify & modernize add_theme_support()

  • src/wp-includes/theme.php

    From 0b5fc183d0b8ad1ac035ac29150eb1972c0aca3d Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 12:06:41 +0200
    Subject: [PATCH] Simplify & modernize add_theme_support()
    
    ---
     src/wp-includes/theme.php | 6 ++----
     1 file changed, 2 insertions(+), 4 deletions(-)
    
    diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
    index ccfa13974a..618861387a 100644
    a b function get_theme_starter_content() { 
    23552355 * @param mixed  ...$args Optional extra arguments to pass along with certain features.
    23562356 * @return void|bool False on failure, void otherwise.
    23572357 */
    2358 function add_theme_support( $feature ) {
     2358function add_theme_support( $feature, ...$args ) {
    23592359        global $_wp_theme_features;
    23602360
    2361         if ( func_num_args() == 1 ) {
     2361        if ( func_num_args() === 1 ) {
    23622362                $args = true;
    2363         } else {
    2364                 $args = array_slice( func_get_args(), 1 );
    23652363        }
    23662364
    23672365        switch ( $feature ) {