WPFront
  • Home
  • Plugins
    • Notification Bar Plugin
      • Plugin Ideas
      • Plugin Settings
      • Plugin FAQ
    • Scroll Top Plugin
      • Plugin Settings
      • Plugin FAQ
    • User Role Editor Plugin
      • Plugin Documentation
      • Plugin Settings
      • Plugin FAQ
    • Paddle Gateway Plugin
  • Go Pro
  • Support
    • Documentation
    • FAQ
  • Affiliates
  • Contact
  • Login
  • Cart

Tagged: custom post, taxonomy

  • This topic has 8 replies, 2 voices, and was last updated 10 years, 1 month ago by Jim Gaiko.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • March 11, 2015 at 12:21 pm #5950
    Jim Gaiko
    Participant

    I have a custom post type with a custom taxonomy and have given a role full permissions to this post type but the users with this role are unable to access taxonomy for these posts. The taxonomy checkboxes are visible, but are grayed out. I’ve also given this role “manage_categories” permission, but that doesn’t seem to work either. Is there something else for which the role needs perms?

    March 11, 2015 at 7:33 pm #5959
    Syam Mohan
    Keymaster

    Hi Jim,

    This sounds like the user doesn’t have the capability the other plugin is looking for to enable taxonomies. Is it possible for you to contact the author of other plugin and ask him/her what capability that plugin is looking for.

    Thanks

    Syam

    March 12, 2015 at 5:37 am #5967
    Jim Gaiko
    Participant

    There’s no other plugin involved – the custom taxonomy and custom post type are created from within functions.php. Here’s the code that creates the taxonomy:

    
    //hook into the init action and call create_book_taxonomies when it fires
    add_action( 'init', 'create_skilltype_hierarchical_taxonomy', 0 );
    
    //create a custom taxonomy name it topics for your posts
    
    function create_skilltype_hierarchical_taxonomy() {
    
    // Add new taxonomy, make it hierarchical like categories
    //first do the translations part for GUI
    
      $labels = array(
        'name' => _x( 'Skill Types', 'taxonomy general name' ),
        'singular_name' => _x( 'Skill Type', 'taxonomy singular name' ),
        'search_items' =>  __( 'Search Skill Types' ),
        'all_items' => __( 'All Skill Types' ),
        'parent_item' => __( 'Parent Skill Type' ),
        'parent_item_colon' => __( 'Parent Skill Type:' ),
        'edit_item' => __( 'Edit Skill Type' ), 
        'update_item' => __( 'Update Skill Type' ),
        'add_new_item' => __( 'Add New Skill Type' ),
        'new_item_name' => __( 'New Skill Type' ),
        'menu_name' => __( 'Skill Types' ),
      ); 	
    
    // Now register the taxonomy
    
      register_taxonomy('skilltype',array('skills'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'skilltype' ),
      ));
    
    }
    
    March 12, 2015 at 7:56 pm #5999
    Syam Mohan
    Keymaster

    Thanks Jim, I’ll test with your code.

    March 16, 2015 at 8:26 am #6157
    Jim Gaiko
    Participant

    Have you had a chance to test?

    Thanks

    March 16, 2015 at 12:08 pm #6180
    Syam Mohan
    Keymaster

    Hi Jim, Sorry it took a while. I was working on a feature and I wanted to finish that before working on it, so that I don’t have to merge my codes later.

    I tested your code and it turns out that the user needs “edit_posts” capability instead of “manage_categories”.

    I’ll have to dig deeper into the WordPress core, to find is there any way to re-point it to the custom post type capability.

    Thanks

    Syam

    March 16, 2015 at 1:44 pm #6188
    Jim Gaiko
    Participant

    Thanks, giving “edit posts” now allows the user to edit the custom categories on the custom post type.

    Is there a way I can restrict this user from editing regular “Posts”? Or at least hide that from the dashboard menu?

    Thanks for your help

    March 16, 2015 at 1:47 pm #6189
    Syam Mohan
    Keymaster

    Hi Jim,

    “edit_posts” allows the user to edit their own posts. Also they will be able to create new posts. But they won’t be able to publish them or edit others posts. They can submit it for review.

    You can use the menu editor to remove those menu items from that role.

    Hope this helps.

    Thanks

    Syam

    March 16, 2015 at 4:04 pm #6200
    Jim Gaiko
    Participant

    Yes, that’s what I was looking for. Thanks!

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Custom taxonomy not editable in a custom post type’ is closed to new replies.
Log In
Lost Password

Search Topics

Documentation

FAQ
Roles List Add Role Edit Role Delete Role Restore Role Add or Remove Capability Assign/Migrate Users Posts/Pages Extended Permissions Custom Post Type Permissions Navigation Menu Permissions Widget Permissions Admin Menu Editor Media/Attachment File Permissions User Level Permissions Content Restriction Shortcodes Login Redirect Export Roles Import Roles Bulk Edit Settings Multisite Roles List Multisite Add New Role Multisite Edit Role Multisite Delete Role Multisite Restore Role Multisite Sync Roles Multisite Settings WordPress Capabilities Actions and Filters Installation Instructions