cccicl
cccicl
发布于 3天前

PHP 为wordpress角色添加功能

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 );

    }