• Previously we had removed the ability for Authors (and below) to create new posts as that was controlled by the editorial team at our publication. We did this using a custom function in our functions.php. They retained the ability to edit posts.

    This week we removed the custom function and replaced it with this plugin, User Role Editor, and have now (using the plugin) given Authors (but not contributors or below) the ability to ‘create posts’.

    However, it’s not working.

    When an Author clicks on “Add New” they get the “you do not have sufficient permissions….” error message.

    Is it possible that WP has retained the older instruction and is ignoring URE’s new settings? If so how do we fix this?

    I viewed the options for users in our database using phpMyAdmin and it looks correct for Authors – here is what it has:

    s:6:”author”;a:2:{s:4:”name”;s:6:”Author”;s:12:”capabilities”;a:14:{s:12:”create_posts”;b:1;s:10:”edit_pages”;b:1;s:23:”edit_post_subscriptions”;b:1;s:10:”edit_posts”;b:1;s:7:”level_0″;b:1;s:7:”level_1″;b:1;s:7:”level_2″;b:1;s:7:”level_3″;b:1;s:7:”level_4″;b:1;s:7:”level_5″;b:1;s:7:”level_6″;b:1;s:7:”level_7″;b:1;s:4:”read”;b:1;s:12:”upload_files”;b:1;}}

    What am I missing?

    https://wordpress.org/plugins/user-role-editor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Add this code to the functions.php:

    add_action('admin_head', 'debug_output');
    
    function debug_output() {
        $post_type = get_post_type_object('post');
        echo '<!--start debug---' . PHP_EOL;
        print_r($post_type->cap);
        echo '---stop debug-->' . PHP_EOL;
    }

    And look at the admin page HTML source code, if ‘post’ type really have ‘create_posts’ value for the $post_type->cap->create_posts property.

    Thread Starter TrishaM

    (@trisham)

    Hi @vladimir

    Many thanks for the quick reply and the suggestion – here is the result:

    <!–start debug—
    stdClass Object
    (
    [edit_post] => edit_post
    [read_post] => read_post
    [delete_post] => delete_post
    [edit_posts] => edit_posts
    [edit_others_posts] => edit_others_posts
    [publish_posts] => publish_posts
    [read_private_posts] => read_private_posts
    [read] => read
    [delete_posts] => delete_posts
    [delete_private_posts] => delete_private_posts
    [delete_published_posts] => delete_published_posts
    [delete_others_posts] => delete_others_posts
    [edit_private_posts] => edit_private_posts
    [edit_published_posts] => edit_published_posts
    [create_posts] => edit_posts
    )
    —stop debug–>

    I don’t know enough about the capabilities to know if this is all correct or not, does it need something like “[create_posts] => create_posts” to be added?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Author not able to create posts’ is closed to new replies.