Create User Role That Can Create Posts But Can’t Publish

Home » Snippets » Create User Role That Can Create Posts But Can’t Publish
0

Created with:

User role generator

Visibility: 

public

Creator: WPTurbo Team

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				register_activation_hook( __FILE__, 'wpturbo_register_custom_user_role' );

/**
 * Registers a custom user role with specific capabilities.
 *
 * This function is called when the plugin is activated.
 *
 * @since 1.0.0
 *
 * @return void
 */
function wpturbo_register_custom_user_role() : void {
	add_role( 'content-creator', 'Content Creator', [
	]);
}
			

Register an account to save your snippets or go Pro to get more features.