Opened 4 years ago
Closed 4 years ago
#55799 closed enhancement (fixed)
Exclude PHP polyfill functions from code reference.
| Reported by: | dd32 | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 6.1 |
| Component: | General | Version: | |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: | docs |
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
@
4 years ago
- Milestone Awaiting Review → 6.1
55799.diff look good to skipped when parsing.
Moving this ticket to the milestone for visibility.
#3
in reply to: ↑ 1
@
4 years ago
- Resolution → fixed
- Status new → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It did occur to me that we could probably just also exclude
_()and ignore the entire file in the developer docs parser instead.