- moving ajax script outside plugin class, as a js file
- wip trying to use the wordpress image editor
This commit is contained in:
19
plugins/fipfcard_plugin/js/image_editor.js
Normal file
19
plugins/fipfcard_plugin/js/image_editor.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
console.log("---------------inside image_editor.js--------------");
|
||||
const edit_image_button = document.getElementById('edit_image');
|
||||
const image_id_field = document.getElementById('image_id');
|
||||
|
||||
edit_image_button.addEventListener('click', () => {
|
||||
const image_id = image_id_field.value;
|
||||
|
||||
PLGNTLS_ajax("postid", image_id, 'image_editor')
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("data: ");
|
||||
console.log(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error: ");
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user