prefix}postmeta WHERE meta_key = 'rule'"; // $acf_pro_sql1="SELECT * FROM {$wpdb->prefix}postmeta WHERE meta_key = '_edit_last'"; //OLD $acf_pro_sql2="SELECT * FROM {$wpdb->prefix}posts INNER JOIN {$wpdb->prefix}postmeta ON {$wpdb->prefix}posts.ID = {$wpdb->prefix}postmeta.post_id WHERE 1=1 AND {$wpdb->prefix}posts.post_type = 'acf-field-group' AND {$wpdb->prefix}posts.post_status = 'publish' AND {$wpdb->prefix}postmeta.meta_key = '_edit_last' ORDER BY {$wpdb->prefix}posts.menu_order, {$wpdb->prefix}posts.post_date DESC"; if(!$ACF_PRO_active): //ACF $acf_field_group_VARS = $wpdb->get_results($acf_sql1); else: //ACF PRO $acf_field_group_VARS = $wpdb->get_results($acf_pro_sql2); endif; ?> post_id; //Get more from the object by using the get_post() function. Ultimately, we're trying to get //the name of the field group $acf_field_group = get_post($acf_field_group_var_ID); $acf_field_group_TITLE = $acf_field_group->post_title; if(!$ACF_PRO_active): //Gets the custom field keys from the groups ID $acf_field_group_KEYS = get_post_custom_keys($acf_field_group_var_ID); //Create an array that will hold our individual field keys $acf_field_group_keys_ARRAY = array(); //Check to see if field_ exists in the array item and if it does, push the field into the new array we just created foreach ($acf_field_group_KEYS as $acf_field_group_KEY) { if(p_Strings($acf_field_group_KEY, "field_")){ array_push($acf_field_group_keys_ARRAY, $acf_field_group_KEY); } } else: //If ACF PRO $acf_field_field_VARS = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}posts WHERE post_parent = '".$acf_field_group_var_ID."' "); $acf_field_group_keys_ARRAY = $acf_field_field_VARS; endif; //Show in Metabox on Field Group screen if($fgvar): if ($fgvar === sanitize_title($acf_field_group_TITLE)): echo ""; $hide =""; else: $hide="hide"; endif; endif; echo ""; } ?>

ACF Show PHP Variables | Template Usage

(Copy and Paste into your template file.)


"; echo '
  Variables for ACF function:
'; echo "
" . $getf . "
"; // echo ""; // echo "
"; echo "
" . $getfinst . "

"; echo "
"; echo ""; ?>
"; if($count = 1): $count++; echo '
<!---
COPY
-->
'; echo "
<?php
"; echo "
/**";
					    echo "
****************************************************************
"; echo "* ACF Field Group Name : "; echo ''; echo '',$acf_field_group_TITLE . "
"; echo "
"; echo "* Made with ACF Theme PHP plugin
"; echo "****************************************************************
*/
"; endif; foreach($acf_field_group_keys_ARRAY as $acf_field_group_keys_EACH){ //var_dump($acf_field_field_VAR); if(!$ACF_PRO_active): $acf_field_group_keys_EACH = get_field_object($acf_field_group_keys_EACH); else: $acf_field_group_keys_EACH = get_field_object($acf_field_group_keys_EACH->post_name); endif; $acf_field_LABEL = $acf_field_group_keys_EACH['label']; $acf_field_NAME = $acf_field_group_keys_EACH['name']; $acf_field_KEY = $acf_field_group_keys_EACH['key']; $acf_field_TYPE = $acf_field_group_keys_EACH['type']; $acf_field_INSTRUCTIONS = $acf_field_group_keys_EACH['instructions']; ?>
'; //echo ''; echo ''; echo ' $' . $acf_field_NAME . ' = '; echo ''; //echo ''; echo 'get_field(''.$acf_field_NAME.'');'; echo ' // # ' . $acf_field_TYPE . ''; echo ' // #'. htmlspecialchars($acf_field_INSTRUCTIONS) .''; ?>


";//die(); ?> '; echo "


/"; echo "*************************************"; echo "
ACF EXAMPLE CODE:
"; echo "*************************************"; echo "/
"; echo ''; endif; foreach($acf_field_group_keys_ARRAY as $acf_field_group_keys_EACH){ //var_dump($acf_field_field_VAR); if(!$ACF_PRO_active): $acf_field_group_keys_EACH = get_field_object($acf_field_group_keys_EACH); else: $acf_field_group_keys_EACH = get_field_object($acf_field_group_keys_EACH->post_name); endif; $acf_field_LABEL = $acf_field_group_keys_EACH['label']; $acf_field_NAME = $acf_field_group_keys_EACH['name']; $acf_field_KEY = $acf_field_group_keys_EACH['key']; $acf_field_TYPE = $acf_field_group_keys_EACH['type']; $acf_field_INSTRUCTIONS = $acf_field_group_keys_EACH['instructions']; echo ''; require('acf-examples.php'); echo ''; }//end foreach if($count = 1): $count++; echo "
?>
"; endif; echo "

You don't have any fields created yet.

Get Started!

You don't have any fields created yet for ACF PRO.

Get Started!

(Quick View)', 'show_link_to_acfphpvars', 'acf-field-group', 'normal', 'low'); else: add_meta_box('ACF-PHP-VARS-ID', 'ACF Theme PHP (Quick View)', 'show_link_to_acfphpvars', 'acf', 'normal', 'low'); endif; } add_action('add_meta_boxes', 'add_link_to_acf'); function show_link_to_acfphpvars(){ ?> '.$fgvaru.' VARS | Quick Show'; acf_spv_show_variables($fgvar); echo '
See All Field Group Vars
'; else: echo 'Please save your field group to see fields'; endif; }