Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #49478, comment 3


Ignore:
Timestamp:
02/01/2026 06:09:18 AM (7 months ago)
Author:
huzaifaalmesbah

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #49478, comment 3

    initial v1  
    1 Tested on before patch and with [attachment:"49748.diff"] WordPress 7.0-alpha-61215-src.
    2 `get_post_type_object()` returns an object for valid string inputs and null for all non-string values, so the issue is not reproducible functionally.
     1Tested both before patch and with [attachment:"49748.diff"] on WordPress 7.0-alpha-61215-src.
    32
    4 The behavior is already safe, but the validator still uses `is_scalar()` while the docblock specifies a string. Using `is_string()` would better match the documented contract and improve clarity/type safety.
     3In both cases, `get_post_type_object()` returns an object for valid string inputs and null for all non-string values, so the issue is not reproducible functionally.
    54
    6 Removing `needs-testing` and adding `dev-feedback` since this appears to be a minor code quality improvement and may need maintainer input.
     5Before the patch the validator uses `is_scalar()`, and after the patch it uses `is_string()`. While the current behavior is already safe due to the array lookup, `is_string()` better matches the documented parameter type and improves clarity/type safety.
     6
     7Removing `needs-testing` and adding `dev-feedback`, as this appears to be a minor code quality improvement that may need maintainer input.