• Hello, I have found your plugin by random ??
    I am using official Elementor PRO plugin.
    On my page, I have created the custom post type, called “Video”. It is constructed with CPT-UI plugin and has some ACF (Advanced custom fields – pro version). I tried to add the ACF – “Allowed users” and then in elementor template to dynamically called this values, but that was unsuccessful.

    I have the WP-admin in Slovak language, but hope you will be able to understand, what I need ??
    https://snipboard.io/vZEoGH.jpg
    This is an ACF panel, I have set “Allowed users” and field type selected “Users”. So I get the full list of users in my CPT, thats correct: https://snipboard.io/MBAJ2v.jpg

    I can save the post and everything seems to be OK.

    Now I went to the Elementor-> Templates -> Theme creator -> single posts -> add new. I have created a new template, and set its display conditions to videos (my CPT):https://snipboard.io/CSuJcf.jpg

    Now then I add the section (row) with Elementor and try to hide, I am getting something like this: https://snipboard.io/bJYDlh.jpg
    So it means, I can manually write the names/IDs of users. But I need to get them dynamically, so I tried to click the Dynamic content icon and add ACF. However my ACF key is not available!
    https://snipboard.io/3uqxyO.jpg

    I am awaiting there “povolene_pre” ACF key, which I have set in the first screenshot in this message. Why that ACF key is not present there? I am getting only ACF key from another CPT, which absolutely should not be there :O

    Could you please help, what am I doing wrong? Thank you in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author StaxWP

    (@staxwp)

    Hi, that is a logic that needs more complex implementation or something custom since you need to check the users based on the ACF field.

    @staxwp Hello, meanwhile I have resolved this issues with custom condition ??

    $user_array = get_field('uzivatelia');
    $current_id = get_current_user_id();
    if(in_array($current_id, $user_array)) {
    return true;
    } else {
    return false;
    }

    I have created the $currenct_id which contains current id of logged user and $user_array – whicih is array with my selected users on ACF side.
    Then I check, if $current_id is in values in array $user_array. If yes, return true, if not, return false.
    Unfortunately, I have noticed this feature after few hours of bac luck ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t get dynamically list of allowed users’ is closed to new replies.