Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Review of UI-based permissions based on WordPress user role

Tags

Role Assign Tags Create Modify Delete
Contributor Y Y N N
Author Y Y N N
Editor Y Y Y Y

Categories

Role Assign Categories Create Modify Delete
Contributor Y N N N
Author Y N N N
Editor Y Y Y Y

Custom Non-Hierarchical Taxonomy

add_action( 'init', function() {
	register_taxonomy( 'topic', array( 'post' ), array(
		'label' => 'Topics',
		'hierarchical' => false,
	) );
} );
Role Assign Topics Create Modify Delete
Contributor Y Y N N
Author Y Y N N
Editor Y Y Y Y

Custom Hierarchical Taxonomy

add_action( 'init', function() {
	register_taxonomy( 'section', array( 'post' ), array(
		'label' => 'Sections',
		'hierarchical' => true,
	) );
} );
Role Assign Sections Create Modify Delete
Contributor Y N N N
Author Y N N N
Editor Y Y Y Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.