Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#26284 closed enhancement (fixed)

Stop get_page_uri requiring a page ID

Reported by: pollett's profile pollett Owned by: chriscct7's profile 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 10 years ago.
26284.diff (1.5 KB) - added by ericlewis 8 years ago.
26284.2.diff (1.4 KB) - added by ericlewis 8 years ago.

Download all attachments as: .zip

Change History (11)

@pollett
10 years ago

#1 @SergeyBiryukov
10 years ago

  • Version changed from trunk to 3.7

#2 @nacin
10 years ago

  • Component changed from General to Post Types

#3 @ericlewis
10 years ago

  • Focuses template added

Totally.

#4 @chriscct7
8 years ago

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

@ericlewis
8 years ago

@ericlewis
8 years ago

#5 @ericlewis
8 years ago

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

#6 @ericlewis
8 years 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
8 years ago

In 38143:

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

See #26284.

#8 @SergeyBiryukov
8 years 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.