Support

Account

Home Forums Front-end Issues Single profile page with acf gallery sharing images

Unread

Single profile page with acf gallery sharing images

  • Good afternoon devs, I develop a project that consists of users profiles with a record created with fields from the ACF, including the image gallery field, my problem is … as I only use one page to display this profile, the image gallery is makes it shared even with the option of “attached to the post”, as I only use one page profile.edit template.

    Is there any other good practice for doing this?

    I would like suggestions.

    one part profile edit

    function acf_profile_edit( $atts ) {
    
    $a = shortcode_atts( array(
        'field_group' => ''
    ), $atts );
    
    $uid = get_current_user_id();
    
    if ( ! empty ( $a['field_group'] ) && ! empty ( $uid ) ) {
        $options = array(
            'post_id' => 'user_'.$uid,
            'field_groups' => array( intval( $a['field_group'] ) ),
            'return' => add_query_arg( 'updated', 'true', get_permalink() )
        );
    
        ob_start();
    
        acf_form( $options );
        $form = ob_get_contents();
    
        ob_end_clean();
    }
    
    return $form;
    }
    
    add_shortcode( 'profile_edit', 'acf_profile_edit' );
    
Viewing 1 post (of 1 total)

The topic ‘Single profile page with acf gallery sharing images’ is closed to new replies.