Changeset 40999
- Timestamp:
- 07/04/2017 07:58:35 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r40638 r40999 281 281 case 'term': 282 282 $term = get_term( $object_id ); 283 if ( ! $term ) {283 if ( ! $term instanceof WP_Term ) { 284 284 break; 285 285 } -
trunk/tests/phpunit/tests/user/capabilities.php
r40993 r40999 1355 1355 1356 1356 /** 1357 * @ticket 40891 1358 */ 1359 public function test_taxonomy_meta_capabilities_with_non_existent_terms() { 1360 $caps = array( 1361 'add_term_meta', 1362 'delete_term_meta', 1363 'edit_term_meta', 1364 ); 1365 1366 $taxonomy = 'wptests_tax'; 1367 register_taxonomy( $taxonomy, 'post' ); 1368 1369 $editor = self::$users['editor']; 1370 1371 foreach ( $caps as $cap ) { 1372 // `null` represents a non-existent term ID. 1373 $this->assertFalse( user_can( $editor->ID, $cap, null ) ); 1374 } 1375 } 1376 1377 /** 1357 1378 * @ticket 21786 1358 1379 */
Note: See TracChangeset
for help on using the changeset viewer.