Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#12265 closed defect (bug) (invalid)

wp_list_pages link_before / link_after not working in WP 2.9.2

Reported by: mindshare Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.2
Component: Template Keywords: reporter-feedback
Focuses: Cc:


After upgrading from 2.9.1 to 2.9.2 wp_list_pages doesn't render the text in link_before or link_after in wp_list_pages.

Here's the code:


I posted it to the forums and someone else confirmed this issue:

Change History (4)

#1 @ryan
11 years ago

Strange. 2.9.2 changed very little and ventured nowhere near wp_list_pages().

#2 @sivel
11 years ago

  • Component changed from General to Template
  • Keywords reporter-feedback added; wp_list_pages link_before link_after removed

I've just tested in 2.9.1 and then again in 2.9.2 and 3.0.

Here is what I got in each case:

<!-- generator="WordPress/2.9.1" --> 
<li class="page_item page-item-2"><a href="http://wordpress.stable/about/" title="About"><span>About</span></a></li> 
<!-- generator="WordPress/2.9.2" --> 
<li class="page_item page-item-2"><a href="http://wordpress.stable/about/" title="About"><span>About</span></a></li> 
<!-- generator="WordPress/3.0-alpha" --> 
<li class="page_item page-item-2"><a href="http://wordpress.stable/about/" title="About"><span>About</span></a></li> 

In each case as you can see the <span> and </span> were inserted before and after the word "About".

The code I used was the following:

<?php the_generator('comment'); ?>
<?php wp_list_pages('title_li=&sort_column=menu_order&depth=1&link_before=<span>&link_after=</span>'); ?>

From the codex page that describes the arguments for this function:

(string) Sets the text or html that proceeds the link text inside <a> tag. (This parameter was added with Version 2.7)

(string) Sets the text or html that follows the link text inside <a> tag. (This parameter was added with Version 2.7)

I cannot reproduce this problem.

#3 @mindshare
11 years ago

  • Cc info@… added
  • Resolution set to invalid
  • Status changed from new to closed

I finally figured this issue out - it is a bug with the Page Menu Editor plugin (http://www.stuffbysarah.net/wordpress-plugins/page-menu-editor/) - after disabling that link_before and link_after work as expected. Thank you for the help! I will alert the plugin author.

#4 @nacin
11 years ago

  • Milestone 2.9.3 deleted
Note: See TracTickets for help on using tickets.