Make WordPress Core

Changeset 46136


Ignore:
Timestamp:
09/15/2019 11:33:20 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Code Modernisation: Replace call_user_func_array() in wp-admin/includes/ajax-actions.php with a dynamic function call.

Props jrf.
See #47678.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r45936 r46136  
    18071807                /** This filter is documented in wp-admin/includes/nav-menu.php */
    18081808                $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
     1809
     1810                $box_args = array(
     1811                        'id'       => 'add-' . $item->name,
     1812                        'title'    => $item->labels->name,
     1813                        'callback' => $callback,
     1814                        'args'     => $item,
     1815                );
     1816
    18091817                ob_start();
    1810                 call_user_func_array(
    1811                         $callback,
    1812                         array(
    1813                                 null,
    1814                                 array(
    1815                                         'id'       => 'add-' . $item->name,
    1816                                         'title'    => $item->labels->name,
    1817                                         'callback' => $callback,
    1818                                         'args'     => $item,
    1819                                 ),
    1820                         )
    1821                 );
     1818                $callback( null, $box_args );
    18221819
    18231820                $markup = ob_get_clean();
Note: See TracChangeset for help on using the changeset viewer.