_post_type_meta_capabilities()WP 3.1.0

Stores or returns a list of post type meta caps for map_meta_cap().

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

null. Nothing (null).

Usage

_post_type_meta_capabilities( $capabilities );
$capabilities(string[])
Post type meta capabilities.
Default: null

Notes

  • Global. Array. $post_type_meta_caps Used to store meta capabilities.

Changelog

Since 3.1.0 Introduced.

_post_type_meta_capabilities() code WP 6.5.2

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;
		}
	}
}