]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post-template.php
Wordpress 2.9.2-scripts
[autoinstalls/wordpress.git] / wp-includes / post-template.php
index c473bdcc59c6971ab71287861012f068784a92cc..9b6efcdac3e8ee1bd37fc04b6649eab689fca9b6 100644 (file)
@@ -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;
 
@@ -409,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';
@@ -549,8 +544,6 @@ function sticky_class( $post_id = null ) {
  *      each bookmarks.
  * 'after' - Default is '</p>' (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 <a> tag.
  * 'link_after' - Default is '' (string). The html or text to append to each
@@ -568,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 ) {
@@ -745,7 +734,7 @@ function wp_list_pages($args = '') {
                'child_of' => 0, 'exclude' => '',
                'title_li' => __('Pages'), 'echo' => 1,
                'authors' => '', 'sort_column' => 'menu_order, post_title',
-               'link_before' => '', 'link_after' => ''
+               'link_before' => '', 'link_after' => '', 'walker' => '',
        );
 
        $r = wp_parse_args( $args, $defaults );
@@ -757,8 +746,9 @@ function wp_list_pages($args = '') {
        // sanitize, mostly to keep spaces out
        $r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']);
 
-       // Allow plugins to filter an array of excluded pages
-       $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
+       // Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array)
+       $exclude_array = ( $r['exclude'] ) ? explode(',', $r['exclude']) : array();
+       $r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', $exclude_array) );
 
        // Query pages.
        $r['hierarchical'] = 0;
@@ -777,7 +767,7 @@ function wp_list_pages($args = '') {
                        $output .= '</ul></li>';
        }
 
-       $output = apply_filters('wp_list_pages', $output);
+       $output = apply_filters('wp_list_pages', $output, $r);
 
        if ( $r['echo'] )
                echo $output;
@@ -828,7 +818,7 @@ function wp_page_menu( $args = array() ) {
                $class = '';
                if ( is_front_page() && !is_paged() )
                        $class = 'class="current_page_item"';
-               $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
+               $menu .= '<li ' . $class . '><a href="' . get_option('home') . '" title="' . esc_attr($text) . '">' . $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'] ) ) {