Opened 3 years ago
Closed 3 years ago
#55799 closed enhancement (fixed)
Exclude PHP polyfill functions from code reference.
Reported by: | dd32 | Owned by: | |
---|---|---|---|
Milestone: | 6.1 | Priority: | low |
Severity: | minor | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
wp-includes/compat.php
contains a number of PHP functions which may be 'missing' from installations, due to either being introduced in a later PHP version or being dependant upon extensions.
The following functions are @ignore
'd which prevents them showing up on https://developer.wordpress.org/reference/files/wp-includes/compat.php/
mb_substr()
mb_strlen()
hash_hmac()
- prefixed private variants of those functions
The following functions have compat methods defined, but do not include @ignore
and appear on the above page as a result:
hash_equals()
is_countable()
is_iterable()
array_key_first()
array_key_last()
str_contains()
str_starts_with()
str_ends_with()
_()
(single underscore, used by some external libraries)
Aside from the last one, _()
, I don't see any reason for these to be included in the WordPress documentation reference.
These functions were added in WordPress 3.9.2, 4.9.6, and 5.9.0.
Attachments (1)
Change History (4)
#2
@
3 years ago
- Milestone changed from Awaiting Review to 6.1
55799.diff look good to skipped when parsing.
Moving this ticket to the milestone for visibility.
#3
in reply to:
↑ 1
@
3 years ago
- Resolution set to fixed
- Status changed from new to closed
Replying to dd32:
It did occur to me that we could probably just also exclude
_()
and ignore the entire file in the developer docs parser instead.
Makes sense to me, I went that route in [meta11956].
After deleting the previously imported entries and re-running the parser, these polyfill functions no longer show up in the Code Reference.
It did occur to me that we could probably just also exclude
_()
and ignore the entire file in the developer docs parser instead.