时间:2024-03-10
WordPress函数get_post_type_capabilities用于快速生成文章类型角色权限。
get_post_type_capabilities( object $args )
$args
对象
参考register_post_type()函数的参数说明,必须的参数:capability_type、capabilities、map_meta_cap
stdClass Object ( [edit_post] => edit_post [read_post] => read_post [delete_post] => delete_post [edit_posts] => edit_posts [edit_others_posts] => edit_others_posts [delete_posts] => delete_posts [publish_posts] => publish_posts [read_private_posts] => read_private_posts [create_posts] => edit_posts )
$args = array( 'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => false ); print_r(get_post_type_capabilities((object) $args));
get_post_type_capabilities()函数位于:wp-includes/post.php
相关函数:
register_post_type()
map_meta_cap()
Copyright © 2019-2024 jsp.hk