Make WordPress Core

Opened 4 months ago

Closed 6 weeks ago

Last modified 6 weeks ago

#65132 closed defect (bug) (fixed)

Incorrect `@since` annotation for `wp_get_user_request()`

Reported by: swissspidy Owned by: swissspidy
Priority: low Milestone: 7.1
Component: Privacy Version:
Severity: trivial Keywords: good-first-bug has-patch
Cc: Focuses: docs

Description

wp_get_user_request_data() was renamed to wp_get_user_request() in [47245] in WP 5.4.0, and the former deprecated. However, the docblock for wp_get_user_request() wasn't updated and wrongly indicates it was introduced in 4.9.6, when it was actually 5.4.0

Change History (11)

This ticket was mentioned in PR #11653 on WordPress/wordpress-develop by @lakshyajeet.


4 months ago
#1

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/65132

This PR corrects the @since annotation for wp_get_user_request() in src/wp-includes/user.php, updating it from 4.9.6 to 5.4.0.

The function wp_get_user_request_data() was renamed to wp_get_user_request() in WordPress 5.4.0 (changeset 47245), and the original function was deprecated. However, the docblock for wp_get_user_request() was not updated at the time and incorrectly stated that it was introduced in version 4.9.6.

### Use of AI Tools

AI assistance: Yes
Model(s): Gemini 3.1 Pro
Used for: Drafting this PR description.

#2 @gaurangsondagar
4 months ago

Patch Report Testing

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11653/commits/23f367fb7cac4861204b7eaf57190e12250e25d7

Environment:

  • PHP: 8.2.29
  • WordPress: 7.0-RC2-62242
  • Web server: Apache
  • Database: MySQL
  • Browser: Chrome
  • OS: Ubuntu 22.04.5 LTS

Result:
This Patch corrects the @since annotation for wp_get_user_request() in src/wp-includes/user.php, updating it from 4.9.6 to 5.4.0.

Screenshot for reference:
https://snipboard.io/dR1uBN.jpg

#3 @nikunj8866
4 months ago

  • Keywords changes-requested added

I've reviewed the PR and left some feedback. Please take a look.

#4 @nikunj8866
4 months ago

  • Keywords changes-requested removed

This ticket was mentioned in PR #11742 on WordPress/wordpress-develop by crmv1.


3 months ago
#5

Adds the missing @since 5.4.0 description to the wp_get_user_request() DocBlock, noting that the function was renamed from wp_get_user_request_data().

#6 @masteradhoc
3 months ago

Looks good to me. I'd prefer merging https://github.com/WordPress/wordpress-develop/pull/11653 as this PR was done first. @swissspidy can you check and approve this small change?

@masteradhoc commented on PR #11653:


6 weeks ago
#7

Thanks for the PR @DarkMatter-999. I've pinged @westonruter to see if he has a chance to take a look and get this merged.

#8 @masteradhoc
6 weeks ago

  • Milestone Future Release7.1

@swissspidy commented on PR #11742:


6 weeks ago
#9

Thanks for your PR but there's already an earlier identical PR #11653.

#10 @swissspidy
6 weeks ago

  • Owner set to swissspidy
  • Resolutionfixed
  • Status newclosed

In 62653:

Docs: Update since tag for wp_get_user_request().

This function was renamed to wp_get_user_request() in r47245 in WP 5.4.0, and the former deprecated. However, the docblock for wp_get_user_request() wasn't updated and wrongly indicates it was introduced in 4.9.6, when it was actually 5.4.0.

Props lakshyajeet, nikunj8866, apermo, masteradhoc, crmv1.
Fixes #65132.

#11 @swissspidy
6 weeks ago

In 62654:

Docs: Replace @since tag for wp_get_user_request() instead of amending it.

Follow-up to r62653.

See #65132.

Note: See TracTickets for help on using tickets.