Make WordPress Core

Opened 2 years ago

Closed 3 weeks ago

#26284 closed enhancement (fixed)

Stop get_page_uri requiring a page ID

Reported by: pollett Owned by: chriscct7
Milestone: 4.6 Priority: normal
Severity: trivial Version: 3.7
Component: Posts, Post Types Keywords: has-patch has-unit-tests
Focuses: template Cc:


Currently get_page_uri has to be passed a page id which is passed to get_post.

get_post is happy to work on the current page without requiring an id to be specified, removing this requirement.

Attachments (3)

getpageuri.diff (558 bytes) - added by pollett 2 years ago.
26284.diff (1.5 KB) - added by ericlewis 4 weeks ago.
26284.2.diff (1.4 KB) - added by ericlewis 4 weeks ago.

Download all attachments as: .zip

Change History (9)

2 years ago

#1 @SergeyBiryukov
2 years ago

  • Version changed from trunk to 3.7

#2 @nacin
2 years ago

  • Component changed from General to Post Types

#3 @ericlewis
2 years ago

  • Focuses template added


#4 @chriscct7
8 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to chriscct7
  • Status changed from new to assigned

4 weeks ago

4 weeks ago

#5 @ericlewis
4 weeks ago

  • Keywords has-unit-tests added
  • Milestone changed from Future Release to 4.6

#6 @ericlewis
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 37345:

Posts: Allow get_page_uri() to be called without a $page argument.

get_page_uri() can now be called without an argument, which will return the page URI for the current post in the loop.

Props pollett.
Fixes #26284.

Note: See TracTickets for help on using tickets.