User custom fields

Support MB User Meta User custom fields

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29622
    artur.art7@gmail.com[email protected]
    Participant

    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?)

    #29630
    Long NguyenLong Nguyen
    Moderator

    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

    #29639
    artur.art7@gmail.com[email protected]
    Participant

    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 %}
    #29647
    Long NguyenLong Nguyen
    Moderator

    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

    #29817
    artur.art7@gmail.com[email protected]
    Participant

    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.

    #29828
    Long NguyenLong Nguyen
    Moderator

    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}}" >
    #43735
    Gene TeiglandGene Teigland
    Participant

    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 ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.