Support Forum ยป User Profile

Forum Replies Created

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • in reply to: Sorting by number type #32834
    vacdkvacdk
    Participant

    Hi, I forgot to mention I have set the CPT to the users and not post.
    Here is a recording, it seems its sorting the users and not the numbers.

    https://share.getcloudapp.com/xQuzlNzr

    in reply to: Image taxonomy #32364
    vacdkvacdk
    Participant

    So, after some digging, I think I got it to work.

    add_action( 'rwmb_galleri_upload_after_save_field', function ( $null, $field, $new, $old, $object_id ) {
     $args = array(
        'post_type' => 'attachment',
        'numberposts' => null,
        'post_status' => null,
        'post_parent' => $object_id
    ); 
    $attachments = get_posts($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
          wp_set_object_terms( $attachment->ID, 'Galleri', 'happyfiles_category', false );
        }
    }   
    }, 10, 5 );

    is this the right way to do it ? or is there an easier way ?

    in reply to: Image taxonomy #32357
    vacdkvacdk
    Participant

    Thanks Long

    But the lack of documentation or examples I can not get it to work.

    In this example, I am just trying to update a text field after saving.
    Text field ID = text_plo7fflsjjp

    add_action( 'rwmb_text_plo7fflsjjp_after_save_field', function ( $null, $field, $new, $old, $object_id ) {
        $settext = 'updated';
        
        update( $field["id"], $settext , $new );
    
    }, 10, 5 );

    but i am getting a Fatal error: Uncaught Error: Call to undefined function update()

    in reply to: Image taxonomy #32312
    vacdkvacdk
    Participant

    Thanks for the reply

    The Avatar image is already hooked to the user profile, so it's not possible also to add it to the attachment, I know ACF can hook to multiple locations posts, pages, users but I don't see the option in MB.

    As written in the earlier post, the Happyfiles plugin has already created the taxonomy.
    I just want to set a taxonomy argument on the image upload. Hidden, as users shall not be able to select different options.

    I tried with JSON notation, but no luck.

    CUSTOM SETTINGS
    ex. tax_query = [{"happyfiles_category": "avatar", "term_id": "20", "slug": "avatar"}]

Viewing 4 posts - 16 through 19 (of 19 total)