X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..refs/tags/wordpress-4.2.3:/wp-admin/includes/dashboard.php diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index bf37176b..b7dda132 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -155,7 +155,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ } function _wp_dashboard_control_callback( $dashboard, $meta_box ) { - echo '
'; + echo ''; wp_dashboard_trigger_widget_control( $meta_box['id'] ); wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' ); echo ''; @@ -379,14 +379,16 @@ function wp_network_dashboard_right_now() {

- + + 'submit_users' ) ); ?>

- + + 'submit_sites' ) ); ?>

@@ -416,6 +418,10 @@ function wp_network_dashboard_right_now() { function wp_dashboard_quick_press( $error_msg = false ) { global $post_ID; + if ( ! current_user_can( 'edit_posts' ) ) { + return; + } + /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID if ( $last_post_id ) { @@ -518,7 +524,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) { function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $GLOBALS['comment'] =& $comment; - $comment_post_title = strip_tags(get_the_title( $comment->comment_post_ID )); + $comment_post_title = _draft_or_post_title( $comment->comment_post_ID ); if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) { $comment_post_url = get_edit_post_link( $comment->comment_post_ID ); @@ -689,6 +695,15 @@ function wp_dashboard_recent_posts( $args ) { 'cache_results' => false, 'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable', ); + + /** + * Filter the query arguments used for the Recent Posts widget. + * + * @since 4.2.0 + * + * @param array $query_args The arguments passed to WP_Query to produce the list of posts. + */ + $query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args ); $posts = new WP_Query( $query_args ); if ( $posts->have_posts() ) { @@ -715,15 +730,12 @@ function wp_dashboard_recent_posts( $args ) { $relative = date_i18n( __( 'M jS' ), $time ); } - if ( current_user_can( 'edit_post', get_the_ID() ) ) { - /* translators: 1: relative date, 2: time, 3: post edit link, 4: post title */ - $format = __( '%1$s, %2$s %4$s' ); - printf( "
  • $format
  • ", $relative, get_the_time(), get_edit_post_link(), _draft_or_post_title() ); - } else { - /* translators: 1: relative date, 2: time, 3: post title */ - $format = __( '%1$s, %2$s %3$s' ); - printf( "
  • $format
  • ", $relative, get_the_time(), _draft_or_post_title() ); - } + // Use the post edit link for those who can edit, the permalink otherwise. + $recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink(); + + /* translators: 1: relative date, 2: time, 3: post edit link or permalink, 4: post title */ + $format = __( '%1$s, %2$s %4$s' ); + printf( "
  • $format
  • ", $relative, get_the_time(), $recent_post_link, _draft_or_post_title() ); } echo ''; @@ -1324,7 +1336,7 @@ function wp_welcome_panel() {
  • ' . __( 'Turn comments on or off' ) . '', admin_url( 'options-discussion.php' ) ); ?>
  • -
  • ' . __( 'Learn more about getting started' ) . '', __( 'http://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?>
  • +
  • ' . __( 'Learn more about getting started' ) . '', __( 'https://codex.wordpress.org/First_Steps_With_WordPress' ) ); ?>