X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..refs/tags/wordpress-4.3:/wp-admin/includes/dashboard.php diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index b7dda132..49fcdd92 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -12,6 +12,10 @@ * Handles POST data, sets up filters. * * @since 2.5.0 + * + * @global array $wp_registered_widgets + * @global array $wp_registered_widget_controls + * @global array $wp_dashboard_control_callbacks */ function wp_dashboard_setup() { global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; @@ -125,6 +129,16 @@ function wp_dashboard_setup() { do_action( 'do_meta_boxes', $screen->id, 'side', '' ); } +/** + * + * @global array $wp_dashboard_control_callbacks + * + * @param string $widget_id + * @param string $widget_name + * @param callback $callback + * @param callback $control_callback + * @param array $callback_args + */ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) { $screen = get_current_screen(); global $wp_dashboard_control_callbacks; @@ -154,6 +168,11 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args ); } +/** + * + * @param type $dashboard + * @param type $meta_box + */ function _wp_dashboard_control_callback( $dashboard, $meta_box ) { echo '
'; wp_dashboard_trigger_widget_control( $meta_box['id'] ); @@ -336,6 +355,9 @@ function wp_dashboard_right_now() { \n"; } +/** + * @global object $comment + * + * @param object $comment + * @param bool $show_date + */ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $GLOBALS['comment'] =& $comment; @@ -599,7 +631,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { comment_type || 'comment' == $comment->comment_type ) : ?> -
+

' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?> @@ -619,7 +651,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { } $type = esc_html( $type ); ?> -
+

$type", $comment_post_link." ".$comment_link ); ?>

@@ -770,6 +802,9 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { $comments_query['status'] = 'approve'; while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) { + if ( ! is_array( $possible ) ) { + break; + } foreach ( $possible as $comment ) { if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) continue; @@ -845,7 +880,8 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar $check_urls = array( $widgets[$widget_id]['url'] ); } - $cache_key = 'dash_' . md5( $widget_id ); + $locale = get_locale(); + $cache_key = 'dash_' . md5( $widget_id . '_' . $locale ); if ( false !== ( $output = get_transient( $cache_key ) ) ) { echo $output; return true; @@ -875,6 +911,8 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar * * @since 2.5.0 * + * @global array $wp_dashboard_control_callbacks + * * @param int $widget_control_id Registered Widget ID. */ function wp_dashboard_trigger_widget_control( $widget_control_id = false ) { @@ -1174,7 +1212,6 @@ function wp_dashboard_quota() {