wp_dashboard_primary

WordPress News dashboard widget.

Description

wp_dashboard_primary(); 

Usage

  1. if ( !function_exists( 'wp_dashboard_primary' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/dashboard.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_dashboard_primary(); 
  7.  

Defined (1)

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

/wp-admin/includes/dashboard.php  
  1. function wp_dashboard_primary() { 
  2. $feeds = array( 
  3. 'news' => array( 
  4.  
  5. /** 
  6. * Filters the primary link URL for the 'WordPress News' dashboard widget. 
  7. * @since 2.5.0 
  8. * @param string $link The widget's primary link URL. 
  9. */ 
  10. 'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),  
  11.  
  12. /** 
  13. * Filters the primary feed URL for the 'WordPress News' dashboard widget. 
  14. * @since 2.3.0 
  15. * @param string $url The widget's primary feed URL. 
  16. */ 
  17. 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),  
  18.  
  19. /** 
  20. * Filters the primary link title for the 'WordPress News' dashboard widget. 
  21. * @since 2.3.0 
  22. * @param string $title Title attribute for the widget's primary link. 
  23. */ 
  24. 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),  
  25. 'items' => 1,  
  26. 'show_summary' => 1,  
  27. 'show_author' => 0,  
  28. 'show_date' => 1,  
  29. ),  
  30. 'planet' => array( 
  31.  
  32. /** 
  33. * Filters the secondary link URL for the 'WordPress News' dashboard widget. 
  34. * @since 2.3.0 
  35. * @param string $link The widget's secondary link URL. 
  36. */ 
  37. 'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),  
  38.  
  39. /** 
  40. * Filters the secondary feed URL for the 'WordPress News' dashboard widget. 
  41. * @since 2.3.0 
  42. * @param string $url The widget's secondary feed URL. 
  43. */ 
  44. 'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),  
  45.  
  46. /** 
  47. * Filters the secondary link title for the 'WordPress News' dashboard widget. 
  48. * @since 2.3.0 
  49. * @param string $title Title attribute for the widget's secondary link. 
  50. */ 
  51. 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),  
  52.  
  53. /** 
  54. * Filters the number of secondary link items for the 'WordPress News' dashboard widget. 
  55. * @since 4.4.0 
  56. * @param string $items How many items to show in the secondary feed. 
  57. */ 
  58. 'show_summary' => 0,  
  59. 'show_author' => 0,  
  60. 'show_date' => 0,  
  61. ); 
  62.  
  63. if ( ( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS ) && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) { 
  64. $feeds['plugins'] = array( 
  65. 'link' => '',  
  66. 'url' => array( 
  67. 'popular' => 'http://wordpress.org/plugins/rss/browse/popular/',  
  68. ),  
  69. 'title' => '',  
  70. 'items' => 1,  
  71. 'show_summary' => 0,  
  72. 'show_author' => 0,  
  73. 'show_date' => 0,  
  74. ); 
  75.  
  76. wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );