[wp-trac] [WordPress Trac] #40569: next_post_link parameters $format and $link, have default values produce awkward to use output

WordPress Trac noreply at wordpress.org
Wed Apr 26 02:45:18 UTC 2017


#40569: next_post_link parameters $format and $link, have default values produce
awkward to use output
-------------------------+-----------------------------
 Reporter:  bhartlenn    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Formatting   |    Version:  4.7.4
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The default output when using the default next_post_link() is:

 {{{
 <a href="nextposturl" rel="next">Post Title Linked here</a> »
 }}}

 Note how the » is left outside of the linked text by default. I
 believe for most users this will cause a styling issue to fix as soon as
 you use this function, and otherwise, seems improper for a default output.
 I used next_post_link() with the following values to get what I think
 should be default output behavior

 {{{
 next_post_link( "%link", "%title »" );
 }}}

 Which outputs:
 {{{
 <a href="nextposturl" rel="next">Post Title Linked here »</a>
 }}}

 Note that the » is now inside of the linked text, and any css
 applied to the next post link will also affect the » by default, and
 no changes to function parameters would be required by users.

 To implement this enhancement, I believe you would simply move the »
 into the default value for the $link parameter, and out of the $format
 parameter default value.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40569>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list