forked from OpenDevelopmentMekong/opendev-wptheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
section-query-actions.php
28 lines (28 loc) · 1018 Bytes
/
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', 'opendev'); ?></span>
<a class="rss" target="_blank" href="<?php echo $rss; ?>">
<span class="icon-rss"></span>
<?php _e('RSS Feed', 'infoamazonia'); ?>
</a>
<?php if($use_api) : ?>
<a class="geojson" target="_blank" href="<?php echo $geojson; ?>">
<span class="icon-hair-cross"></span>
<?php _e('Get GeoJSON', 'infoamazonia'); ?>
</a>
<a class="download" target="_blank" href="<?php echo $download; ?>">
<span class="icon-download"></span>
<?php _e('Download', 'infoamazonia'); ?>
</a>
<?php endif; ?>
</div>