WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 months ago

Last modified 40 hours 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:

Description

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 3 years ago.
26284.diff (1.5 KB) - added by ericlewis 3 months ago.
26284.2.diff (1.4 KB) - added by ericlewis 3 months ago.

Download all attachments as: .zip

Change History (11)

@pollett
3 years ago

#1 @SergeyBiryukov
3 years ago

  • Version changed from trunk to 3.7

#2 @nacin
3 years ago

  • Component changed from General to Post Types

#3 @ericlewis
2 years ago

  • Focuses template added

Totally.

#4 @chriscct7
10 months ago

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

@ericlewis
3 months ago

@ericlewis
3 months ago

#5 @ericlewis
3 months ago

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

#6 @ericlewis
3 months 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.

#7 @SergeyBiryukov
40 hours ago

In 38143:

Unit Tests: Move get_page_uri() tests to post/getPageUri.php, added in [37345].

See #26284.

#8 @SergeyBiryukov
40 hours ago

In 38144:

Unit Tests: Add a @ticket reference for test_get_page_uri_without_argument().

See #26284.

Note: See TracTickets for help on using tickets.