• Hi there Vladimir – We are setting up integration/data mapping from one app to the WordPress profile page to update the ‘additional user’ field provided by your plugin. Can you advise the metakey/field name of this field.

    We’ve tried ure_other_roles but it isn’t assigning/importing the additional role field in the backend on the user profile page.

    Our requirements are such that we need to have two x custom user roles (that we’ve created with your plugin) set – so the primary “Roles” and then the “Other Roles” set per user – we can easily assign these additional roles manually via the user profile page and your drop down picklist. But since we’ve quite a few users we would like to assign this/sync this value automatically with our existing customer user role data.

    Can you provide any information here that might help?

Viewing 1 replies (of 1 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Just in case this question is still actual or information will be useful for someone else.

    URE uses existing WordPress database wp_usermeta table record.
    Look at the wp-includes/class-wp-user.php, how it builds cap_key property:

    
    $this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities';
    

    Go through the code to see how to update this record:

    
    update_user_meta( $this->ID, $this->cap_key, $this->caps );
    

    , and read it, like:

    
    $value = get_user_meta( $this->ID, $key, true );
    

    WP stores user roles and capabilities list as a serialized PHP array. 1st element of the array (if it’s existed role) becomes a primary role, all the rest are the “Other roles”. Any string ID, which is not found at the existed roles list are the user capabilities granted directly to the user.

Viewing 1 replies (of 1 total)
  • The topic ‘Metakey for ‘additional user’’ is closed to new replies.