} 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';
$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 ) {
*
* <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
$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'] ) ) {
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);
}
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 ) )
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) ) {
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 );
}
/**
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 );
}
/**
echo "<ul class='post-revisions hide-if-no-js'>\n";
echo $rows;
-
- // 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>";
- }
-
+ echo "</ul>";
}