WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 5 months ago

Last modified 5 months ago

#48354 closed enhancement (fixed)

Stricter docs for is_page() and WP_Query::is_page()

Reported by: marekdedic Owned by: SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: minor Version: 5.2
Component: Query Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

Both could have the $page parameter narrowed from int|string|array to int|string|int[]|string[].

Attachments (2)

Stricter_docs_for_WP_Query__is_page().patch (702 bytes) - added by shaharia.azam 10 months ago.
Stricter docs for WP_Query::is_page()
48354.diff (612 bytes) - added by shaampk1 9 months ago.

Download all attachments as: .zip

Change History (14)

#1 @johnbillion
10 months ago

  • Keywords needs-patch good-first-bug added

#2 @desrosj
10 months ago

  • Milestone changed from Awaiting Review to 5.4

#3 @SergeyBiryukov
10 months ago

  • Component changed from General to Query

@shaharia.azam
10 months ago

Stricter docs for WP_Query::is_page()

#4 @shaampk1
9 months ago

  • Keywords has-patch added; needs-patch removed

@shaampk1
9 months ago

#5 follow-up: @SergeyBiryukov
6 months ago

Just noting the same should also be done for these functions:

  • is_post_type_archive()
  • is_attachment()
  • is_author()
  • is_category()
  • is_tag()
  • is_tax()
  • is_single()
  • is_singular()

and their WP_Query counterpart methods.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


6 months ago

#7 @davidbaumwald
6 months ago

  • Milestone changed from 5.4 to Future Release

With 5.4 Beta 1 approaching and this ticket needing more work, this is being moved to Future Release. If any maintainer or committer feels this can be resolved in time, or wishes to assume ownership during a specific cycle, feel free to update the milestone.

#8 @SergeyBiryukov
5 months ago

  • Milestone changed from Future Release to 5.5
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#9 in reply to: ↑ 5 @SergeyBiryukov
5 months ago

Replying to SergeyBiryukov:

Just noting the same should also be done for these functions

is_author(), is_category(), is_tag(), is_tax() were addressed in [47397].

#10 @SergeyBiryukov
5 months ago

In 47401:

Docs: Synchronize parameter descriptions for conditional tags with their WP_Query counterpart methods.

See #48354, #48303.

#11 @SergeyBiryukov
5 months ago

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

In 47402:

Docs: Use more specific type in parameter descriptions for is_page(), is_single(), is_singular(), and their WP_Query counterpart methods.

Props marekdedic, shaharia.azam, shaampk1.
Fixes #48354. See #48303.

#12 @SergeyBiryukov
5 months ago

  • Milestone changed from 5.5 to 5.4
Note: See TracTickets for help on using tickets.