简体   繁体   中英

WordPress Plugin Permissions

I'm currently writing a WordPress plugin and I am having trouble getting the permissions to work correctly

    function submitPageActions(){
    add_posts_page('Page Submission', 'Page Submission', 1, 'Page Submission', 'submitpage_form');
    }

I am using that to add a button to the post menu, and I would like it to be acessable for Contributor and above. But, even when logged in with the Admin account I get

"You do not have sufficient permissions to access this page."

the usage is add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function); where $capability is a string. For a full reference have a look at the Capabilities Codex page but 'publish_posts' is probably what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM