diff --git a/mapa2.php b/mapa2.php
new file mode 100755
index 0000000..a2ef67a
--- /dev/null
+++ b/mapa2.php
@@ -0,0 +1,290 @@
+ 'marker',
+);
+$posts = get_posts($args);
+
+// fit to location
+$fit = false;
+if (isset($_GET['fit'])) {
+ $fit = true;
+}
+
+?>
+
+
+
+
+
+
+
+
+Mapa de Comunitats
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+LOADING...
+
+
+
+
+
+
+
+
diff --git a/soundmap.php b/soundmap.php
index 67ca5d9..a01a33a 100755
--- a/soundmap.php
+++ b/soundmap.php
@@ -58,6 +58,7 @@ if (!class_exists('Soundmap')){
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
+ 'show_in_rest' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'marker', 'with_front' => false ),
'capability_type' => 'post',
@@ -581,8 +582,22 @@ if (!class_exists('Soundmap')){
die();
}
+
+ function soundmap_prepare_marker ($data,$p,$r) {
+ $_data = $data->data;
+ $_data['content'] = apply_filters('the_content',get_the_content($p->ID));
+ $fields = get_fields();
+ foreach ($fields as $name=>$value) :
+ $f = get_field_object($name);
+ $_data[str_replace('_','-',$name)] = array($value,$f['label']);
+ endforeach;
+ $data->data = $_data;
+ return $data;
+ }
+
function register_filters(){
//add_filter( 'pre_get_posts', array($this, 'pre_get_posts'));
+ add_filter('rest_prepare_marker',array($this,'soundmap_prepare_marker'),12,3);
}
function set_query($query){
@@ -595,7 +610,7 @@ if (!class_exists('Soundmap')){
$this->config['query'] = $query;
}
}
-
+
function getID3($file){
$getID3 = new getID3;
$result = array();