Support

Account

Home Forums General Issues Unable to get the shortcode from ACF text field

Unread

Unable to get the shortcode from ACF text field

  • i am trying to get the WPForm shortcode (text format) from ACF text field. i use the get_field() function. i know it get the correct field, but the problem is when try to echo the value, it display the forms it self while i need the shortcode in textformat value. the objective is for me to be able to take WPForm ID from that shortcode. below is my code:

    $formID = get_field( ‘form_box’, get_the_ID());
    $flag = 0;
    $i = 1;
    $groupTitle = “”;
    foreach($groupingCountry as $groupID => $groupObj){
    foreach($groupObj[‘group_list’] as $key => $value){
    if($countryID == $value){
    $flag = 1;
    $groupTitle = $groupObj[‘group_title’];
    //echo “groupID =”.$groupID.” | group_title =”.$groupObj[‘group_title’].” | group_list =”.$value.” | countrycode =”.$countryID ;
    echo $formID;
    $folder = array(
    ‘post_id’ => get_the_ID(),
    ‘post_title’ => get_the_title(),
    ‘post_url’ => get_the_permalink(),
    ‘post_country’ => $countryID,
    ‘post_folder_group’ => $i,
    ‘post_folder_group_title’ => $groupTitle
    );
    $folders[] = $folder;
    break 2;
    }
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.