WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 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:

Description

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:

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

I posted it to the forums and someone else confirmed this issue:
http://wordpress.org/support/topic/365260

Change History (4)

comment:1 @ryan5 years ago

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

comment:2 @sivel5 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:

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

link_after
(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.

comment:3 @mindshare5 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.

comment:4 @nacin5 years ago

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