]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/template.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-admin / includes / template.php
index e65c7d0f237ed6b4d497a77e43bb6eeb7a67ff90..5138fd204ca30e6341005fdc383c7c83b63ef651 100644 (file)
@@ -8,10 +8,10 @@
  * @subpackage Administration
  */
 
-/** Walker_Category_Checklist class */ 
+/** Walker_Category_Checklist class */
 require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' );
 
-/** WP_Internal_Pointers class */ 
+/** WP_Internal_Pointers class */
 require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' );
 
 //
@@ -1186,10 +1186,12 @@ function do_accordion_sections( $screen, $context, $object ) {
  *
  * @global $wp_settings_sections Storage array of all settings sections added to admin pages
  *
- * @param string $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
- * @param string $title    Formatted title of the section. Shown as the heading for the section.
- * @param string $callback Function that echos out any content at the top of the section (between heading and fields).
- * @param string $page     The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
+ * @param string   $id       Slug-name to identify the section. Used in the 'id' attribute of tags.
+ * @param string   $title    Formatted title of the section. Shown as the heading for the section.
+ * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).
+ * @param string   $page     The slug-name of the settings page on which to show the section. Built-in pages include
+ *                           'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
+ *                           add_options_page();
  */
 function add_settings_section($id, $title, $callback, $page) {
        global $wp_settings_sections;
@@ -1223,16 +1225,16 @@ function add_settings_section($id, $title, $callback, $page) {
  *
  * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections
  *
- * @param string $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
- * @param string $title    Formatted title of the field. Shown as the label for the field
- *                         during output.
- * @param string $callback Function that fills the field with the desired form inputs. The
- *                         function should echo its output.
- * @param string $page     The slug-name of the settings page on which to show the section
- *                         (general, reading, writing, ...).
- * @param string $section  Optional. The slug-name of the section of the settings page
- *                         in which to show the box. Default 'default'.
- * @param array  $args {
+ * @param string   $id       Slug-name to identify the field. Used in the 'id' attribute of tags.
+ * @param string   $title    Formatted title of the field. Shown as the label for the field
+ *                           during output.
+ * @param callable $callback Function that fills the field with the desired form inputs. The
+ *                           function should echo its output.
+ * @param string   $page     The slug-name of the settings page on which to show the section
+ *                           (general, reading, writing, ...).
+ * @param string   $section  Optional. The slug-name of the section of the settings page
+ *                           in which to show the box. Default 'default'.
+ * @param array    $args {
  *     Optional. Extra arguments used when outputting the field.
  *
  *     @type string $label_for When supplied, the setting title will be wrapped
@@ -1483,7 +1485,7 @@ function find_posts_div($found_action = '') {
 ?>
        <div id="find-posts" class="find-box" style="display: none;">
                <div id="find-posts-head" class="find-box-head">
-                       <?php _e( 'Find Posts or Pages' ); ?>
+                       <?php _e( 'Attach to existing content' ); ?>
                        <div id="find-posts-close"></div>
                </div>
                <div class="find-box-inside">
@@ -1683,8 +1685,7 @@ function _post_states($post) {
        if ( 'draft' == $post->post_status && 'draft' != $post_status )
                $post_states['draft'] = __('Draft');
        if ( 'pending' == $post->post_status && 'pending' != $post_status )
-               /* translators: post state */
-               $post_states['pending'] = _x('Pending', 'post state');
+               $post_states['pending'] = _x('Pending', 'post status');
        if ( is_sticky($post->ID) )
                $post_states['sticky'] = __('Sticky');
 
@@ -1749,13 +1750,17 @@ function _media_states( $post ) {
                $media_states[] = __( 'Site Icon' );
        }
 
+       if ( $post->ID == get_theme_mod( 'site_logo' ) ) {
+               $media_states[] = __( 'Logo' );
+       }
+
        /**
         * Filter the default media display states for items in the Media list table.
         *
         * @since 3.2.0
         *
         * @param array $media_states An array of media states. Default 'Header Image',
-        *                            'Background Image', 'Site Icon'.
+        *                            'Background Image', 'Site Icon', 'Logo'.
         */
        $media_states = apply_filters( 'display_media_states', $media_states );
 
@@ -1784,6 +1789,7 @@ function _media_states( $post ) {
 function compression_test() {
 ?>
        <script type="text/javascript">
+       var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
        var testCompression = {
                get : function(test) {
                        var x;
@@ -1803,7 +1809,7 @@ function compression_test() {
                                        }
                                };
 
-                               x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&'+(new Date()).getTime(), true);
+                               x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&_ajax_nonce='+compressionNonce+'&'+(new Date()).getTime(), true);
                                x.send('');
                        }
                },
@@ -2055,7 +2061,7 @@ function wp_star_rating( $args = array() ) {
                $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
        }
 
-       $output = '<div class="star-rating" title="' . esc_attr( $title ) . '">';
+       $output = '<div class="star-rating">';
        $output .= '<span class="screen-reader-text">' . $title . '</span>';
        $output .= str_repeat( '<div class="star star-full"></div>', $full_stars );
        $output .= str_repeat( '<div class="star star-half"></div>', $half_stars );