首页 WordPress函数大全 get_post_type_capabilities()

get_post_type_capabilities()

2020-05-01 / 5164阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_post_type_capabilities( object $args )

Build an object with all post type capabilities out of a post type object

描述

Post type capabilities use the ‘capability_type’ argument as a base, if the capability is not set in the ‘capabilities’ argument array or if the ‘capabilities’ argument is not supplied.

The capability_type argument can optionally be registered as an array, with the first value being singular and the second plural, e.g. array(‘story, ‘stories’) Otherwise, an ‘s’ will be added to the value for the plural form. After registration, capability_type will always be a string of the singular value.

By default, eight keys are accepted as part of the capabilities array:

  • edit_post, read_post, and delete_post are meta capabilities, which are then generally mapped to corresponding primitive capabilities depending>map_meta_cap(), which takes the three aforementioned meta capabilities and translates them into>map_meta_cap(). Thus, they are id="see-also" tabindex="-1">See also See also

    • register_post_type()
    • map_meta_cap()

Top ↑

参数

$args

(object)
(Required)
Post type registration arguments.

返回

(object) Object with all the capabilities as member variables.

大家谈论
    我的见解