*
* @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;
*
* @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 )
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
*/
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.');
$classes = array();
+ if ( empty($post) )
+ return $classes;
+
$classes[] = 'post-' . $post->ID;
$classes[] = $post->post_type;
$classes = array_merge($classes, $class);
}
+ $classes = array_map('esc_attr', $classes);
+
return apply_filters('post_class', $classes, $class, $post_id);
}
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';
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';
$classes = array_merge($classes, $class);
}
+ $classes = array_map('esc_attr', $classes);
+
return apply_filters('body_class', $classes, $class);
}
* 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
'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 ) {
$pages = get_pages($r);
$output = '';
+ $name = esc_attr($name);
if ( ! empty($pages) ) {
$output = "<select name=\"$name\" id=\"$name\">\n";
'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 );
// 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;
$output .= '</ul></li>';
}
- $output = apply_filters('wp_list_pages', $output);
+ $output = apply_filters('wp_list_pages', $output, $r);
if ( $r['echo'] )
echo $output;
* @param array|string $args
*/
function wp_page_menu( $args = array() ) {
- $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
+ $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
$args = wp_parse_args( $args, $defaults );
$args = apply_filters( 'wp_page_menu_args', $args );
$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'] ) ) {
if ( $menu )
$menu = '<ul>' . $menu . '</ul>';
- $menu = '<div class="' . $args['menu_class'] . '">' . $menu . "</div>\n";
+ $menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n";
$menu = apply_filters( 'wp_page_menu', $menu, $args );
if ( $args['echo'] )
echo $menu;