Opened 7 years ago
Closed 7 years ago
#45596 closed defect (bug) (fixed)
Argument type mismatch
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.2 | Priority: | low |
| Severity: | normal | Version: | 5.0 |
| Component: | Users | Keywords: | has-patch |
| Focuses: | docs, template | Cc: |
Description
File: wp-includes/author-template-patch.php
Doc blocks of the following functions have incorrect argument type declarations.
the_author( $deprecated = '', $deprecated_echo = true ) { ... }
get_the_author_meta( $field = '', $user_id = false ) { ... }
the_author_meta( $field = '', $user_id = false ) { ... }
Please review attached proposed patch.
Attachments (1)
Change History (7)
#1
follow-up:
↓ 2
@
7 years ago
- Focuses coding-standards removed
- Priority changed from normal to low
#2
in reply to:
↑ 1
@
7 years ago
Thank you for explaining :) Please let me know whether I shall modify the patch or close the ticket.
Replying to swissspidy:
We don't usually add things like
string|boolin these cases, because it indicates that one could passtrueas well.
Instead, the default value of
falsemeans "use current user by default".
So, if anything, I'd change the description to
Optional. User ID. Defaults to the current author.or perhaps change the type tostring|falseto be explicit, or both.
#3
@
7 years ago
It's possible to document it as string|false. http://docs.phpdoc.org/references/phpdoc/types.html.
We don't usually add things like
string|boolin these cases, because it indicates that one could passtrueas well.Instead, the default value of
falsemeans "use current user by default".