[wp-trac] [WordPress Trac] #2834: Cannot conditionalize
previous_posts_link() or next_posts_link()
WordPress Trac
wp-trac at lists.automattic.com
Sun Jun 18 08:28:32 GMT 2006
#2834: Cannot conditionalize previous_posts_link() or next_posts_link()
---------------------------+------------------------------------------------
Reporter: paulschreiber | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: Template | Version: 2.0.3
Severity: normal | Keywords:
---------------------------+------------------------------------------------
Since the functions previous_posts_link() and next_posts_link() print
directly to the screen, you can't conditionalize around them, i.e. print
tags before and after iff they are nonblank.
I have a patch that replaces next_posts_link() with
next_posts_link_text(), which return()s the value instead of printing it.
To preserve compatibility, next_posts_link() is a thin shim that calls
print next_posts_link(). Similarly, next_posts() has been changed to be a
thin shim around next_posts_text().
The same changes were made to previous_posts() and previous_posts_link().
--
Ticket URL: <http://trac.wordpress.org/ticket/2834>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list