Title: wp_dashboard_plugins_output
Published: April 25, 2014
Last modified: April 28, 2025

---

# wp_dashboard_plugins_output( string $rss, array $args = array() )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#wp--skip-link--target)

This function has been deprecated since 4.8.0.

Display plugins text for the WordPress news widget.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#parameters)󠁿

 `$rss`stringrequired

The RSS feed URL.

`$args`arrayoptional

Array of arguments for this RSS feed.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#source)󠁿

    ```php
    function wp_dashboard_plugins_output( $rss, $args = array() ) {
    	_deprecated_function( __FUNCTION__, '4.8.0' );

    	// Plugin feeds plus link to install them.
    	$popular = fetch_feed( $args['url']['popular'] );

    	if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
    		$plugin_slugs = array_keys( get_plugins() );
    		set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
    	}

    	echo '<ul>';

    	foreach ( array( $popular ) as $feed ) {
    		if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
    			continue;

    		$items = $feed->get_items(0, 5);

    		// Pick a random, non-installed plugin.
    		while ( true ) {
    			// Abort this foreach loop iteration if there's no plugins left of this type.
    			if ( 0 === count($items) )
    				continue 2;

    			$item_key = array_rand($items);
    			$item = $items[$item_key];

    			list($link, $frag) = explode( '#', $item->get_link() );

    			$link = esc_url($link);
    			if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
    				$slug = $matches[1];
    			else {
    				unset( $items[$item_key] );
    				continue;
    			}

    			// Is this random plugin's slug already installed? If so, try again.
    			reset( $plugin_slugs );
    			foreach ( $plugin_slugs as $plugin_slug ) {
    				if ( str_starts_with( $plugin_slug, $slug ) ) {
    					unset( $items[$item_key] );
    					continue 2;
    				}
    			}

    			// If we get to this point, then the random plugin isn't installed and we can stop the while().
    			break;
    		}

    		// Eliminate some common badly formed plugin descriptions.
    		while ( ( null !== $item_key = array_rand($items) ) && str_contains( $items[$item_key]->get_description(), 'Plugin Name:' ) )
    			unset($items[$item_key]);

    		if ( !isset($items[$item_key]) )
    			continue;

    		$raw_title = $item->get_title();

    		$ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
    		echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
    			'&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
    			/* translators: %s: Plugin name. */
    			esc_attr( sprintf( _x( 'Install %s', 'plugin' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';

    		$feed->__destruct();
    		unset( $feed );
    	}

    	echo '</ul>';
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/deprecated.php#L1328)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/deprecated.php#L1328-L1399)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#related)󠁿

| Uses | Description | 
| [get_plugins()](https://developer.wordpress.org/reference/functions/get_plugins/)`wp-admin/includes/plugin.php` |

Checks the plugins directory and retrieve all plugin files with plugin data.

  | 
| [fetch_feed()](https://developer.wordpress.org/reference/functions/fetch_feed/)`wp-includes/feed.php` |

Builds SimplePie object based on RSS or Atom feed from URL.

  | 
| [get_transient()](https://developer.wordpress.org/reference/functions/get_transient/)`wp-includes/option.php` |

Retrieves the value of a transient.

  | 
| [set_transient()](https://developer.wordpress.org/reference/functions/set_transient/)`wp-includes/option.php` |

Sets/updates the value of a transient.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  | 
| [wp_nonce_url()](https://developer.wordpress.org/reference/functions/wp_nonce_url/)`wp-includes/functions.php` |

Retrieves URL with nonce added to URL query.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

[Show 8 more](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_dashboard_plugins_output/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.8.0](https://developer.wordpress.org/reference/since/4.8.0/) | Deprecated.  | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_dashboard_plugins_output%2F)
before being able to contribute a note or feedback.