[wp-trac] [WordPress Trac] #27137: Remove required user context from `get_edit_post_link()`

WordPress Trac noreply at wordpress.org
Thu Jul 10 02:14:40 UTC 2014


#27137: Remove required user context from `get_edit_post_link()`
-------------------------------------------------+-------------------------
 Reporter:  danielbachhuber                      |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  low                                  |   Milestone:  4.0
Component:  Posts, Post Types                    |     Version:
 Severity:  minor                                |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:  template
  feedback close                                 |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:3 knutsp]:
 > Unless the capabilities check is moved over to `edit_post_link()` this
 change will pollute sites with unnecessary Edit links, even for anonymous
 users.

 With [attachment:27137.2.diff], the same would happen on sites using
 `get_edit_post_link()` directly.

 Here's what the
 [http://codex.wordpress.org/Template_Tags/get_edit_post_link Codex says]:

  Returns edit post url as string value, provided the current user has the
 `'edit_post'` capability. To retrieve a URL without checking user
 capabilities use `admin_url()` instead.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27137#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list