EW EXTRA with Ultimate Member
-
Hello can anyone help me, I’m trying to code a couple of Ultimate Member fields into my Entry Wizard and I’m a numpty – I’ve done something [or a lot!] wrong. Please help!
Below is what I have currently:
defined( ‘ABSPATH’ ) or exit; // show a blank page if try to access this file directly
add_action(‘init’, ‘ewz_extra_custom_class’, 10);
function ewz_extra_custom_class(){
class Ewz_Custom_Data
{/* you may have up to 9 items here, called $custom1, $custom2 …. $custom9 */
public $custom1;
public $custom2;/* if needed, add more lines here for “$custom3”, “$custom4”, etc. */
public static $data =
array(
‘custom1’ => ‘Membership Number’,
‘custom2’ => ‘Grade’,/* if needed, add more lines here for “custom3”, “custom4”, etc. */
);
public function __construct( $user_id ){
$this->custom1 = get_um_user(‘membership_number’);
$this->custom2 = get_um_user(‘grade’);
/* if needed, add more lines here for “custom3”, “custom4”, etc. */
/* ( but note that too many items put an extra load on your server ) */
}/* If you have a custom field that can only have a limited number of values, listing those */
/* values here will allow you to choose items having those values in the Data Management */
/* area of the Webforms page */
public static function selection_list( $custom_field ){
switch( $custom_field ){
case ‘custom1’: return array( ); case ‘custom2’: return array( );/* if needed, add more lines here for “custom3”, “custom4”, etc. */
default: return array();
}
}
}
}
- The topic ‘EW EXTRA with Ultimate Member’ is closed to new replies.