From ecd594b5a6d7440e62f687dbfef818db4292afa4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Nov 2013 03:21:10 +0000 Subject: [PATCH] PHPDoc and i18n fixes for dashboard widgets. props dimadin for initial patch. see #25824. Built from https://develop.svn.wordpress.org/trunk@26241 git-svn-id: http://core.svn.wordpress.org/trunk@26148 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/dashboard.php | 33 +++++++++++++-------------------- wp-admin/post.php | 4 ++-- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 1c38c82621..6cd81af5f9 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -280,14 +280,13 @@ function wp_network_dashboard_right_now() { } /** - * The Quick Draft widget display and creation of drafts - * - * + * The Quick Draft widget display and creation of drafts. * * @since 3.8.0 * + * @param string $error_msg Error message. */ -function wp_dashboard_quick_press( $error_msg=false ) { +function wp_dashboard_quick_press( $error_msg = false ) { global $post_ID; /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ @@ -313,12 +312,12 @@ function wp_dashboard_quick_press( $error_msg=false ) {
- -
+ +
- +
@@ -466,12 +465,9 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { } /** - * callback function for `Activity` widget - * - * + * Callback function for Activity widget. * * @since 3.8.0 - * */ function wp_dashboard_activity() { @@ -513,12 +509,11 @@ function wp_dashboard_activity() { } /** - * Generates `Publishing Soon` and `Recently Published` sections - * - * + * Generates Publishing Soon and Recently Published sections. * * @since 3.8.0 * + * @param array $args */ function dashboard_show_published_posts( $args ) { @@ -573,12 +568,11 @@ function dashboard_show_published_posts( $args ) { } /** - * Show `Comments` section - * - * + * Show Comments section. * * @since 3.8.0 * + * @param int $total_items */ function dashboard_comments( $total_items = 5 ) { global $wpdb; @@ -631,12 +625,11 @@ function dashboard_comments( $total_items = 5 ) { } /** - * return relative date for given timestamp - * - * + * Return relative date for given timestamp. * * @since 3.8.0 * + * @param int $time Unix $timestamp. */ function dashboard_relative_date( $time ) { diff --git a/wp-admin/post.php b/wp-admin/post.php index e96982b731..1607cbcf3c 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -99,10 +99,10 @@ case 'post-quickdraft-save': $nonce = $_REQUEST['_wpnonce']; $error_msg = false; if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) - $error_msg = 'Unable to submit this form, please refresh and try again.'; + $error_msg = __( 'Unable to submit this form, please refresh and try again.' ); if ( ! current_user_can( 'edit_posts' ) ) - $error_msg = "Oops, you don't have access to add new drafts."; + $error_msg = __( 'Oops, you don’t have access to add new drafts.' ); if ( $error_msg ) return wp_dashboard_quick_press( $error_msg );