wp_dashboard_primary_output

Display the WordPress news feeds.

Description

wp_dashboard_primary_output( (string) $widget_id, (array) $feeds ); 

Parameters (2)

0. $widget_id (string)
The widget id.
1. $feeds (array)
Array of RSS feeds.

Usage

  1. if ( !function_exists( 'wp_dashboard_primary_output' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/dashboard.php'; 
  3.  
  4. // The widget id. 
  5. $widget_id = ''; 
  6.  
  7. // Array of RSS feeds. 
  8. $feeds = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_dashboard_primary_output($widget_id, $feeds); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/dashboard.php  
  1. function wp_dashboard_primary_output( $widget_id, $feeds ) { 
  2. foreach ( $feeds as $type => $args ) { 
  3. $args['type'] = $type; 
  4. echo '<div class="rss-widget">'; 
  5. if ( $type === 'plugins' ) { 
  6. wp_dashboard_plugins_output( $args['url'], $args ); 
  7. } else { 
  8. wp_widget_rss_output( $args['url'], $args ); 
  9. echo "</div>";