X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-admin/includes/dashboard.php?ds=sidebyside
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index 0df8109f..657402f9 100644
--- a/wp-admin/includes/dashboard.php
+++ b/wp-admin/includes/dashboard.php
@@ -232,7 +232,7 @@ function wp_dashboard_right_now() {
$num_tags = wp_count_terms('post_tag');
- $num_comm = wp_count_comments( );
+ $num_comm = wp_count_comments();
echo "\n\t".'
';
echo "\n\t".'
' . __('Content') . '
'."\n\t".'
';
@@ -589,8 +589,8 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
$item = "" . esc_html($title) . " " . get_the_time( get_option( 'date_format' ), $draft ) . '
';
- if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
- $item .= '' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '
';
+ if ( $the_content = wp_trim_words( $draft->post_content, 10 ) )
+ $item .= '' . $the_content . '
';
$list[] = $item;
}
?>
@@ -827,7 +827,7 @@ function wp_dashboard_incoming_links_output() {
$publisher = "$publisher";
$content = $item->get_content();
- $content = wp_html_excerpt($content, 50) . ' ...';
+ $content = wp_html_excerpt( $content, 50, ' …' );
if ( $link )
/* translators: incoming links feed, %1$s is other person, %3$s is content */
@@ -869,7 +869,7 @@ function wp_dashboard_primary_control() {
}
/**
- * {@internal Missing Short Description}}
+ * Display primary dashboard RSS widget feed.
*
* @since 2.5.0
*
@@ -923,8 +923,8 @@ function wp_dashboard_secondary_output() {
function wp_dashboard_plugins() {
wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
- 'http://wordpress.org/extend/plugins/rss/browse/popular/',
- 'http://wordpress.org/extend/plugins/rss/browse/new/'
+ 'http://wordpress.org/plugins/rss/browse/popular/',
+ 'http://wordpress.org/plugins/rss/browse/new/'
) );
}
@@ -934,8 +934,8 @@ function wp_dashboard_plugins() {
* @since 2.5.0
*/
function wp_dashboard_plugins_output() {
- $popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
- $new = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
+ $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' );
+ $new = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' );
if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
$plugin_slugs = array_keys( get_plugins() );
@@ -1093,7 +1093,7 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
$widget_options[$widget_id]['number'] = $number;
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) {
- $_POST['widget-rss'][$number] = stripslashes_deep( $_POST['widget-rss'][$number] );
+ $_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] );
$widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] );
// title is optional. If black, fill it if possible
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
@@ -1114,7 +1114,15 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
}
-// Display File upload quota on dashboard
+/**
+ * Display file upload quota on dashboard.
+ *
+ * Runs on the activity_box_end hook in wp_dashboard_right_now().
+ *
+ * @since 3.0.0
+ *
+ * @return bool True if not multisite, user can't upload files, or the space check option is disabled.
+*/
function wp_dashboard_quota() {
if ( !is_multisite() || !current_user_can('upload_files') || get_site_option( 'upload_space_check_disabled' ) )
return true;