• Resolved pugwonk

    (@pugwonk)


    Hey there – great plugin! I’m having some trouble getting the permissions right. Neither the “Edit” nor “Add post” buttons area appearing for subscribers (when I’d like them to!). “Delete” does, somewhat oddly.

    I think what’s making it complicated is the fact that these are custom post types. In the CPT declaration I specify:

    'map_meta_cap' 		 => true,
    		'capability_type' 	 => 'cleanup_group',
    		'capabilities' 		 => array(
    			'publish_posts' 	  => 'publish_cleanup_groups',
    			'edit_posts' 		  => 'edit_cleanup_groups',
    			'edit_others_posts'   => 'edit_others_cleanup_groups',
    			'delete_posts' 	   	  => 'delete_cleanup_groups',
    			'delete_others_posts' => 'delete_others_cleanup_groups',
    			'read_private_posts'  => 'read_private_cleanup_groups',
    			'edit_post' 		  => 'edit_cleanup_group',
    			'delete_post' 		  => 'delete_cleanup_group',
    			'read_post' 		  => 'read_cleanup_group',
    		)

    I’ve allocated capabilities to the subscriber so that they can add and edit this CPT (which I can verify in the WP backend) and I’ve given the Subscriber role Add/Edit permissions in your own capabilities editor. Is there anywhere obvious I ought to be looking next?

    https://www.ads-software.com/plugins/frontier-post/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author finnj

    (@finnj)

    Hi,

    You should check that the custom post type is checked in allowed post types, and that the user has frontier_post_can_add & frontier_post_can_edit capabilities.

    The custom post type needs to be in the shortcode

    Please see: https://wpfrontier.com/frontier-post-who-can-edit-a-post/

    And also read documentation on shortcode and capabilities.

    Last bu not least, have you tried with Author role ?

    Thread Starter pugwonk

    (@pugwonk)

    Hi there – thanks for getting back to me! I figured this out but thought I’d post here in case someone else has the same problem. The issue was that “Allow users to change status from Published” was not checked in my Frontier settings. I hadn’t realised that this was an implicit part of being able to edit a post.

    In case it helps anyone else, you can get the actual error message that Frontier is generating on failed edit by going directly to what the edit URL would be. You can find this by viewing the page as an administrator, copying the URL that the edit button goes to and then going directly there as the user you’re testing. For me this ended up at https://mysite/mypage?task=edit&postid=23681. I then got the error message “You are not allowed to edit post that is published” which set me off on the right track.

    Thread Starter pugwonk

    (@pugwonk)

    Actually I just noticed I think I do have a genuine bug here too. The “Create new post” button still doesn’t appear but if I go to the direct create URL I can create one fine. I did some further investigation… on line 28 of frontier_post_form_list_detail.php, you call:

    if (frontier_can_add() && !fp_get_option_bool(“fps_hide_add_on_list”))

    However, this actually checks the permissions for the default post type and not the post type you’re actually listing. I think what you need to do is:

    if (frontier_can_add($frontier_add_post_type) && !fp_get_option_bool(“fps_hide_add_on_list”))

    I know there are a couple of other template files with similar logic in them too. Hope this helps!

    Plugin Author finnj

    (@finnj)

    Hi,

    I will have a look at it

    One question: Are you allowing users to create a specific post type, and not posts with post_type == “post” ?

    Plugin Author finnj

    (@finnj)

    it is fixed in version 3.8.7.7 that you can download here:
    https://downloads.www.ads-software.com/plugin/frontier-post.3.8.7.7.zip

    There are additional changes in this version so I need to do some testing before I make a new stable version, that will trigger wordpress to show the update in automatically.

    You are welcome to help me test it

    Thanks

    Plugin Author finnj

    (@finnj)

    Released in 4.0.0

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Create new post button not appearing’ is closed to new replies.