link_before and link_after for wp_list_pages(). Props thee17. fixes #8041

git-svn-id: http://svn.automattic.com/wordpress/trunk@9484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-11-03 06:07:39 +00:00
parent 0c4c675dbc
commit b7d2eb8000
2 changed files with 5 additions and 4 deletions

View File

@ -1168,7 +1168,7 @@ class Walker_Page extends Walker {
$css_class .= ' current_page_parent';
}
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . apply_filters('the_title', $page->post_title) . '</a>';
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>';
if ( !empty($show_date) ) {
if ( 'modified' == $show_date )

View File

@ -595,7 +595,8 @@ function wp_list_pages($args = '') {
'date_format' => get_option('date_format'),
'child_of' => 0, 'exclude' => '',
'title_li' => __('Pages'), 'echo' => 1,
'authors' => '', 'sort_column' => 'menu_order, post_title'
'authors' => '', 'sort_column' => 'menu_order, post_title',
'link_before' => '', 'link_after' => ''
);
$r = wp_parse_args( $args, $defaults );
@ -643,7 +644,7 @@ function wp_list_pages($args = '') {
* @param array|string $args
*/
function wp_page_menu( $args = array() ) {
$defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true);
$defaults = array('sort_column' => '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 );
@ -658,7 +659,7 @@ function wp_page_menu( $args = array() ) {
$class = '';
if ( is_home() && !is_paged() )
$class = 'class="current_page_item"';
$menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $text . '</a></li>';
$menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $link_before . $text . $link_after . '</a></li>';
}
$list_args = $args;