Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function pgmb_add_acf_fields($variables, $parent_post_id){
//Check if the ACF get_fields function is actually available
if(!function_exists('get_fields')){ return $variables; }
$fields = get_fields($parent_post_id);
foreach($fields as $name => $value){
$variables["%acf_{$name}%"] = $value;
return $variables;
add_filter('mbp_placeholder_variables', 'pgmb_add_acf_fields', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment