Not working with ACF 5.7.11
-
Hello,
Thanks for great plugin. It wasn’t working with ACF pro Version 5.7.11 so I investigated a little and changed this function:
public function post_field_groups($post_id) { $found = false; $cache = wp_cache_get('post_field_groups-'.$post_id, 'acfpost2post', false, $found); if ($found) { return $cache; } $post_type = get_post_type($post_id); $args = array('post_type' => $post_type); $field_groups = acf_get_field_groups($args); $count = count($field_groups); for ($i=0; $i<$count; $i++) { $field_groups[$i]['fields'] = acf_get_fields($field_groups[$i]); } wp_cache_set('post_field_groups-'.$post_id, $field_groups, 'acfpost2post'); return $field_groups; } // end public function post_field_groups
Function acf_get_field_groups() was returning empty array when called with array(‘post_id’, $post_id) as argument, and acf_get_fields() also returned nothing with key as argument.
This way it seems to work.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Not working with ACF 5.7.11’ is closed to new replies.