내 플러그인에 맞춤 게시 유형 ('재생 목록')을 등록했습니다. 역할과 기능에 대해 많이 읽었지만 완전히 이해하기가 어렵습니다. 역할을 통해 게시 유형에 대한 CLONE 기능을 사용하고 싶습니다. 내 경우에는 (역할별로) "게시"에서 기능을 가져와 내 사용자 정의 게시 유형 ("재생 목록")에 할당하려면게시 유형에 대한 역할 기능 복제
다음과 같이 "capability_type"을 사용하고 싶지 않습니다. 내 "재생 목록"게시물 유형에 대한 "게시"기능을 사용하려면 각 역할에 대해 동일한 기본값을 사용하여 자체 기능을 갖길 원합니다. "
function register_post_type() {
$args = array(
...
'capability_type' => 'playlist',
'map_meta_cap' => true,
'capabilities' => array(
'edit_post' => 'edit_playlist',
'read_post' => 'read_playlist',
'delete_post' => 'delete_playlist',
'create_posts' => 'create_playlists',
'edit_posts' => 'edit_playlists',
'edit_others_posts' => 'manage_playlists',
'publish_posts' => 'manage_playlists',
'read_private_posts' => 'read',
'read' => 'read',
'delete_posts' => 'manage_playlists',
'delete_private_posts' => 'manage_playlists',
'delete_published_posts' => 'manage_playlists',
'delete_others_posts' => 'manage_playlists',
'edit_private_posts' => 'edit_playlists',
'edit_published_posts' => 'edit_playlists'
),
...
);
register_post_type('playlist', $args);
)
그러나 그 후 나는"포스트 "기능에 따라, 각 역할에 이러한 기능을 할당하는 기능을 실행해야합니다 :
function register_post_type() {
$args = array(
...
'capability_type' => 'post', //I think I don't need this
...
);
register_post_type('playlist', $args);
)
그래서 나는 더 그런 일을해야 할 것 같아요 . 무슨 뜻인지보기?
당신은 내가 이것을 달성 할 수있는 방법에 대한 아이디어가 있습니까?
감사합니다!
추신 : 유용한 링크 : http://justintadlock.com/archives/2013/09/13/register-post-type-cheat-sheet