[wp-trac] [WordPress Trac] #44591: PHP notice if optional argument isn't passed to map_meta_cap()
WordPress Trac
noreply at wordpress.org
Sat Feb 19 07:50:36 UTC 2022
#44591: PHP notice if optional argument isn't passed to map_meta_cap()
----------------------------------------+-----------------------------
Reporter: henry.wright | Owner: SergeyBiryukov
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 6.0
Component: Users | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Comment (by azouamauriac):
Replying to [comment:9 henry.wright]:
> I disagree with `_doing_it_wrong`. My reasoning is the argument is
**optional**. Optional indicates the function should be callable without
passing a third argument
>
You're right, but, **Optional** doesn't not mean ~~always~~. So it's the
responsibility of developer who is calling the function to know in which
context, he is, and do things accordingly. I think doing_it_wrong is
accurate.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44591#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list