Skip to content

Instantly share code, notes, and snippets.

View yassiryahya's full-sized avatar

Yassir Yahya yassiryahya

View GitHub Profile
@yassiryahya
yassiryahya / functions.php
Created November 24, 2011 16:46
Assigning Role On Wordpress Registration & Profile Page
<?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,
@yassiryahya
yassiryahya / functions.php
Created November 12, 2011 07:02
Assigning Role On Wordpress Registration Page
<?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'];