]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/dashboard.php
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-admin / includes / dashboard.php
index 0df8109f58b55415545c69a23804501b74b38627..657402f9422ec9f035e669982a3cf180fd7095cf 100644 (file)
@@ -232,7 +232,7 @@ function wp_dashboard_right_now() {
 
        $num_tags = wp_count_terms('post_tag');
 
 
        $num_tags = wp_count_terms('post_tag');
 
-       $num_comm = wp_count_comments( );
+       $num_comm = wp_count_comments();
 
        echo "\n\t".'<div class="table table_content">';
        echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
 
        echo "\n\t".'<div class="table table_content">';
        echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
@@ -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 = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
                        $url = get_edit_post_link( $draft->ID );
                        $title = _draft_or_post_title( $draft->ID );
                        $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
-                       if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
-                               $item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '&hellip;' : '' ) . '</p>';
+                       if ( $the_content = wp_trim_words( $draft->post_content, 10 ) )
+                               $item .= '<p>' . $the_content . '</p>';
                        $list[] = $item;
                }
 ?>
                        $list[] = $item;
                }
 ?>
@@ -827,7 +827,7 @@ function wp_dashboard_incoming_links_output() {
                        $publisher = "<strong>$publisher</strong>";
 
                $content = $item->get_content();
                        $publisher = "<strong>$publisher</strong>";
 
                $content = $item->get_content();
-               $content = wp_html_excerpt($content, 50) . ' ...';
+               $content = wp_html_excerpt( $content, 50, ' &hellip;' );
 
                if ( $link )
                        /* translators: incoming links feed, %1$s is other person, %3$s is content */
 
                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
  *
  *
  * @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(
 
 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() {
  * @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() );
 
        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]) ) {
        $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']) ) {
                $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 );
 }
 
        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;
 function wp_dashboard_quota() {
        if ( !is_multisite() || !current_user_can('upload_files') || get_site_option( 'upload_space_check_disabled' ) )
                return true;