From 7c370fa9d03d261337b3e9a95e20f9f4691c2cf4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Sep 2019 11:34:57 +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. Built from https://develop.svn.wordpress.org/trunk@46136 git-svn-id: http://core.svn.wordpress.org/trunk@45948 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 21 +++++++++------------ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 7825d5cc09..a9e16af633 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/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( diff --git a/wp-includes/version.php b/wp-includes/version.php index c9156478de..bdf7c8ff94 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46135'; +$wp_version = '5.3-alpha-46136'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.