Unanswered Questions
970 questions with no upvoted or accepted answers
3
votes
3
answers
2k
views
Retrieving JSON data in ajax request from media uploader
I'm having some problems getting my JSON data that's being passed via an ajax request.
I'm trying to implement the media uploader into a plugins settings page. I've got it functioning properly using ...
2
votes
0
answers
206
views
AJAX returning blank result
I'm using ajax to filter a list. The filter works as it should most of the time, but for some queries it returns a blank result. When this happens, the error in the console is:
PHP Errors in Ajax ...
2
votes
0
answers
627
views
Problems with wordpress nonces in Ajax call
i am having big troubles with Wordpress nonces in ajax call. Basically i am trying to trigger a custom standalone php script i made on my custom theme that send emails to admins people whenever ...
2
votes
1
answer
141
views
Can part of my WordPress website be headless?
Just to set the scene I have a client that has a wordpress site with a mixture of "static" pages and woocommerce shop. The product catalogue has approx "86,000" products in it. ...
2
votes
0
answers
1k
views
AJAX function running TWICE with WordPress admin-ajax.php
I have a form submit event that calls a WordPress ajax function. The form submit event occurs only once (It is correct as expected). But the ajax function loaded TWICE (expected to occur once).
Here ...
2
votes
0
answers
905
views
WooCommerce event works in jQuery but not in JavaScript
I'm using WooCommerce hook added_to_cart which works perfectly in jQuery, but doesn't work in vanilla Javascript. Both functions are running on document loaded. Here is my code reference:
JavaScript
...
2
votes
0
answers
779
views
Nonces, AJAX, script variables & security in WordPress
Alright, so let's say you develop a website where you enqueue a js script on a page X of your frontend, using:
wp_enqueue_script(
'script_handle',
PATH_TO_SCRIPT,
array(),
'1.0.0',
true
);
...
2
votes
0
answers
44
views
Cannot search post by taxonomy
I'm trying to search posts by a taxonomy value, the problem is that the query doesn't return anything, this is my code so far:
$args = array(
'post_type' => 'zoacres-property',
'...
2
votes
0
answers
357
views
Refresh Taxonomies
When saving/updating a custom post type in the Admin Panel I'm hooking into save_post_{$post->post_type} and adding custom taxonomy terms from a linked post using wp_set_object_terms.
The terms are ...
2
votes
0
answers
1k
views
How to add pagination to wpbakery grid?
I have a theme with wpbakery page builder. I made a page to display blog posts using wpbakery grid. But I would like to display 5 posts per page and to use ajax pagination. I display 5 posts per page ...
2
votes
1
answer
2k
views
AJAX in plugin wp_send_json() sending html
I wrote a plugin that calls a PHP function from JQuery and the php sends a json response back to the Jquery using wp_send_json(). The functions are all called successfully, but the json request sends ...
2
votes
0
answers
175
views
Extending wp JavaScript base class to make a post request to a custom REST endpoint
I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in.
I'm now ...
2
votes
0
answers
411
views
Display notification only once
I am trying to use the getItem and setItem method to display notifications in an array only once.
It works for the first 5 notifications but once you go above 5 there are a few issues that arise. For ...
2
votes
0
answers
758
views
Search user metadata with checkboxes via ajax (almost working)
I have created an ajax search form following some tutorials online, it is working but not exactly how I need it to. Here is where I got the search from.
I have US states setup as a user meta field ...
2
votes
0
answers
2k
views
Filter custom post type archive page with custom taxonomies (categories) with AJAX
I've created a custom post type (projects) with different custom taxonomies (projects' categories).
I would like to create a categories' filter but with AJAX, so without reloading the page every ...