WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 7 months ago

#22247 new defect (bug)

Ensure post ID evaluates to true before adding "Edit post" tab in admin bar

Reported by: Joe Anzalone Owned by:
Priority: normal Milestone: Awaiting Review
Component: Toolbar Version: 3.1
Severity: normal Keywords: has-patch
Cc:

Description

This patch checks that a post has an ID set before adding an "Edit post" link in the admin bar on the front-end for individual post pages and static pages.

This can be helpful for plugins that choose to create a "fake" page that does not exist in the database, and set their ID to "0."

An example of such a fake page can be seen on my On The Fly YouTube Embeds plugin which borrows a lot of code from Scott Sherrill-Mix's blog post: Creating a (Better) Fake Post with a WordPress Plugin

Attachments (1)

22247.diff (617 bytes) - added by Joe Anzalone 8 months ago.

Download all attachments as: .zip

Change History (3)

Joe Anzalone8 months ago

comment:1 SergeyBiryukov8 months ago

  • Component changed from General to Toolbar

comment:2 SergeyBiryukov7 months ago

  • Version changed from trunk to 3.1
Note: See TracTickets for help on using tickets.