• Resolved jbbobbio

    (@jbbobbio)


    Hello
    I’m trying to figure out how I can allow author to view and edit custom taxonomies please?

    If I go in Dynamic Taxonomy and in Capability, can I define that assign_terms is possible for those who have a permission for edit_(custom_post) ?

    What is the syntax to declare such thing please?

    I would like to know if it is something possible to do without having to install a plugin like user role editor.

    Many thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • jabbadu

    (@jabbadu)

    I need to know $this, too! ??

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello!

    Thanks for the feedback. Sorry for the late answer, as I’m still busy with the upcoming update. I wanted to test the answer myself before replying to the ticket. What you’re asking is basically applying this capability structure in your Dynamic Taxonomy settings:

    Source: https://wordpress.stackexchange.com/questions/58004/user-editor-cant-see-edit-taxonomy-screen

    
    'capabilities' => array (
    	'manage_terms' => 'edit_posts',
    	'edit_terms' => 'edit_posts',
    	'delete_terms' => 'edit_posts',
    	'assign_terms' => 'edit_posts'
    )
    

    To do so, you would have to enter this data in the setting textarea:

    
    manage_terms : edit_posts
    edit_terms : edit_posts
    delete_terms : edit_posts
    assign_terms : edit_posts
    

    Here is a screenshot: https://i.imgur.com/v60VP3s.png

    Turns out there’s a small problem with capabilities mapping in Dynamic Post Types/Taxonomies when using this type of data. I added a fix for the next update (should be out this weekend).

    In the meantime, you can add the following code in your functions.php file, it will apply the capabilities you’re looking for:

    
    add_filter('register_taxonomy_args', 'my_taxonomy_capabilities', 10, 3);
    function my_taxonomy_capabilities($args, $taxonomy, $object_type){
    	
    	// Replace 'my-taxonomy' with your taxonomy name
    	if($taxonomy !== 'my-taxonomy')
    		return $args;
    
    	$args['capabilities'] = array(
    		'manage_terms' => 'edit_posts',
    		'edit_terms' => 'edit_posts',
    		'delete_terms' => 'edit_posts',
    		'assign_terms' => 'edit_posts'
    	);
    
    	return $args;
    
    }
    

    Sorry for the inconvenience.

    Regards.

    Thread Starter jbbobbio

    (@jbbobbio)

    Thank you very much for your answer.

    In the mean time i finally installed user role editor to do this.
    But I’ll do what you said.

    Thank a lot.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Just to let you know that the latest 0.8.5 Fixed this issue. You’ll need to re-save the taxonomy/post type in order to make it work.

    Have a nice day ??

    Regards.

    jabbadu

    (@jabbadu)

    works like a charm with the new update, thx! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Allow author to edit custom taxonomies’ is closed to new replies.