Return to Snippet

Revision: 31692
at September 10, 2010 19:57 by errkk


Initial Code
function update_caps()
    {
    $role = get_role( 'editor' );

    $caps_to_add =  array(
        'delete_users',
        'create_users',
        'list_users',
        'remove_users',
        'add_users',
        'promote_users',
    );



    foreach( $caps_to_add as $cap )
        $role->add_cap( $cap );

    }

Initial URL

                                

Initial Description
run funciton once, ideally bind to activation hook of a plugin

Initial Title
add capabilities to a wordpress role

Initial Tags
wordpress

Initial Language
PHP