WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#21298 closed defect (bug) (invalid)

get_page_by_path() returns trashed pages

Reported by: scribu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description (last modified by scribu)

This causes weird bugs: if you go to http://example.com/trashed-page/

  • if you're an admin, you'll see the page as if it was published
  • if you're not, you get a 404

Change History (3)

comment:1 @scribu3 years ago

  • Description modified (diff)

comment:2 @SergeyBiryukov3 years ago

Hmm, get_page_by_path() indeed returns trashed pages, but I could not reproduce seeing the page as if it was published due to the check in get_posts():
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/query.php#L2674

comment:3 @scribu3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Yeah, you're right. I guess something else was going on.

Note: See TracTickets for help on using tickets.