0
votes

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."

1

1 Answers

1
votes

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.