[wp-trac] [WordPress Trac] #14760: wp_get_shortlink not working on pages
WordPress Trac
noreply at wordpress.org
Thu Aug 15 14:39:00 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 nacin):
Replying to [comment:5 layotte]:
> Updated patch to remove the permalink_structure check. If the user does
not have permalinks turned on, this function returns a blank string as the
shortlink. It should be permalink agnostic... so plugins/themes can use it
without worrying about permalink checks.
The reason why it returns a blank when the permalinks are off is because
it isn't a valid shortlink — it's the same length as the existing link.
I see the argument that plugins/themes should be able to use it without
checking the permalink structure (though really, if it returns nothing,
then just call get_permalink() as a fallback — this already must occur
since it was so limited to post type) — but the idea was to not show a
"Get Shortlink" button if we weren't actually showing something shorter.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14760#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list