• Resolved theotherdon

    (@theotherdon)


    @missveronicatv

    I found your snippet in another thread

    function get_all_approved_users() {
        
        $args = array(  'fields'     => array( 'ID', 'user_login' ), 
                        'orderby'    => 'user_login', 
                        'meta_query' => array( 'relation'  => 'AND', 
                                                array(  'key'     => 'account_status',
                                                        'value'   => 'approved',
                                                        'compare' => '=' )), 
                      );
    
        $users = get_users( $args );
        $all_users = array();
        foreach( $users as $user ) {
            $all_users[$user->user_login] = $user->user_login;
        }
        return $all_users;
    }
    

    and tried to adapt it list all users of a specific UM-created role. I tried:

    array(  'key'     => 'role_select',
            'value'   => 'Supervisor',
            'compare' => '=' )), 

    I also tried ‘um_supervisor’ for the value–neither worked. I suspect I am using the wrong key, but can’t figure out what it should be.

    Any thoughts/hints/suggestions?

    Thanks!

    –don

    • This topic was modified 1 year, 8 months ago by theotherdon.
Viewing 2 replies - 1 through 2 (of 2 total)
  • @theotherdon

    Try with role and um_supervisor.
    You may have the role as an array in wp_capabilities also.

    Look in your metadata table with phpMyAdmin.

    Thread Starter theotherdon

    (@theotherdon)

    That fixed it! Thank you.

    RE: “Look in your?metadata?table with phpMyAdmin.”

    You scare me when you talk like that!

    –don

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Another question about Populate dropdown list with members’ is closed to new replies.