[wp-trac] [WordPress Trac] #40891: map_meta_cap() causing PHP notice on term meta permissions

WordPress Trac noreply at wordpress.org
Sat Jul 1 14:04:48 UTC 2017


#40891: map_meta_cap() causing PHP notice on term meta permissions
------------------------------------------------------+------------------
 Reporter:  caercam                                   |       Owner:
     Type:  defect (bug)                              |      Status:  new
 Priority:  normal                                    |   Milestone:  4.9
Component:  Role/Capability                           |     Version:  4.7
 Severity:  normal                                    |  Resolution:
 Keywords:  has-patch needs-refresh needs-unit-tests  |     Focuses:
------------------------------------------------------+------------------
Changes (by boonebgorges):

 * keywords:  has-patch => has-patch needs-refresh needs-unit-tests
 * milestone:  Awaiting Review => 4.9


Comment:

 Thanks for the ticket and for the patch, @caercam !

 `isset( $term->taxonomy )` feels like a roundabout way of checking whether
 we actually have a term. Maybe better to check this more directly: `$term
 instanceof WP_Term`. What do you think?

 Are you able to write a unit test that demonstrates the error, so we can
 avoid future regressions?

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


More information about the wp-trac mailing list