'post_taxonomy', 'ef_media' => 'attachment', 'ef_taxonomy' => 'taxonomy', 'ef_user' => 'user_role', 'user_type' => 'current_user_role' // 5.2.0 ); // remove conflicting param if( $v == 5 ) { unset($param_replace['taxonomy']); } // loop over location groups foreach( array_keys($field_group['location']) as $i ) { // extract group $group = acf_extract_var( $field_group['location'], $i ); // bail early if group is empty if( empty($group) ) { continue; } // loop over group rules foreach( array_keys($group) as $j ) { // extract rule $rule = acf_extract_var( $group, $j ); // migrate param if( isset($param_replace[ $rule['param'] ]) ) { $rule['param'] = $param_replace[ $rule['param'] ]; } // category / taxonomy terms are saved differently if( $rule['param'] == 'post_category' || $rule['param'] == 'post_taxonomy' ) { if( is_numeric($rule['value']) ) { $term_id = $rule['value']; $taxonomy = $wpdb->get_var( $wpdb->prepare( "SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $term_id) ); $term = get_term( $term_id, $taxonomy ); // update rule value $rule['value'] = "{$term->taxonomy}:{$term->slug}"; } } // append rule $group[ $j ] = $rule; } // foreach // append group $field_group['location'][ $i ] = $group; } // foreach } // if // change layout to style (v5.0.0) if( !empty($field_group['layout']) ) { $field_group['style'] = acf_extract_var($field_group, 'layout'); } // change no_box to seamless (v5.0.0) if( $field_group['style'] === 'no_box' ) { $field_group['style'] = 'seamless'; } //return return $field_group; } } new acf_compatibility(); ?>