Last active
October 31, 2015 11:50
-
-
Save plusplugins/1d15795944eac4b4234b to your computer and use it in GitHub Desktop.
CMB2 Select2 Dropdown of Ultimate Member user fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $ultimatemember; | |
$options = array(); | |
$fields = $ultimatemember->builtin->all_user_fields('date,time,url'); | |
foreach ($fields as $key => $value) { | |
if ( isset($value['title']) ) { | |
$options[$key] = $value['title']; | |
} | |
} | |
$cmb->add_field( array( | |
'name' => __( 'Fields', 'pp' ), | |
'desc' => __( 'Select fields', 'pp' ), | |
'id' => $prefix . 'fields', | |
'type' => 'pw_multiselect', | |
'options' => $options, | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment