Support Forum
Support › MB User Meta › User custom fields
Hi, I created a custom field for users. I have images, URL for social media like FB, Instagram, Linkedin. How can I put this into my page. I tried through MB view but nothing show.
I use oxygenbuilder. (Is the expected date for integration metabox with oxygen?)
Hi Artur,
Can you please share the View code that you create to show field values? You can follow the documentation to create a shortcode with PHP code then insert the shortcode to the Oxygen Builder to show the user meta
https://docs.metabox.io/extensions/mb-user-meta/#getting-field-value
https://docs.metabox.io/extensions/meta-box-group/#outputing-group-with-page-builders
I use the simple code that was generated by the metabox. I choose insert field -> User -> field id. Then I added this shortcode to the oxygen template.
{% for item in user.zdjecie %}
<img src="{{ item.thumbnail.url }}" width="{{ item.thumbnail.width }}" height="{{ item.thumbnail.height }}" alt="{{ item.thumbnail.alt }}" />
{% endfor %}
Hi Artur,
I see the View shortcode works as well on my site. You can assign the Type to Shortcode and add the shortcode to the Oxygen Builder. Screenshot https://share.getcloudapp.com/Kou4PxRd
Yes, I use shortcode but this doesn't work.
Look at this page: https://brandnewportal.stronazen.pl/reklama/reklama-na-facebooku-przewodnik-krok-po-kroku/
The first image is created followed your tutorial: https://metabox.io/create-custom-avatar/
The second image is from oxygenbuilder author pics and the builder shows the original avatar.
The third is Metabox view- shortcode and is invisible.
Hi,
I got the issue. The tab user
in the View support getting the meta of logged-in user. If you want to get the user meta from a user, please use the helper function rwmb_meta()
. Get more details on this documentation
https://docs.metabox.io/extensions/mb-user-meta/#getting-field-value
https://docs.metabox.io/extensions/mb-views/#running-php-functions
For example
{% set user_image = mb.rwmb_meta( 'zdjecie', {object_type: 'user'}, 1 ) %}
<img src="{{user_image.url}}" >
Hi Support,
I have created a custom fields (Advance select ) with multiple select option into the user section.
Now I want to update this user meta fields through the custom hook.
I am trying to update the meta through the core wordpress function
$new_user_groups = array(
'r2Clips',
'r2_NewsGossip',
'r2_Lifestyle'
);
update_user_meta($user_id, 'user_groups', $new_user_groups );
But it is not working. Can you please suggest me how we can update the custom fields value for user ?