*/ // create new roles on plugin activation // https://developer.wordpress.org/reference/functions/add_role/ function archive_wpplugin_add_roles_on_plugin_activation() { // if ( get_option( 'custom_roles_version' ) < 1 ) { $resourceeditorcapabilities = array( 'read' => true, 'level_0' => true ); $resourceauthorcapabilities = array( 'read' => true, 'level_0' => true ); $resourceauthorcapabilities = array( 'read' => true, 'level_0' => true ); remove_role('archive_resource_editor'); add_role( 'archive_resource_editor', 'Resource Editor', $resourceeditorcapabilities ); remove_role('archive_resource_author'); add_role( 'archive_resource_author', 'Resource Author', $resourceauthorcapabilities ); remove_role('archive_resource_contributor'); add_role( 'archive_resource_contributor', 'Resource Contributor', $resourcecontributorcapabilities ); // update_option( 'custom_roles_version', 1 );} } register_activation_hook( __FILE__, 'archive_wpplugin_add_roles_on_plugin_activation' );