]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/dashboard.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / includes / dashboard.php
index b7dda1323dc7c59814292369e57802737c0a8d31..49fcdd926b7db0112d781f2da5737353face1510 100644 (file)
  * Handles POST data, sets up filters.
  *
  * @since 2.5.0
  * 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;
  */
 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', '' );
 }
 
        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;
 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 );
 }
 
        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 '<form method="post" class="dashboard-widget-control-form">';
        wp_dashboard_trigger_widget_control( $meta_box['id'] );
 function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
        echo '<form method="post" class="dashboard-widget-control-form">';
        wp_dashboard_trigger_widget_control( $meta_box['id'] );
@@ -336,6 +355,9 @@ function wp_dashboard_right_now() {
        <?php endif;
 }
 
        <?php endif;
 }
 
+/**
+ * @since 3.1.0
+ */
 function wp_network_dashboard_right_now() {
        $actions = array();
        if ( current_user_can('create_sites') )
 function wp_network_dashboard_right_now() {
        $actions = array();
        if ( current_user_can('create_sites') )
@@ -413,6 +435,8 @@ function wp_network_dashboard_right_now() {
  *
  * @since 3.8.0
  *
  *
  * @since 3.8.0
  *
+ * @global int $post_ID
+ *
  * @param string $error_msg Optional. Error message. Default false.
  */
 function wp_dashboard_quick_press( $error_msg = false ) {
  * @param string $error_msg Optional. Error message. Default false.
  */
 function wp_dashboard_quick_press( $error_msg = false ) {
@@ -483,6 +507,8 @@ function wp_dashboard_quick_press( $error_msg = false ) {
  * Show recent drafts of the user on the dashboard.
  *
  * @since 2.7.0
  * Show recent drafts of the user on the dashboard.
  *
  * @since 2.7.0
+ *
+ * @param array $drafts
  */
 function wp_dashboard_recent_drafts( $drafts = false ) {
        if ( ! $drafts ) {
  */
 function wp_dashboard_recent_drafts( $drafts = false ) {
        if ( ! $drafts ) {
@@ -521,6 +547,12 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
        echo "</ul>\n</div>";
 }
 
        echo "</ul>\n</div>";
 }
 
+/**
+ * @global object $comment
+ *
+ * @param object $comment
+ * @param bool   $show_date
+ */
 function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
        $GLOBALS['comment'] =& $comment;
 
 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 ) {
 
                        <?php if ( !$comment->comment_type || 'comment' == $comment->comment_type ) : ?>
 
 
                        <?php if ( !$comment->comment_type || 'comment' == $comment->comment_type ) : ?>
 
-                       <div class="dashboard-comment-wrap">
+                       <div class="dashboard-comment-wrap has-row-actions">
                        <h4 class="comment-meta">
                                <?php printf( /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */__( 'From %1$s on %2$s%3$s' ),
                                        '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?>
                        <h4 class="comment-meta">
                                <?php printf( /* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */__( 'From %1$s on %2$s%3$s' ),
                                        '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?>
@@ -619,7 +651,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
                                }
                                $type = esc_html( $type );
                        ?>
                                }
                                $type = esc_html( $type );
                        ?>
-                       <div class="dashboard-comment-wrap">
+                       <div class="dashboard-comment-wrap has-row-actions">
                        <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
                        <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
                        <p class="comment-author"><?php comment_author_link(); ?></p>
                        <?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
                        <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
                        <p class="comment-author"><?php comment_author_link(); ?></p>
@@ -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 ) ) {
                $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;
                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'] );
        }
 
                $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;
        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
  *
  *
  * @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 ) {
  * @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() {
        </div>
        <?php
 }
        </div>
        <?php
 }
-add_action( 'activity_box_end', 'wp_dashboard_quota' );
 
 // Display Browser Nag Meta Box
 function wp_dashboard_browser_nag() {
 
 // Display Browser Nag Meta Box
 function wp_dashboard_browser_nag() {
@@ -1218,6 +1255,12 @@ function wp_dashboard_browser_nag() {
        echo apply_filters( 'browse-happy-notice', $notice, $response );
 }
 
        echo apply_filters( 'browse-happy-notice', $notice, $response );
 }
 
+/**
+ * @since 3.2.0
+ *
+ * @param array $classes
+ * @return array
+ */
 function dashboard_browser_nag_class( $classes ) {
        $response = wp_check_browser_version();
 
 function dashboard_browser_nag_class( $classes ) {
        $response = wp_check_browser_version();
 
@@ -1232,6 +1275,8 @@ function dashboard_browser_nag_class( $classes ) {
  *
  * @since 3.2.0
  *
  *
  * @since 3.2.0
  *
+ * @global string $wp_version
+ *
  * @return array|bool False on failure, array of browser data on success.
  */
 function wp_check_browser_version() {
  * @return array|bool False on failure, array of browser data on success.
  */
 function wp_check_browser_version() {