Shortcode to display extra fields
-
For anyone that needs this, this will display the form data for a user that is currently logged in:
//Display CIMY Extra Field function cimy_extra_field_sc( $atts ) { get_currentuserinfo(); $user_id = get_current_user_id(); $a = shortcode_atts( array( 'field' => 'something' ), $atts ); $field_name = "{$a['field']}"; $value = get_cimyFieldValue($user_id, $field_name); return $value; } add_shortcode( 'CIMY', 'cimy_extra_field_sc' );
so in my text body in a page I would use [CIMY field=”FIELD NAME”] to display that field.
Now you could modify the $user_id to pass through a user ID number to get non logged in data.
- The topic ‘Shortcode to display extra fields’ is closed to new replies.