WordPress.org

Make WordPress Core

Ticket #47678: 47678-select-functions-in-wp-includes-deprecated.patch

File 47678-select-functions-in-wp-includes-deprecated.patch, 1.3 KB (added by jrf, 14 months ago)

Simplify & modernize functions in wp-includes/deprecated.php While these functions are deprecated, they can still get a minor performance boost in case they are being called.

  • src/wp-includes/deprecated.php

    From a5f94d090ddcf26c1761eae5df335633eb58bf13 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Fri, 12 Jul 2019 06:09:18 +0200
    Subject: [PATCH] Simplify & modernize functions in wp-includes/deprecated.php
    
    While these functions are deprecated, they can still get a minor performance boost in case they are being called.
    ---
     src/wp-includes/deprecated.php | 10 ++++------
     1 file changed, 4 insertions(+), 6 deletions(-)
    
    diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
    index 677a9b5d44..ce12741fcc 100644
    a b function _nc( $single, $plural, $number, $domain = 'default' ) { 
    17921792 * @deprecated 2.8.0 Use _n()
    17931793 * @see _n()
    17941794 */
    1795 function __ngettext() {
     1795function __ngettext( ...$args ) {
    17961796        _deprecated_function( __FUNCTION__, '2.8.0', '_n()' );
    1797         $args = func_get_args();
    1798         return call_user_func_array('_n', $args);
     1797        return _n( ...$args );
    17991798}
    18001799
    18011800/**
    function __ngettext() { 
    18051804 * @deprecated 2.8.0 Use _n_noop()
    18061805 * @see _n_noop()
    18071806 */
    1808 function __ngettext_noop() {
     1807function __ngettext_noop( ...$args ) {
    18091808        _deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' );
    1810         $args = func_get_args();
    1811         return call_user_func_array('_n_noop', $args);
     1809        return _n_noop( ...$args );
    18121810
    18131811}
    18141812