This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add two new role. | |
// Full list of capabilities can be found at http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table | |
add_role('writer', 'Writer', array( | |
'delete_posts' => true, | |
'delete_published_posts' => true, | |
'edit_posts' => true, | |
'edit_published_posts' => true, | |
'publish_posts' => true, | |
'read' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Modify registration form to include roles | |
// | |
add_action('user_register', 'register_role'); | |
function register_role($user_id, $password="", $meta=array()) { | |
$userdata = array(); | |
$userdata['ID'] = $user_id; | |
$userdata['role'] = $_POST['cimy_uef_USERTYPE']; |