[wp-trac] [WordPress Trac] #40891: map_meta_cap() causing PHP notice on term meta permissions
WordPress Trac
noreply at wordpress.org
Tue Jul 4 19:58:37 UTC 2017
#40891: map_meta_cap() causing PHP notice on term meta permissions
-------------------------------------+---------------------------
Reporter: caercam | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.9
Component: Role/Capability | Version: 4.7
Severity: normal | Resolution: fixed
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"40999"]:
{{{
#!CommitTicketReference repository="" revision="40999"
Avoid PHP notices when checking termmeta capabilities against a non-
existent term.
Previously, checks like `current_user_can( 'edit_term_meta', $term_id )`
returned the proper value, but generated a PHP notice due to the fact
that `get_term( $term_id )` could, in certain instances, return
`WP_Error` objects.
Props caercam.
Fixes #40891.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40891#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list