Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#63900 new defect (bug)

Improve PHPDoc for wp_parse_id_list() in functions.php

Reported by: prab18hat's profile prab18hat Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: needs-docs has-patch has-unit-tests
Focuses: Cc:

Description

The inline documentation for the wp_parse_id_list() function in functions.php has been updated for clarity and to better align with WordPress coding standards.

Expanded the PHPDoc to specify accepted parameter types (int|string|array) and the return value (int[] array of unique, positive integers).
This change helps developers and contributors understand the function’s usage and output, improving code maintainability and IDE support.
No code logic was changed—only documentation was improved.

Change History (2)

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


5 months ago
#1

  • Keywords has-patch has-unit-tests added

This pull request improves the inline documentation for the wp_parse_id_list() function in [functions.php]

Expanded the PHPDoc block to clearly specify accepted parameter types (int|string|array) and the return value (int[] array of unique, positive integers).
The updated documentation follows WordPress coding standards and helps developers better understand the function’s usage and output.
No code logic was changed—only the documentation was enhanced for clarity and maintainability.

https://core.trac.wordpress.org/ticket/63900

#2 @SergeyBiryukov
5 months ago

Hi there, welcome back to WordPress Trac! Thanks for the PR.

Expanded the PHPDoc to specify accepted parameter types (int|string|array)

The purpose of this change is not quite clear to me, as wp_parse_id_list() is not supposed to accept an int value. It accepts an array, comma- or space-separated list of IDs:

  • array( 1, 2, 3 )
  • '1, 2, 3'
  • '1 2 3'

so the existing @param tag of array|string looks correct to me.

Note: See TracTickets for help on using tickets.