X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a6f44f0edcda2471c5a33e4156c1c9488c7f3210..a349837896628462bf8c9bdc27d1477a10fe03eb:/wp-includes/post-template.php
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index fb8d1585..37290d5b 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -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 = '') {
*
*
* - sort_column - How to sort the list of pages. Defaults
- * to page title. Use column for posts table.
+ * to 'menu_order, post_title'. Use column for posts table.
* - menu_class - Class to use for the div ID which contains
* the page list. Defaults to 'menu'.
* - echo - 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 .= '
- ' . $args['link_before'] . $text . $args['link_after'] . '
';
+ $menu .= '- ' . $args['link_before'] . $text . $args['link_after'] . '
';
// 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 . '- ' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '';
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', "$link_text", $id, $size, $permalink, $icon, $text );
+ return apply_filters( 'wp_get_attachment_link', "$link_text", $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 = '
+ $output = '
';
- return apply_filters('the_password_form', $output);
+ return apply_filters( 'the_password_form', $output );
}
/**
@@ -1430,3 +1442,22 @@ function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
echo $rows;
echo "
";
}
+
+/**
+ * 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 '
+';
+}
+add_action( 'admin_print_styles', 'wp_382_css_hotfix', 30 );