From f16a56ca419babb01c3e592f216024710c210227 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Sep 2019 11:33:20 +0000 Subject: [PATCH] Code Modernisation: Replace `call_user_func_array()` in `wp-admin/includes/ajax-actions.php` with a dynamic function call. Props jrf. See #47678. git-svn-id: https://develop.svn.wordpress.org/trunk@46136 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 7825d5cc09..a9e16af633 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1806,20 +1806,17 @@ function wp_ajax_menu_get_metabox() { /** This filter is documented in wp-admin/includes/nav-menu.php */ $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object ); - ob_start(); - call_user_func_array( - $callback, - array( - null, - array( - 'id' => 'add-' . $item->name, - 'title' => $item->labels->name, - 'callback' => $callback, - 'args' => $item, - ), - ) + + $box_args = array( + 'id' => 'add-' . $item->name, + 'title' => $item->labels->name, + 'callback' => $callback, + 'args' => $item, ); + ob_start(); + $callback( null, $box_args ); + $markup = ob_get_clean(); echo wp_json_encode(