Make WordPress Core

Opened 9 years ago

Last modified 9 years ago

#40569 new enhancement

next_post_link parameters $format and $link, have default values that produce awkward to use output

Reported by: bhartlenn Owned by:
Priority: normal Milestone: Awaiting Review
Component: Formatting Version: 4.7.4
Severity: normal Keywords:
Cc: Focuses:

Description

The default output when using the default next_post_link() is:

<a href="nextposturl" rel="next">Post Title Linked here</a> &raquo;

Note how the &raquo; 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 &raquo;" );

Which outputs:

<a href="nextposturl" rel="next">Post Title Linked here &raquo;</a> 

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

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

Change History (1)

#1 @bhartlenn
9 years ago

  • Summary next_post_link parameters $format and $link, have default values produce awkward to use output → next_post_link parameters $format and $link, have default values that produce awkward to use output
Note: See TracTickets for help on using tickets.