mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Code Modernisation: Introduce the spread operator in wp-admin/includes/dashboard.php
.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable. Props jrf. See #47678. Built from https://develop.svn.wordpress.org/trunk@46130 git-svn-id: http://core.svn.wordpress.org/trunk@45942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
efe18c3604
commit
7093392099
@ -1062,7 +1062,7 @@ function wp_dashboard_rss_output( $widget_id ) {
|
||||
* @param mixed ...$args Optional additional parameters to pass to the callback function when it's called.
|
||||
* @return bool False on failure. True on success.
|
||||
*/
|
||||
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
|
||||
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array(), ...$args ) {
|
||||
$loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><div class="hide-if-js notice notice-error inline"><p>' . __( 'This widget requires JavaScript.' ) . '</p></div>';
|
||||
$doing_ajax = wp_doing_ajax();
|
||||
|
||||
@ -1089,7 +1089,6 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
|
||||
}
|
||||
|
||||
if ( $callback && is_callable( $callback ) ) {
|
||||
$args = array_slice( func_get_args(), 3 );
|
||||
array_unshift( $args, $widget_id, $check_urls );
|
||||
ob_start();
|
||||
call_user_func_array( $callback, $args );
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.3-alpha-46129';
|
||||
$wp_version = '5.3-alpha-46130';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user