[wp-trac] [WordPress Trac] #22247: Ensure post ID evaluates to true before adding "Edit post" tab in admin bar

WordPress Trac noreply at wordpress.org
Tue Aug 23 14:17:03 UTC 2016


#22247: Ensure post ID evaluates to true before adding "Edit post" tab in admin bar
-------------------------------------------------+-------------------------
 Reporter:  Joe Anzalone                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Toolbar                              |  Review
 Severity:  normal                               |     Version:  3.1
 Keywords:  has-patch dev-feedback has-unit-     |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------
Changes (by akibjorklund):

 * keywords:  has-patch dev-feedback needs-unit-tests => has-patch dev-
     feedback has-unit-tests


Comment:

 Not sure what the reported issue actually is, but if I understand
 correctly, the ticket is about an edit link appearing when there should be
 none. If this is true, it does not seem to be an issue anymore.
 `get_edit_post_link` will fetch the post using `get_post` and will not
 return a valid link if the post is not found. I've attached a patch that
 contains unit tests to prove this.

 While the issue itself has probably been fixed within some other ticket
 and the original patch is unnecessary, the unit tests I created could
 still be committed.

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


More information about the wp-trac mailing list