slug); endforeach; return $type_slugs; } function default_post_format( $item ) { $filtered = array(); $filtered[id] = $item->ID; $filtered[slug] = $item->post_name; $filtered[type] = $item->post_type; $filtered[title] = $item->post_title; $filtered[excerpt] = $item->post_excerpt; $filtered[date] = $item->post_date; $filtered[content] = $item->post_content; $filtered[hero] = get_post_meta( $item->ID, 'hero_header', true ); // Materials + type endpoints // if($item->post_type === 'artist' || $item->post_type === 'event' || $item->post_type === 'exhibition') { $posts_with_type = ['artist', 'exhbition', 'event']; if(in_array($item->post_type, $posts_with_type)) { $filtered[materials] = make_taxonomy_endpoint_for(get_the_terms( $item, 'material' )); $filtered[type] = make_taxonomy_endpoint_for(get_the_terms( $item, $item->post_type . '_type' )); } // Custom fields endpoint if($item->post_type === 'artist') $filtered[sortname] = get_post_meta( $item->ID, 'artist-sort-name', true ); // Post categories and tags (store just the slugs) if($item->post_type === 'post') { $filtered[categories] = make_taxonomy_endpoint_for(get_the_terms( $item, 'category' )); $filtered[tags] = make_taxonomy_endpoint_for(get_the_terms( $item, 'post_tag' )); } return $filtered; } ?>