link_before and link_after for wp_list_pages(). Props thee17. fixes #8041
git-svn-id: https://develop.svn.wordpress.org/trunk@9484 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6b2d5e1cee
commit
81a0168123
|
@ -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 )
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue