commit 16679e3906b47387e2a894d447afea899a225bea
Author: Daniele Scasciafratte <mte90net@gmail.com>
Date: Thu Aug 22 17:50:54 2019 +0200
30991.4
diff --git src/wp-includes/post.php src/wp-includes/post.php
index 98ad57fbd0..fbc7139d2b 100644
|
|
function unregister_post_type( $post_type ) { |
1355 | 1355 | * Otherwise, an 's' will be added to the value for the plural form. After |
1356 | 1356 | * registration, capability_type will always be a string of the singular value. |
1357 | 1357 | * |
1358 | | * By default, seven keys are accepted as part of the capabilities array: |
| 1358 | * By default, eight keys are accepted as part of the capabilities array: |
1359 | 1359 | * |
1360 | 1360 | * - edit_post, read_post, and delete_post are meta capabilities, which are then |
1361 | 1361 | * generally mapped to corresponding primitive capabilities depending on the |
… |
… |
function unregister_post_type( $post_type ) { |
1367 | 1367 | * - edit_others_posts - Controls whether objects of this type owned by other users |
1368 | 1368 | * can be edited. If the post type does not support an author, then this will |
1369 | 1369 | * behave like edit_posts. |
| 1370 | * - delete_posts - Controls whether objects of this post type can be deleted. |
1370 | 1371 | * - publish_posts - Controls publishing objects of this post type. |
1371 | 1372 | * - read_private_posts - Controls whether private objects can be read. |
1372 | 1373 | * |
1373 | 1374 | * These four primitive capabilities are checked in core in various locations. |
1374 | | * There are also seven other primitive capabilities which are not referenced |
| 1375 | * There are also six other primitive capabilities which are not referenced |
1375 | 1376 | * directly in core, except in map_meta_cap(), which takes the three aforementioned |
1376 | 1377 | * meta capabilities and translates them into one or more primitive capabilities |
1377 | 1378 | * that must then be checked against the user or role, depending on the context. |
1378 | 1379 | * |
1379 | 1380 | * - read - Controls whether objects of this post type can be read. |
1380 | | * - delete_posts - Controls whether objects of this post type can be deleted. |
1381 | 1381 | * - delete_private_posts - Controls whether private objects can be deleted. |
1382 | 1382 | * - delete_published_posts - Controls whether published objects can be deleted. |
1383 | 1383 | * - delete_others_posts - Controls whether objects owned by other users can be |
… |
… |
function get_post_type_capabilities( $args ) { |
1411 | 1411 | 'edit_post' => 'edit_' . $singular_base, |
1412 | 1412 | 'read_post' => 'read_' . $singular_base, |
1413 | 1413 | 'delete_post' => 'delete_' . $singular_base, |
| 1414 | 'delete_posts' => 'delete_' . $plural_base, |
1414 | 1415 | // Primitive capabilities used outside of map_meta_cap(): |
1415 | 1416 | 'edit_posts' => 'edit_' . $plural_base, |
1416 | 1417 | 'edit_others_posts' => 'edit_others_' . $plural_base, |
… |
… |
function get_post_type_capabilities( $args ) { |
1422 | 1423 | if ( $args->map_meta_cap ) { |
1423 | 1424 | $default_capabilities_for_mapping = array( |
1424 | 1425 | 'read' => 'read', |
1425 | | 'delete_posts' => 'delete_' . $plural_base, |
1426 | 1426 | 'delete_private_posts' => 'delete_private_' . $plural_base, |
1427 | 1427 | 'delete_published_posts' => 'delete_published_' . $plural_base, |
1428 | 1428 | 'delete_others_posts' => 'delete_others_' . $plural_base, |