-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsection-query-actions.php
28 lines (28 loc) · 1.04 KB
/
section-query-actions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<div class="query-actions">
<?php
$jeo_options = jeo_get_options();
$use_api = isset($jeo_options['api']) && $jeo_options['api']['enable'] ? true : false;
global $wp_query;
$args = $wp_query->query;
$args = array_merge($args, $_GET);
$geojson = jeo_get_api_url($args);
$download = jeo_get_api_download_url($args);
$rss = add_query_arg(array('feed' => 'rss'));
$rss = str_replace("news-archive/", "", $rss);
?>
<!-- <span class="query-actions-title"><?php _e('Content API', 'odm'); ?></span> -->
<a class="button rss" target="_blank" href="<?php echo $rss; ?>">
<i class="fa fa-rss"></i>
<?php _e('RSS Feed', 'odm'); ?>
</a>
<?php if($use_api && (!is_post_type_archive( 'map-layer' )) ) : ?>
<a class="button geojson" target="_blank" href="<?php echo esc_url($geojson); ?>">
<i class="fa fa-globe"></i>
<?php _e('Get GeoJSON', 'odm'); ?>
</a>
<a class="button download" target="_blank" href="<?php echo esc_url($download); ?>">
<i class="fa fa-download"></i>
<?php _e('Download', 'odm'); ?>
</a>
<?php endif; ?>
</div>