Problem:
The issue was that the customer was using our
[types usermeta='wpcf_last_visited_class' user_current='true' output='raw'][/types]
To try and retrieve a custom user meta that he had created manually and unfortunately it does not work.
Solution:
If you manually inserted the custom field into the database without the use of Types then you will need a custom shortcode to retrieve the custom value.
I was able to write a shortcode to help retrieve this.
[get_user_field user='[wpv-current-user format="meta" info="id"]' field='wpcf_last_visited_class']
Add the following to your functions.php file
// Add Shortcode function get_user_field( $atts ) { // Attributes $atts = shortcode_atts( array( 'field' => '', 'user' => '', ), $atts ); $user_last = get_user_meta( $atts['user'], $atts['field'], $single ); var_dump($user_last); return $user_last[0]; } add_shortcode( 'get_user_field', 'get_user_field' );
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 9 replies, has 2 voices.
Last updated by 6 years, 7 months ago.
Assisted by: Shane.