[wp-trac] [WordPress Trac] #14760: wp_get_shortlink not working on pages

WordPress Trac noreply at wordpress.org
Thu Aug 15 14:45:21 UTC 2013


#14760: wp_get_shortlink not working on pages
-------------------------------------------------+-------------------------
 Reporter:  mattsay                              |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  General                              |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  has-patch needs-testing dev-         |  Resolution:
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by Otto42):

 Yeah, that's a pretty awful return value there. If the normal link is as
 short as it gets, then it should return the normal link. It's short too.
 Relying on plugins/themes to check for blank and call get_permalink is a
 bit silly.

 I can see the use case for wanting to not show the button, however in that
 case then this function is badly named. The name "wp_get_shortlink"
 implies that it will return a shortlink. It doesn't imply that it will
 return something different based on external factors. If you want to check
 for that sort of thing, then that should be in something like
 "has_shortlink" or something.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/14760#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list