WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] How to let contributor user level edit custom posts from all? (7 posts)

  1. JustRunLah
    Member
    Posted 6 months ago #

    Hello,

    FIrst, thanks for an awesome plug in!

    I have a question: I am running a site with multiple users with different levels, I have made a custom post type called "race". I would like to make Contributor level able to edit "races" that have been published from any other user, not only his own.

    Currently, only the Author can do this, while Contributor can only edit the "races" himself has published.

    I do have a user role / capabilities plugin (User Role Editor and Members) but I do not know how to set up the capabilities for a custom type post.

    Any help appreciated

    PS. As a second step, I would like for edits to have to be approved by an Author anytime they are made by a contributor. Currently, if a contributor edits his own "race", the changes are published immediately. Approval is only needed for initial publication right now.

    thanks a lot in advance!

    https://wordpress.org/plugins/custom-post-type-ui/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 6 months ago #

    This is definitely something that's outside the scope of our plugin. https://codex.wordpress.org/Roles_and_Capabilities is going to be a good reference point, and any of the listed ones that relate to "posts" will likely be what you need to keep in mind with custom post types. Hope that gives a bit of a better idea.

  3. JustRunLah
    Member
    Posted 6 months ago #

    Hi Michael,

    Thanks for the reading source; I was just wondering if the CPT UI plugin registers any specific capabilities itself, or if I have to somehow register on my own

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 6 months ago #

    We try to keep it basic and simply get the post types and taxonomies registered. We don't add any specific capabilities ourselves because we don't know what the user would want, and we haven't gone the route of trying to add UI for the topic either. I think it's better to let other plugins handle that type of thing personally.

  5. JustRunLah
    Member
    Posted 6 months ago #

    I see, just one thing then (if you got 5 mins):

    I think this entry is related to my problem http://www.wpmayor.com/roles-capabilities-wordpress/ (the last bit of code down the page) but I do not know how to adapt it in the case that the post type already exists, and in which files the code should be inserted to.

    Basically, if I try to manually register again for the same post name that I already have made (with your plug in), am I running a risk of breaking things?

  6. Michael Beckwith
    Member
    Plugin Author

    Posted 5 months ago #

    You can use the "Get code" link in the CPT list page to get the code that we're using to register the post type.

    You can then put that in your functions.php file and edit as you need, after deleting the post type that CPTUI registers for you. MAKE SURE you get the code before you do any deleting.

    Do note that it won't delete the posts in the database, it just would no longer register the post type.

    As an aside if you are hesitant to delete, I am not sure which order both instances would be run in, but I wonder if the functions.php one would be run later and override the one done by our plugin. Worth checking on if you're curious/adventurous.

  7. JustRunLah
    Member
    Posted 5 months ago #

    thanks a lot, I got it to work :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.