_post_type_meta_capabilities()
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.
Returns
null. Nothing (null).
Usage
_post_type_meta_capabilities( $capabilities );
- $capabilities(string[])
- Post type meta capabilities.
Default:null
Notes
- Global. Array.
$post_type_meta_capsUsed to store meta capabilities.
Changelog
| Since 3.1.0 | Introduced. |
_post_type_meta_capabilities() post type meta capabilities code WP 7.0
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;
}
}
}