mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 06:05:42 +00:00
Post Types: Introduce unregister_post_type().
This new function can be used to completely unregister non built-in post types. Fixes #14761. git-svn-id: https://develop.svn.wordpress.org/trunk@36316 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @global array $post_type_meta_caps Used to get post type meta capabilities.
|
||||
*
|
||||
* @param string $cap Capability name.
|
||||
* @param int $user_id User ID.
|
||||
* @param int $object_id Optional. ID of the specific object to check against if `$cap` is a "meta" cap.
|
||||
@@ -377,7 +379,7 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
default:
|
||||
// Handle meta capabilities for custom post types.
|
||||
$post_type_meta_caps = _post_type_meta_capabilities();
|
||||
global $post_type_meta_caps;
|
||||
if ( isset( $post_type_meta_caps[ $cap ] ) ) {
|
||||
$args = array_merge( array( $post_type_meta_caps[ $cap ], $user_id ), $args );
|
||||
return call_user_func_array( 'map_meta_cap', $args );
|
||||
|
||||
Reference in New Issue
Block a user