WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
Automatically set user role none to subscriber (2 posts)

  1. CptOVERLORD
    Member
    Posted 1 year ago #

    How can i automatically set user role none to subscriber (if the user is logged in and its role is none)?
    or
    How can i edit user role none's capatibles?

    Thank you in advance.

    http://wordpress.org/extend/plugins/user-role-editor/

  2. CptOVERLORD
    Member
    Posted 1 year ago #

    <?php $user_idby = get_current_user_id();
    $capacwp = get_usermeta( $user_idby, $table_prefix.'capabilities' );
    if ( is_user_logged_in() ) {
    if (!(current_user_can('edit_post'))) {
    	update_user_meta($user_idby, 'wp010_capabilities', 'a:1:{s:13:"subscriber";s:1:"1";}');
    	update_user_meta($user_idby, 'wp009_capabilities', 'a:1:{s:13:"subscriber";s:1:"1";}');
    }
    }?>

    i have tried with this form. What can be the problem?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.