Opened 3 years ago
Last modified 21 months ago
#14760 new enhancement
wp_get_shortlink not working on pages
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | General | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | steph@…, lew@…, navjotjsingh@… |
Description
wp_get_shortlink doesn't return anything on pages.
reason:
2196 if ( isset($post->post_type) && 'post' == $post->post_type )
2197 $shortlink = home_url('?p=' . $post->ID);
Attachments (3)
Change History (11)
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Type changed from feature request to enhancement
- Cc steph@… added
- Keywords has-patch needs-testing added; needs-patch removed
- Version set to 3.0
Updated patch removes some cruft and makes sure shortlinks are generated only for public post types.
- Cc lew@… added
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.
Thoughts?
comment:6
navjotjsingh — 22 months ago
- Cc navjotjsingh@… added
Note: See
TracTickets for help on using
tickets.

Doesn't work on custom post types either.