WordPress.org

Make WordPress Core

Ticket #47678: 47678-current_theme_supports.patch

File 47678-current_theme_supports.patch, 1.2 KB (added by jrf, 12 months ago)

Simplify & modernize current_theme_supports()

  • src/wp-includes/theme.php

    From 1f245d76baf7b057fb174f1c85f530dd55710581 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 11 Jul 2019 12:09:47 +0200
    Subject: [PATCH] Simplify & modernize current_theme_supports()
    
    ---
     src/wp-includes/theme.php | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
    index 2bc005f936..ba7a6f93ba 100644
    a b function _remove_theme_support( $feature ) { 
    27852785 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
    27862786 * @return bool True if the current theme supports the feature, false otherwise.
    27872787 */
    2788 function current_theme_supports( $feature ) {
     2788function current_theme_supports( $feature, ...$args ) {
    27892789        global $_wp_theme_features;
    27902790
    27912791        if ( 'custom-header-uploads' == $feature ) {
    function current_theme_supports( $feature ) { 
    28012801                return true;
    28022802        }
    28032803
    2804         $args = array_slice( func_get_args(), 1 );
    2805 
    28062804        switch ( $feature ) {
    28072805                case 'post-thumbnails':
    28082806                        // post-thumbnails can be registered for only certain content/post types by passing