Dear Lydia
You must use wpt_field_options
filter to add users.
See example for field with title “user id”:
add_filter( 'wpt_field_options', 'add_some_options', 10, 3);
function add_some_options( $options, $title, $type )
{
switch( $title )
{
case 'user id':
$args = array(
'orderby' => 'display_name',
'fields' => array( 'ID', 'display_name')
);
foreach( get_users($args) as $user ) {
$options[] = array(
'#value' => $user->ID,
'#title' => $user->display_name,
);
}
break;
}
return $options;
}
Cheers.
Marcin
Hi Team,
Great Plugin.
I am creating library management system in WP. I would like to add author names as comma separated values into select fields. I have created custom field group. but it is not saved properly when I add comma separated values into it. And also let me know how to show these values in frontend.
Thanks and Much appreciated for the plugin work.
Best regards,
-Rams