WordPress.org

Make WordPress Core

Ticket #47678: 47678-wp_dashboard_cached_rss_widget.patch

File 47678-wp_dashboard_cached_rss_widget.patch, 1.5 KB (added by jrf, 11 months ago)

Simplify & modernize wp_dashboard_cached_rss_widget()

  • src/wp-admin/includes/dashboard.php

    From e0624974951c873b24a96abc2e272801a91bc931 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 18 Jul 2019 03:00:14 +0200
    Subject: [PATCH] Simplify & modernize wp_dashboard_cached_rss_widget()
    
    ---
     src/wp-admin/includes/dashboard.php | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php
    index f8e648bde1..3db33822e1 100644
    a b function wp_dashboard_rss_output( $widget_id ) { 
    998998 * @param mixed    ...$args    Optional additional parameters to pass to the callback function when it's called.
    999999 * @return bool False on failure. True on success.
    10001000 */
    1001 function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
     1001function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array(), ...$args ) {
    10021002        $loading    = '<p class="widget-loading hide-if-no-js">' . __( 'Loading&hellip;' ) . '</p><div class="hide-if-js notice notice-error inline"><p>' . __( 'This widget requires JavaScript.' ) . '</p></div>';
    10031003        $doing_ajax = wp_doing_ajax();
    10041004
    function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar 
    10251025        }
    10261026
    10271027        if ( $callback && is_callable( $callback ) ) {
    1028                 $args = array_slice( func_get_args(), 3 );
    10291028                array_unshift( $args, $widget_id, $check_urls );
    10301029                ob_start();
    10311030                call_user_func_array( $callback, $args );