Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_post_type_meta_capabilities() WordPress Function

The WordPress function _post_type_meta_capabilities() allows a plugin to map meta capabilities to primitive capabilities for a post type. This is useful for customizing the capabilities required to edit and delete a post type.

_post_type_meta_capabilities( string[] $capabilities = null ) #

Store or return a list of post type meta caps for map_meta_cap().


Parameters

$capabilities

(string[])(Optional)Post type meta capabilities.

Default value: null


Top ↑

Source

File: wp-includes/post.php

function _post_type_meta_capabilities( $capabilities = null ) {
	global $post_type_meta_caps;

	foreach ( $capabilities as $core => $custom ) {
		if ( in_array( $core, array( 'read_post', 'delete_post', 'edit_post' ), true ) ) {
			$post_type_meta_caps[ $custom ] = $core;
		}
	}
}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More