X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..refs/tags/wordpress-2.9:/wp-includes/post-template.php diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 30856c58..9b6efcda 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -160,10 +160,9 @@ function get_the_guid( $id = 0 ) { * * @param string $more_link_text Optional. Content for when there is more text. * @param string $stripteaser Optional. Teaser content before the more text. - * @param string $more_file Optional. Not used. */ -function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { - $content = get_the_content($more_link_text, $stripteaser, $more_file); +function the_content($more_link_text = null, $stripteaser = 0) { + $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; @@ -176,10 +175,9 @@ function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') * * @param string $more_link_text Optional. Content for when there is more text. * @param string $stripteaser Optional. Teaser content before the more text. - * @param string $more_file Optional. Not used. * @return string */ -function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { +function get_the_content($more_link_text = null, $stripteaser = 0) { global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; if ( null === $more_link_text ) @@ -194,11 +192,6 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = return $output; } - if ( $more_file != '' ) - $file = $more_file; - else - $file = $pagenow; //$_SERVER['PHP_SELF']; - if ( $page > count($pages) ) // if the requested page doesn't exist $page = count($pages); // give them the highest numbered page that DOES exist @@ -254,7 +247,6 @@ function the_excerpt() { */ function get_the_excerpt($deprecated = '') { global $post; - $output = ''; $output = $post->post_excerpt; if ( post_password_required($post) ) { $output = __('There is no excerpt because this is a protected post.'); @@ -312,6 +304,9 @@ function get_post_class( $class = '', $post_id = null ) { $classes = array(); + if ( empty($post) ) + return $classes; + $classes[] = 'post-' . $post->ID; $classes[] = $post->post_type; @@ -342,6 +337,8 @@ function get_post_class( $class = '', $post_id = null ) { $classes = array_merge($classes, $class); } + $classes = array_map('esc_attr', $classes); + return apply_filters('post_class', $classes, $class, $post_id); } @@ -407,7 +404,7 @@ function get_body_class( $class = '' ) { if ( is_author() ) { $author = $wp_query->get_queried_object(); $classes[] = 'author'; - $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->user_id); + $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->ID); } elseif ( is_category() ) { $cat = $wp_query->get_queried_object(); $classes[] = 'category'; @@ -430,13 +427,14 @@ function get_body_class( $class = '' ) { if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) ) $classes[] = 'page-parent'; - if ( $wp_query->post->post_parent ) + if ( $wp_query->post->post_parent ) { $classes[] = 'page-child'; $classes[] = 'parent-pageid-' . $wp_query->post->post_parent; - - if ( is_page_template() ) + } + if ( is_page_template() ) { $classes[] = 'page-template'; $classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) ); + } } elseif ( is_search() ) { if ( !empty($wp_query->posts) ) $classes[] = 'search-results'; @@ -477,6 +475,8 @@ function get_body_class( $class = '' ) { $classes = array_merge($classes, $class); } + $classes = array_map('esc_attr', $classes); + return apply_filters('body_class', $classes, $class); } @@ -544,8 +544,6 @@ function sticky_class( $post_id = null ) { * each bookmarks. * 'after' - Default is '

' (string). The html or text to append to each * bookmarks. - * 'more_file' - Default is '' (string) Page the links should point to. Defaults - * to the current page. * 'link_before' - Default is '' (string). The html or text to prepend to each * Pages link inside the tag. * 'link_after' - Default is '' (string). The html or text to append to each @@ -563,17 +561,13 @@ function wp_link_pages($args = '') { 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 'previouspagelink' => __('Previous page'), 'pagelink' => '%', - 'more_file' => '', 'echo' => 1 + 'echo' => 1 ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); global $post, $page, $numpages, $multipage, $more, $pagenow; - if ( $more_file != '' ) - $file = $more_file; - else - $file = $pagenow; $output = ''; if ( $multipage ) { @@ -705,6 +699,7 @@ function wp_dropdown_pages($args = '') { $pages = get_pages($r); $output = ''; + $name = esc_attr($name); if ( ! empty($pages) ) { $output = "