[wp-trac] [WordPress Trac] #44455: PHP Doc for non-existing argument + Argument type mismatch

WordPress Trac noreply at wordpress.org
Mon Jun 25 14:13:59 UTC 2018


#44455: PHP Doc for non-existing argument + Argument type mismatch
------------------------------+-------------------------------------
 Reporter:  subrataemfluence  |       Owner:  (none)
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:
Component:  Users             |     Version:  trunk
 Severity:  normal            |  Resolution:  invalid
 Keywords:  close             |     Focuses:  docs, coding-standards
------------------------------+-------------------------------------
Changes (by swissspidy):

 * keywords:  needs-patch => close
 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Attention! `map_meta_cap()` and `current_user_can()` ''do'' have this
 second parameter. For various reasons, these aren't in the function
 signature but instead accessed via `func_get_args()`

 Regarding the `is_super_admin()` change: your change would indicate that
 one can pass `true` or `false` to the function and expect it to work.
 However, that is not the case. Think of it as `$user_id = null`, where
 `null` (or in this case, `false`) is the default value. If we were to
 change this, it should be discussed & decided in the docs team first, and
 standardized in https://make.wordpress.org/core/handbook/best-practices
 /inline-documentation-standards/php/. However, personally I'd rather
 change it to `$user_id = null` instead of adjusting the docs. But for BC
 reasons that's probably not possible in every case.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44455#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list