Support » Plugin: Custom Post Type UI » Taxonomy Capabilities

  • Resolved Blowsie

    (@blowsie)



    Hi,

    Great plugin, for me it works flawlessly, except for one small gotcha, perhaps you could help.

    As an admin, I CAN create, edit and delete posts created with CPT_UI.
    As an admin, I CAN assign taxonomies created with CPT_UI to posts created with CPT_UI.
    As an editor I CAN create, edit and delete posts created with CPT_UI.
    As an editor, I CANNOT assign taxonomies created with CPT_UI to posts created with CPT_UI.

    I’m using user role editor, and I checked if there was any permissions for the taxonomy that I could assign to a role, but could not see any.

    I presume these need to be registered manually? If so how does one go about doing it?

    I’m including an export of my taxonomy for reference. However all of my CPT configuration is currently in the UI and not in functions.php etc

    
    function cptui_register_my_taxes() {
    
    	/**
    	 * Taxonomy: Teams.
    	 */
    
    	$labels = array(
    		"name" => __( 'Teams', 'understrap-child' ),
    		"singular_name" => __( 'Team', 'understrap-child' ),
    	);
    
    	$args = array(
    		"label" => __( 'Teams', 'understrap-child' ),
    		"labels" => $labels,
    		"public" => true,
    		"hierarchical" => false,
    		"label" => "Teams",
    		"show_ui" => true,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"query_var" => true,
    		"rewrite" => array( 'slug' => 'team', 'with_front' => true, ),
    		"show_admin_column" => false,
    		"show_in_rest" => false,
    		"rest_base" => "",
    		"show_in_quick_edit" => false,
    	);
    	register_taxonomy( "team", array( "careers" ), $args );
    }
    
    add_action( 'init', 'cptui_register_my_taxes' );
    

    Thanks!

    • This topic was modified 5 months, 1 week ago by  Blowsie.
    • This topic was modified 5 months, 1 week ago by  Blowsie.
    • This topic was modified 5 months, 1 week ago by  Blowsie.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    good day @blowsie

    honestly, i’m not sure what’s going on and why you’re encountering the issue with that spot as an editor. The role editor plugin doesn’t help on my end either, because I don’t know exactly what’s been customized either.

    I know register_taxonomy() has a capabilities spot for manage/edit/delete/assign, but that’s it, and they’re pretty straightforward.

    I know I created this extension plugin for CPTUI that you could try out if you really wanted, https://github.com/tw2113/custom-post-type-ui-capabilities

    Otherwise, we have some filters that are available right before the registration that could be tapped into as well. It’s how I do it with the github plugin linked above. I can point you to those as well if desired.

    Beyond that, I’m wondering if your setup would technically work without the roles editor plugin in play, and if it’s actually unintentionally hindering.

    Thanks Michael,

    I disabled the user role editor plugin and still encountered the same issues.

    I then installed your plugin and took took the following steps.

    Mapped the permissions in the CPT UI.

    • manage_teams
    • edit_teams
    • delete_teams
    • assign_teams

    Then I created capabilities for the above in user role editor, using their “Add capabilities” function.

    Then I assigned the capabilities to the role.
    and… hey presto, it works!

    Thanks for the support and plugins!

    Hopefully someone else will find this guide useful.

    Plugin Author Michael Beckwith

    (@tw2113)

    As that personal extension gets tested a bit more and confirmed to be working, I hope to actually merge it in to CPTUI core. Not there quite yet though.

    Good to hear that things are working for you, with the steps outlined above.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.