Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 106 through 120 (of 244 total)
  • Author
    Posts
  • in reply to: Outputting user data in group loop #39111
    YasmineYasmine
    Participant

    I tried with the print_r but did not fix it.

    I also found that if I use the shortcode directly on the template, it will show the first value. But using it via the meta box group widget shows nothing

    in reply to: Outputting user data in group loop #39109
    YasmineYasmine
    Participant

    Hi Peter,

    Yes of course:

           $prefix = '';
    
    'name'   => __( 'Archived Users', 'your-text-domain' ),
                    'id'     => $prefix . 'archived_team_users_group',
                    'type'   => 'group',
                    'fields' => [
                        [
                            'name'            => __( 'Former team members', 'your-text-domain' ),
                            'id'              => $prefix . 'former_team_member',
                            'type'            => 'user',
                            'field_type'      => 'checkbox_list',
                            'select_all_none' => true,
                            'query_args'      => [
                                'role' => 'archive_team',
                            ],
                        ],
    in reply to: MB group loop - users #39074
    YasmineYasmine
    Participant

    Oh thats a clever idea. I have been able to output when users are attached to a post before. To give context on what I am trying to do: I am trying to show members of my team and the community. Before, I used a CPT to show team members and wider community, but was too much admin. So I wanted to dynamically populate and keep updated. Can I add a get_users($args) as the posts value with this method?

    I tried with the get_users, was fine for text but I struggled with their image. I use a custom field for my avatar, and so when I tried get_avatar_url() / get_avatar(), it returned the default avatar and not the users avatar. And when I tried $image =rwmb_meta( 'custom_avatar', ['size' => 'thumbnail'], $user_id); src=$image it returned nothing.

    So still unsure which direction to go. If I can fix the second issue, then I think it might make more sense for my usecase.

    Many thanks,
    Yasmine

    in reply to: Getting object ID #38940
    YasmineYasmine
    Participant

    Hi Peter,

    I am just trying to query a term from a post. And so dependent on if a taxonomy term was selected to do X
    So I guess its your last snippet - thank you!

    in reply to: User met not saving #38939
    YasmineYasmine
    Participant

    Hi Peter, thank you for your reply. Actually - it was my fault again. I was using WS Forms, and it wasn't saving the value in the database. But it did when I tried through metabox frontend. They now found that your admin save compared to your rwmb_set_meta function is different, and so they are updating their integration. Thanks anyway

    in reply to: Output selected user #38925
    YasmineYasmine
    Participant

    You can delete this. It was not the shortcode..

    in reply to: Elementor group skin not working #38775
    YasmineYasmine
    Participant

    Hi Long, I don't know how to share screenshots with this form, so will email

    in reply to: Group field #38721
    YasmineYasmine
    Participant

    Oh I think I worked it out - the above was my first attempt using the label, not the value - and I think that is what was wrong!

    in reply to: Group field #38720
    YasmineYasmine
    Participant

    Sorry in above it just shows the different filters I tried. Also tried:

    $checked_box = rwmb_meta('hidden_published_already', '', $post->ID );
    if (( $new_status == 'publish') && ($old_status != 'publish') && (get_post_type( $post ) == 'research') && ($checked_box == 0)){
    in reply to: Group field #38719
    YasmineYasmine
    Participant
    $checked_box = rwmb_get_value('hidden_published_already', '', $post->ID );
    if (( $new_status == 'publish') && ($old_status != 'publish') && (get_post_type( $post ) == 'research') && (($checked_box == 'Not published') || ($checked_box == 0))){ ..}// 0 is the value of unpublished

    This is what I have. It either works, or it doesn't work. It doesn't work if I use === 0, but it does work if I use ==0. The issue is, using == 0 also means it fires when the value is 1

    in reply to: Group field #38718
    YasmineYasmine
    Participant

    Hey long, the field I am actually having issues with is a radio field with the values 0 and 1.

    I was trying with rwmb_meta in exactly the format you share, however I thought maybe I should be using a different filter

    in reply to: Relationship field in user registration #38716
    YasmineYasmine
    Participant

    Thanks Long, that clarifies.

    But if I use the post field, how do I update the relationship field too? I use the relationship to query both ways on other parts of the site, so important this is also updated

    in reply to: Confirm password & hiding fields #38707
    YasmineYasmine
    Participant

    Ok, worked out how to hide: 'hidden' => 1

    But still keen to learn how to get rid of the second password. Do I perhaps need to hide it too and create an attribute for std to equal the value of the first password?

    in reply to: Group field #38700
    YasmineYasmine
    Participant

    Ok Long, thank you for the clarification.

    And my second question - how do you add custom fields to if statements?

    Can I do it like:

    $co_author_email = rwmb_meta( 'academicadd_co_author', '', $post->ID )
    
    If ($co_author_email == 'y')

    This is for something else, and the code works perfectly if no custom field conditions in the if statement, but then adding custom field conditions into if statements stops it from executing, even though the value is definitely there

    in reply to: Group field #38672
    YasmineYasmine
    Participant

    A follow up question - in my IF statement, where I want to check a custom fields value is equal to 'y'. Have I done this correctly? I have another piece of code and it works when I don't query against the value of a custom field, but when I try to query that it equals a custom field value it returns and does not execute my code (even though I checked and the value is definitely correct)

Viewing 15 posts - 106 through 120 (of 244 total)