'post_taxonomy', 'ef_media' => 'attachment', 'ef_taxonomy' => 'taxonomy', 'ef_user' => 'user_role', 'user_type' => 'current_user_role' // 5.2.0 ); // only replace 'taxonomy' rule if is an ACF4 field group if( $version > 4 ) { unset($replace['taxonomy']); } // loop over location groups if( $field_group['location'] ) { foreach( $field_group['location'] as $i => $group ) { // loop over group rules if( $group ) { foreach( $group as $j => $rule ) { // migrate param if( isset($replace[ $rule['param'] ]) ) { $field_group['location'][ $i ][ $j ]['param'] = $replace[ $rule['param'] ]; } }} }} // change layout to style (v5.0.0) if( isset($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; } /** * validate_post_taxonomy_location_rule * * description * * @date 27/8/18 * @since 5.7.4 * * @param type $var Description. Default. * @return type Description. */ function validate_post_taxonomy_location_rule( $rule ) { // previous versions of ACF (v4.4.12) saved value as term_id // convert term_id into "taxonomy:slug" string if( is_numeric($rule['value']) ) { $term = acf_get_term( $rule['value'] ); if( $term ) { $rule['value'] = acf_encode_term($term); } } // return return $rule; } } acf_new_instance('ACF_Compatibility'); endif; // class_exists check ?>