Support

Account

Home Forums Backend Issues (wp-admin) WordPress single profile page with acf gallery sharing images

Unread

WordPress 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 for this.

    Is there any other good practice for doing this?

    I would like suggestions.

    one part profile edit, code below:

    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)

You must be logged in to reply to this topic.