Opened 14 years ago
Closed 9 years ago
#12721 closed enhancement (wontfix)
Allow post_type's _edit_link to be outside of the admin.
Reported by: | prettyboymp | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch close |
Focuses: | Cc: |
Description
get_edit_post_link runs the post_type's _edit_link through admin_url() always forcing the edit page to be within wp-admin. There are times where this isn't desired. I'm submitting a patch to check that the url of the _edit_link doesn't begin with http(s?): before running it through admin_url
Attachments (1)
Change History (14)
#4
@
14 years ago
I've built several sites that allow user generated content, but don't allow normal users into the admin area. For those it would be nice not to have to filter the edit post link when I'm already setting up an _edit_link for the post_type.
#5
@
14 years ago
I don't think you should mix the backend links with ones meant to enable frontend editing.
#6
@
14 years ago
What says the edit link is strict to backend? It is a link to where the content should be edited and in my case, I want it to be on a front end page. I don't understand your issue with this ticket.
#8
@
14 years ago
The attached patch requires that the _edit_link be set to the absolute URL. IMO, thats not going to be a flexible method.
There is nothing preventing you from filtering the link, Which is exactly what i do, Filtering the link allows for a much higher flexibility of the link created.
I for example, am using /wordpress/<post-name-here>/edit/<edit_revision_here>/ to handle my post edits, that would be next to impossible with the proposed solution as it can only insert the ID, I'd still have to filter it.
If the default admin link isnt powerful enough, filter it, there is no way you can create a complex link using that function for every use-case, so to me, it doesnt make sense here.
#9
@
14 years ago
- Keywords commit removed
The absolute path is based off of the assumption that you would use site_url() to create the link when you pass it into the register_post_type method, so it is no less flexible than the current handling which is based on the path of wp-admin.
After some thought, to cut down on the slight performance hit of the regex running for each get_edit_post_link, I think the patch should be changed to add the admin_url or keep the absolute url during post_type registration instead. I'll submit a patch as soon as I know the entire ticket isn't getting shot down first.
Confirmed this is working against r13818. Edit post links in the admin still work and calling get_edit_post_link() from a theme file works.