]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post-template.php
WordPress 3.8.2
[autoinstalls/wordpress.git] / wp-includes / post-template.php
index 03302eab648aab8ba3062bf51b78e4ba843ee01d..37290d5bd92f64462c91fc3743ee80192a690418 100644 (file)
@@ -458,7 +458,10 @@ function get_body_class( $class = '' ) {
        } elseif ( is_archive() ) {
                if ( is_post_type_archive() ) {
                        $classes[] = 'post-type-archive';
-                       $classes[] = 'post-type-archive-' . sanitize_html_class( get_query_var( 'post_type' ) );
+                       $post_type = get_query_var( 'post_type' );
+                       if ( is_array( $post_type ) )
+                               $post_type = reset( $post_type );
+                       $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
                } else if ( is_author() ) {
                        $author = $wp_query->get_queried_object();
                        $classes[] = 'author';
@@ -650,7 +653,7 @@ function wp_link_pages( $args = '' ) {
        $r = apply_filters( 'wp_link_pages_args', $r );
        extract( $r, EXTR_SKIP );
 
-       global $page, $numpages, $multipage, $more, $pagenow;
+       global $page, $numpages, $multipage, $more;
 
        $output = '';
        if ( $multipage ) {
@@ -875,7 +878,7 @@ function wp_list_pages($args = '') {
  *
  * <ul>
  * <li><strong>sort_column</strong> - How to sort the list of pages. Defaults
- * to page title. Use column for posts table.</li>
+ * to 'menu_order, post_title'. Use column for posts table.</li>
  * <li><strong>menu_class</strong> - Class to use for the div ID which contains
  * the page list. Defaults to 'menu'.</li>
  * <li><strong>echo</strong> - Whether to echo list or return it. Defaults to
@@ -910,7 +913,7 @@ function wp_page_menu( $args = array() ) {
                $class = '';
                if ( is_front_page() && !is_paged() )
                        $class = 'class="current_page_item"';
-               $menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
+               $menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
                // If the front page is a page, add it to the exclude list
                if (get_option('show_on_front') == 'page') {
                        if ( !empty( $list_args['exclude'] ) ) {
@@ -954,6 +957,11 @@ function walk_page_tree($pages, $depth, $current_page, $r) {
        else
                $walker = $r['walker'];
 
+       foreach ( (array) $pages as $page ) {
+               if ( $page->post_parent )
+                       $r['pages_with_children'][ $page->post_parent ] = true;
+       }
+
        $args = array($pages, $depth, $r, $current_page);
        return call_user_func_array(array($walker, 'walk'), $args);
 }
@@ -1042,6 +1050,10 @@ class Walker_Page extends Walker {
 
                extract($args, EXTR_SKIP);
                $css_class = array('page_item', 'page-item-'.$page->ID);
+
+               if( isset( $args['pages_with_children'][ $page->ID ] ) )
+                       $css_class[] = 'page_item_has_children';
+
                if ( !empty($current_page) ) {
                        $_current_page = get_post( $current_page );
                        if ( in_array( $page->ID, $_current_page->ancestors ) )
@@ -1059,6 +1071,7 @@ class Walker_Page extends Walker {
                if ( '' === $page->post_title )
                        $page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
 
+               /** This filter is documented in wp-includes/post-template.php */
                $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
 
                if ( !empty($show_date) ) {
@@ -1191,7 +1204,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
        if ( trim( $link_text ) == '' )
                $link_text = $_post->post_title;
 
-       return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
+       return apply_filters( 'wp_get_attachment_link', "<a href='$url'>$link_text</a>", $id, $size, $permalink, $icon, $text );
 }
 
 /**
@@ -1233,12 +1246,11 @@ function prepend_attachment($content) {
 function get_the_password_form( $post = 0 ) {
        $post = get_post( $post );
        $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
-       $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
-       <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
-       <p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
-</form>
+       $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
+       <p>' . __( 'This content is password protected. To view it please enter your password below:' ) . '</p>
+       <p><label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__( 'Submit' ) . '" /></p></form>
        ';
-       return apply_filters('the_password_form', $output);
+       return apply_filters( 'the_password_form', $output );
 }
 
 /**
@@ -1428,31 +1440,24 @@ function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
 
        echo "<ul class='post-revisions hide-if-no-js'>\n";
        echo $rows;
+       echo "</ul>";
+}
 
-       // if the post was previously restored from a revision
-       // show the restore event details
-       if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) {
-               $author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] );
-               /* translators: revision date format, see http://php.net/date */
-               $datef = _x( 'j F, Y @ G:i:s', 'revision date format');
-               $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) );
-               $time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ;
-               ?>
-               <hr />
-               <div id="revisions-meta-restored">
-                       <?php
-                       printf(
-                               /* translators: restored revision details: 1: gravatar image, 2: author name, 3: time ago, 4: date */
-                               __( 'Previously restored by %1$s %2$s, %3$s ago (%4$s)' ),
-                               get_avatar( $author->ID, 24 ),
-                               $author->display_name,
-                               $time_diff,
-                               $date
-                       );
-                       ?>
-               </div>
-               <?php
-               echo "</ul>";
-       }
-
+/**
+ * Dashboard CSS fixes for 3.8.2.
+ *
+ * This function cheaply fixes #WP27082 and #WP26910 in lieu of
+ * changing the massive wp-admin.css file in a point release.
+ * This lucky includes file was already receiving an update.
+ *
+ * @since 3.8.2
+ * @access private
+ */
+function wp_382_css_hotfix() {
+       echo '<style type="text/css">
+#activity-widget #the-comment-list .comment-item { position: relative; }
+.tagsdiv .newtag { padding: 6px 10px; height: auto; }
+</style>
+';
 }
+add_action( 'admin_print_styles', 'wp_382_css_hotfix', 30 );