Notifications
Clear all
Bugs
5
Posts
2
Users
0
Likes
314
Views
Topic starter
26/10/2023 12:51 pm
prove 1
Topic starter
26/10/2023 12:51 pm
prove 1 reply
Topic starter
26/10/2023 2:30 pm
createMarker(latitude, longitude) {
var ourNewPost = {
title: latitude + ", " + longitude,
content: "Coordinates: " + latitude + ", " + longitude,
status: "publish",
acf_fields: {
points_title: "test",
points_latitude: latitude.toString(),
points_longitude: longitude.toString(),
status: 0
},
};
$.ajax({
beforeSend: (xhr) => {
xhr.setRequestHeader("X-WP-Nonce", myData.nonce);
},
url: myData.root_url + "/wp-json/wp/v2/points/",
type: "POST",
data: ourNewPost,
success: (response) => {
console.log(response);
},
error: (response) => {
console.log(response);
},
});
}
30/10/2023 11:48 am
12
