CAS users and WP users
-
Hi
I am using Authorizer for CAS authentification and it works fine. I have a question regarding a feature.
I am now using a small script (see below) to populate a dropbox list with usernames. But only the WP-users appear. How to put the CAS users on this list ? (only the CAS or, better, both CAS and WP users).
ThanksHere is the script I use :
//This adds display names for all users to a drop down box on a gravity form.
add_filter(“gform_pre_render”, “populate_userdrop”);//Note: when changing drop down values, we also need to use the gform_admin_pre_render so that the right values are displayed when editing the entry.
add_filter(“gform_admin_pre_render”, “populate_userdrop”);function populate_userdrop($form){
//only populating drop down for form id 1- if editing this change to your own form ID
if($form[“id”] != 1)return $form;
//Creating item array.
$items = array();
// Get the custom field values stored in the array
// If editing this lookup where you would like to get your data from
// this example loads through all users of the website
$metas = get_users();if (is_array($metas))
{
// in this example we just load the display_name for each user into our drop-down field
foreach($metas as $meta)
$items[] = array(“value” => $meta->user_email, “text” => $meta->display_name);
}
- The topic ‘CAS users and WP users’ is closed to new replies.