|
|
@@ -43,7 +43,7 @@ function default_post_format( $item, $include_content ) {
|
|
43
|
43
|
$filtered[hero] = get_post_meta( $item->ID, 'hero_header', true );
|
|
44
|
44
|
|
|
45
|
45
|
// Materials + type endpoints
|
|
46
|
|
- $posts_with_type = ['artist', 'exhbition', 'event'];
|
|
|
46
|
+ $posts_with_type = ['artist', 'exhibition', 'event'];
|
|
47
|
47
|
if( in_array($item->post_type, $posts_with_type) ) {
|
|
48
|
48
|
$filtered[materials] = make_taxonomy_endpoint_for(get_the_terms( $item, 'material'));
|
|
49
|
49
|
$filtered[subtypes] = make_taxonomy_endpoint_for(get_the_terms( $item, $item->post_type . '_type' ));
|
|
|
@@ -54,10 +54,17 @@ function default_post_format( $item, $include_content ) {
|
|
54
|
54
|
|
|
55
|
55
|
if($item->post_type === 'artist') $filtered[sortname] = get_post_meta( $item->ID, 'artist-sort-name', true );
|
|
56
|
56
|
|
|
57
|
|
- $posts_with_date = ['exhbition', 'event'];
|
|
|
57
|
+ $posts_with_date = ['exhibition', 'event'];
|
|
58
|
58
|
if( in_array($item->post_type, $posts_with_date) ) {
|
|
59
|
|
- $filtered[start] = get_post_meta($item->ID, $item->post_type . '-start-time', true);
|
|
60
|
|
- $filtered[end] = get_post_meta($item->ID, $item->post_type . '-end-time', true);
|
|
|
59
|
+ $key_prefix = $item->post_type;
|
|
|
60
|
+ $key_suffix = 'time';
|
|
|
61
|
+ // Exhibition meta key is very old so we change it back to exhibit
|
|
|
62
|
+ if($item->post_type == 'exhibition') {
|
|
|
63
|
+ $key_prefix = 'exhibit';
|
|
|
64
|
+ $key_suffix = 'date';
|
|
|
65
|
+ }
|
|
|
66
|
+ $filtered[start] = get_post_meta($item->ID, $key_prefix . '-start-' . $key_suffix, true);
|
|
|
67
|
+ $filtered[end] = get_post_meta($item->ID, $key_prefix . '-end-' . $key_suffix, true);
|
|
61
|
68
|
$filtered[current] = time() <= (int)$filtered[end] && time() >= (int)$filtered[start];
|
|
62
|
69
|
}
|
|
63
|
70
|
|