@@ -1220,9 +1265,15 @@ function wp_dashboard_browser_nag() {
if ( $response ) {
if ( $response['insecure'] ) {
- $msg = sprintf( __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );
+ /* translators: %s: browser name and link */
+ $msg = sprintf( __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
+ sprintf( '%s', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
} else {
- $msg = sprintf( __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );
+ /* translators: %s: browser name and link */
+ $msg = sprintf( __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
+ sprintf( '%s', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
}
$browser_nag_class = '';
@@ -1301,8 +1352,8 @@ function wp_check_browser_version() {
/**
* Response should be an array with:
* 'name' - string - A user friendly browser name
- * 'version' - string - The most recent version of the browser
- * 'current_version' - string - The version of the browser the user is using
+ * 'version' - string - The version of the browser the user is using
+ * 'current_version' - string - The most recent version of the browser
* 'upgrade' - boolean - Whether the browser needs an upgrade
* 'insecure' - boolean - Whether the browser is deemed insecure
* 'upgrade_url' - string - The url to visit to upgrade
@@ -1333,12 +1384,12 @@ function wp_dashboard_empty() {}
function wp_welcome_panel() {
?>
-
+
-
+
@@ -1347,7 +1398,7 @@ function wp_welcome_panel() {
-
+
' . __( 'Edit your front page' ) . '', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?>
@@ -1364,7 +1415,7 @@ function wp_welcome_panel() {
- ' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?> -
++ ' . get_comment_author_link( $comment ) . '', + $comment_post_link, + ' ' . __( '[Pending]' ) . '' + ); + } else { + printf( + /* translators: 1: comment author, 2: notification if the comment is pending */ + __( 'From %1$s %2$s' ), + '' . get_comment_author_link( $comment ) . '', + ' ' . __( '[Pending]' ) . '' + ); + } + ?> +
$type", $comment_post_link." ".$comment_link ); ?>
- +$type", $comment_post_link ); ?>
+ - +' . $args['title'] . '
'; + echo '' . $args['title'] . '
'; echo ''; @@ -757,6 +790,9 @@ function wp_dashboard_recent_posts( $args ) { $relative = __( 'Today' ); } elseif ( date( 'Y-m-d', $time ) == $tomorrow ) { $relative = __( 'Tomorrow' ); + } elseif ( date( 'Y', $time ) !== date( 'Y', current_time( 'timestamp' ) ) ) { + /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see http://php.net/date */ + $relative = date_i18n( __( 'M jS Y' ), $time ); } else { /* translators: date and time format for recent posts on the dashboard, see http://php.net/date */ $relative = date_i18n( __( 'M jS' ), $time ); @@ -818,7 +854,7 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { if ( $comments ) { echo '';
- echo '';
foreach ( $comments as $comment )
@@ -863,7 +899,7 @@ function wp_dashboard_rss_output( $widget_id ) {
* @since 2.5.0
*
* @param string $widget_id
- * @param callback $callback
+ * @param callable $callback
* @param array $check_urls RSS feeds
* @return bool False on failure. True on success.
*/
@@ -903,9 +939,10 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
return true;
}
-/* Dashboard Widgets Controls */
+//
+// Dashboard Widgets Controls
+//
-// Calls widget_control callback
/**
* Calls widget control callback.
*
@@ -984,7 +1021,7 @@ function wp_dashboard_primary() {
*
* @param string $link The widget's primary link URL.
*/
- 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
+ 'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
/**
* Filter the primary feed URL for the 'WordPress News' dashboard widget.
@@ -1036,7 +1073,15 @@ function wp_dashboard_primary() {
* @param string $title Title attribute for the widget's secondary link.
*/
'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
- 'items' => 3,
+
+ /**
+ * Filter the number of secondary link items for the 'WordPress News' dashboard widget.
+ *
+ * @since 4.4.0
+ *
+ * @param string $items How many items to show in the secondary feed.
+ */
+ 'items' => apply_filters( 'dashboard_secondary_items', 3 ),
'show_summary' => 0,
'show_author' => 0,
'show_date' => 0,
@@ -1069,7 +1114,7 @@ function wp_dashboard_primary() {
* @param array $feeds Array of RSS feeds.
*/
function wp_dashboard_primary_output( $widget_id, $feeds ) {
- foreach( $feeds as $type => $args ) {
+ foreach ( $feeds as $type => $args ) {
$args['type'] = $type;
echo '';
if ( $type === 'plugins' ) {
@@ -1179,7 +1224,7 @@ function wp_dashboard_quota() {
$percentused = number_format( $percentused );
?>
-
+
-
@@ -1220,9 +1265,15 @@ function wp_dashboard_browser_nag() {
if ( $response ) {
if ( $response['insecure'] ) {
- $msg = sprintf( __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );
+ /* translators: %s: browser name and link */
+ $msg = sprintf( __( "It looks like you're using an insecure version of %s. Using an outdated browser makes your computer unsafe. For the best WordPress experience, please update your browser." ),
+ sprintf( '%s', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
} else {
- $msg = sprintf( __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ), esc_attr( $response['update_url'] ), esc_html( $response['name'] ) );
+ /* translators: %s: browser name and link */
+ $msg = sprintf( __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
+ sprintf( '%s', esc_url( $response['update_url'] ), esc_html( $response['name'] ) )
+ );
}
$browser_nag_class = '';
@@ -1301,8 +1352,8 @@ function wp_check_browser_version() {
/**
* Response should be an array with:
* 'name' - string - A user friendly browser name
- * 'version' - string - The most recent version of the browser
- * 'current_version' - string - The version of the browser the user is using
+ * 'version' - string - The version of the browser the user is using
+ * 'current_version' - string - The most recent version of the browser
* 'upgrade' - boolean - Whether the browser needs an upgrade
* 'insecure' - boolean - Whether the browser is deemed insecure
* 'upgrade_url' - string - The url to visit to upgrade
@@ -1333,12 +1384,12 @@ function wp_dashboard_empty() {}
function wp_welcome_panel() {
?>
-
+
-
+
@@ -1347,7 +1398,7 @@ function wp_welcome_panel() {
-
+
- ' . __( 'Edit your front page' ) . '', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?>
@@ -1364,7 +1415,7 @@ function wp_welcome_panel() {
-
+
' . __( 'Comments' ) . '
'; + echo '' . __( 'Comments' ) . '
'; echo '