1

WordPress テーマを開発していますが、ユーザー用のプラグインを使用しないと、既存のカスタム ロールに新しいカスタム機能を追加できない理由がわかりません。

//Function for creating new custom capability


function map_custom_cap($roles = array()){

    foreach ( $roles as $role => $cap ) {

        $role->add_cap($cap);

    }
}

//This capabilities are not yet existing

        $reviewer_cap = array( 'read', 'edit_posts', 'delete_posts');

        $movie_author_cap = array( 'read_movie', 'edit_movies', 'delete_movies');

        $roles = array(
            'reviewer' => $reviewer_cap,
            'movie_author' => $movie_author_cap
        );

map_custom_cap($roles);
4

0 に答える 0