| | |
| | | 'dateFrom' => 'string', |
| | | 'dateTo' => 'string', |
| | | 'context' => 'string', |
| | | 'source' => 'string', |
| | | 'contextId' => 'string', |
| | | 'favourites' => 'boolean', |
| | | 'user' => 'integer', |
| | | 'highlight' => 'string', |
| | |
| | | 'dateFrom' => 'string', |
| | | 'dateTo' => 'string', |
| | | 'context' => 'string', |
| | | 'source' => 'string', |
| | | 'contextId' => 'string', |
| | | 'favourites' => 'boolean', |
| | | 'user' => 'integer', |
| | | 'highlight' => 'string', |
| | |
| | | break; |
| | | case 'post': |
| | | $out['date'] = $post->post_date; |
| | | $out['modified'] = $post->post_modified; |
| | | $out['date_modified'] = $post->post_modified; |
| | | $out['user_id'] = (int)$post->post_author; |
| | | $out['url'] = get_the_permalink($postID); |
| | | $out['title']= get_the_title($postID); |
| | |
| | | $item['fields']['before'] = get_post_thumbnail_id($children[0]); |
| | | $item['fields']['after'] = get_post_thumbnail_id($children[array_key_last($children)]); |
| | | |
| | | $item['fields']['timeline'] = $subFields; |
| | | $item['fields']['timeline_gallery'] = $subFields; |
| | | $item['images'] = $item['images'] + $images; |
| | | |
| | | |
| | |
| | | protected function getAuthorData(WP_Post $post) |
| | | { |
| | | $author = $post->post_author; |
| | | $userLink = get_user_meta($author, BASE.'link', true); |
| | | $userLink = get_user_meta($author, BASE.'profile_link', true); |
| | | return $this->cache->remember( |
| | | $userLink, |
| | | function () use ($userLink, $author) { |
| | |
| | | $args = $this->applyContextFilters( |
| | | $args, |
| | | [ |
| | | 'id' => $data['source']??'0', |
| | | 'id' => $data['contextId']??'0', |
| | | 'type' => $data['context'] |
| | | ] |
| | | ); |
| | |
| | | |
| | | // Add term to tax query |
| | | $args['tax_query'][] = [ |
| | | 'taxonomy' => jvbCheckBase($context['type']), |
| | | 'field' => 'term_id', |
| | | 'taxonomy' => $registrar->getBased(), |
| | | // 'field' => 'term_id', |
| | | 'terms' => [(int)$context['id']], |
| | | ]; |
| | | break; |
| | | case $registrar->getType() === 'term': |
| | | // Add term to tax query |
| | | $args['tax_query'][] = [ |
| | | 'taxonomy' => $registrar->getBased(), |
| | | // 'field' => 'term_id', |
| | | 'terms' => [(int)$context['id']], |
| | | ]; |
| | | break; |