WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9082 closed defect (bug) (worksforme)

wp_page_menu, home page link isn't use link_before and link_after arguments

Reported by: satranc Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

When I wanted to use this filter;

function aa_wp_page_menu_args($args) {

$argslink_before?='<span>';
$argslink_after?='</span>';
return $args;

}
add_filter('wp_page_menu_args','aa_wp_page_menu_args');

for wp_page_menu, home page didn't took arguments.

Change History (1)

comment:1 sivel5 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Your code produced the following results for me:

<div class="menu">
	<ul>
		<li class="current_page_item">
			<a href="http://wordpress.trunk">
				<span>Home</span>
			</a>
		</li>
		[snip]
	</ul>
</div>

This is the code I used, since your code lost formatting in the description:

function aa_wp_page_menu_args($args) {
        $args['link_before']='<span>';
        $args['link_after']='</span>'; 
        return $args;
}
add_filter('wp_page_menu_args','aa_wp_page_menu_args');
Note: See TracTickets for help on using tickets.