Index: trunk/src/wp-admin/includes/dashboard.php
===================================================================
--- trunk/src/wp-admin/includes/dashboard.php (revision 27613)
+++ trunk/src/wp-admin/includes/dashboard.php (revision 27669)
@@ -57,14 +57,54 @@
wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress News' ), 'wp_dashboard_primary' );
- // Hook to register new widgets
- // Filter widget order
if ( is_network_admin() ) {
+
+ /**
+ * Fires after core widgets for the Network Admin dashboard have been registered.
+ *
+ * @since 3.1.0
+ */
do_action( 'wp_network_dashboard_setup' );
+
+ /**
+ * Filter the list of widgets to load for the Network Admin dashboard.
+ *
+ * @since 3.1.0
+ *
+ * @param array $dashboard_widgets An array of dashboard widgets.
+ */
$dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
} elseif ( is_user_admin() ) {
+
+ /**
+ * Fires after core widgets for the User Admin dashboard have been registered.
+ *
+ * @since 3.1.0
+ */
do_action( 'wp_user_dashboard_setup' );
+
+ /**
+ * Filter the list of widgets to load for the User Admin dashboard.
+ *
+ * @since 3.1.0
+ *
+ * @param array $dashboard_widgets An array of dashboard widgets.
+ */
$dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
} else {
+
+ /**
+ * Fires after core widgets for the admin dashboard have been registered.
+ *
+ * @since 2.5.0
+ */
do_action( 'wp_dashboard_setup' );
+
+ /**
+ * Filter the list of widgets to load for the admin dashboard.
+ *
+ * @since 2.5.0
+ *
+ * @param array $dashboard_widgets An array of dashboard widgets.
+ */
$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
}
@@ -88,7 +128,8 @@
/** This action is documented in wp-admin/edit-form-advanced.php */
- do_action('do_meta_boxes', $screen->id, 'normal', '');
+ do_action( 'do_meta_boxes', $screen->id, 'normal', '' );
+
/** This action is documented in wp-admin/edit-form-advanced.php */
- do_action('do_meta_boxes', $screen->id, 'side', '');
+ do_action( 'do_meta_boxes', $screen->id, 'side', '' );
}
@@ -166,5 +207,7 @@
}
-/* Dashboard Widgets */
+//
+// Dashboard Widgets
+//
/**
@@ -221,11 +264,16 @@
/**
- * Include additional elements in the 'At a Glance' dashboard widget.
- * This widget was previously 'Right Now'.
+ * Filter the array of extra elements to list in the 'At a Glance'
+ * dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'. Each element
+ * is wrapped in list-item tags on output.
*
* @since 3.8.0
- * @param array $items Array of items.
+ *
+ * @param array $items Array of extra 'At a Glance' widget items.
*/
$elements = apply_filters( 'dashboard_glance_items', array() );
+
if ( $elements ) {
echo '
' . implode( "\n", $elements ) . "\n";
@@ -241,18 +289,24 @@
/**
- * Filter the title attribute for the link displayed in Site Content metabox when search engines are discouraged from indexing the site.
+ * Filter the link title attribute for the 'Search Engines Discouraged'
+ * message displayed in the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
*
* @since 3.0.0
*
- * @param string Default attribute text.
+ * @param string $title Default attribute text.
*/
$title = apply_filters( 'privacy_on_link_title', __( 'Your site is asking search engines not to index its content' ) );
/**
- * Filter the text for the link displayed in Site Content metabox when search engines are discouraged from indexing the site.
+ * Filter the link label for the 'Search Engines Discouraged' message
+ * displayed in the 'At a Glance' dashboard widget.
+ *
+ * Prior to 3.8.0, the widget was named 'Right Now'.
*
* @since 3.0.0
*
- * @param string Default text.
+ * @param string $content Default text.
*/
$content = apply_filters( 'privacy_on_link_text' , __( 'Search Engines Discouraged' ) );
@@ -263,9 +317,28 @@
-
+
+
+
-
+
@@ -471,4 +573,15 @@
$actions['trash'] = "" . _x('Trash', 'verb') . '';
+ /**
+ * Filter the action links displayed for each comment in the 'Recent Comments'
+ * dashboard widget.
+ *
+ * @since 2.6.0
+ *
+ * @param array $actions An array of comment actions. Default actions include:
+ * 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
+ * 'Delete', and 'Trash'.
+ * @param object $comment The comment object.
+ */
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
@@ -831,7 +944,31 @@
function wp_dashboard_primary() {
$feeds = array(
- 'news' => array(
- 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
- 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
+ 'news' => array(
+
+ /**
+ * Filter the primary link URL for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.5.0
+ *
+ * @param string $link The widget's primary link URL.
+ */
+ 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
+
+ /**
+ * Filter the primary feed URL for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url The widget's primary feed URL.
+ */
+ 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
+
+ /**
+ * Filter the primary link title for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $title Title attribute for the widget's primary link.
+ */
'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
'items' => 1,
@@ -841,6 +978,30 @@
),
'planet' => array(
- 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
- 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
+
+ /**
+ * Filter the secondary link URL for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $link The widget's secondary link URL.
+ */
+ 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
+
+ /**
+ * Filter the secondary feed URL for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url The widget's secondary feed URL.
+ */
+ 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
+
+ /**
+ * Filter the secondary link title for the 'WordPress News' dashboard widget.
+ *
+ * @since 2.3.0
+ *
+ * @param string $title Title attribute for the widget's secondary link.
+ */
'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
'items' => 3,
@@ -1058,4 +1219,12 @@
}
+ /**
+ * Filter the notice output for the 'Browse Happy' nag meta box.
+ *
+ * @since 3.2.0
+ *
+ * @param string $notice The notice content.
+ * @param array $response An array containing web browser information.
+ */
echo apply_filters( 'browse-happy-notice', $notice, $response );
}