mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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
This commit is contained in:
parent
507f47d03f
commit
ecd594b5a6
@ -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 ) {
|
||||
|
||||
<form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form">
|
||||
|
||||
<?php if ($error_msg) : ?>
|
||||
<div class="error"><?php _e( $error_msg ); ?></div>
|
||||
<?php if ( $error_msg ) : ?>
|
||||
<div class="error"><?php echo $error_msg; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="input-text-wrap" id="title-wrap">
|
||||
<label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( "What's on your mind?" ); ?></label>
|
||||
<label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( 'What’s on your mind?' ); ?></label>
|
||||
<input type="text" name="post_title" id="title" autocomplete="off" />
|
||||
</div>
|
||||
|
||||
@ -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 ) {
|
||||
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user