Skip to main content

Questions tagged [ajax]

Ajax - The core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the auto-save functionality on post and page editing screens. Several themes and plugins also use Ajax; for instance, some post rating plugins.

0 votes
0 answers
34 views

How can I display a Divi content inside a modal based on an AJAX request

This is my first question, please bear with me if I have forgotten any information. I want to show Divi content (saved as a WordPress project if it's important) inside an overlayed modal. For this I ...
0 votes
0 answers
23 views

Start a long running PHP process via JS/Ajax and monitor progress on admin page

I am developing a plugin, which can import layouts for a certain theme from a remote URL. Those layouts often contain a good amount of images and sometimes even videos. I have a admin page where the ...
0 votes
1 answer
777 views

duplicate posts with ajax load more wordpress

I have ajax loading posts on my site when scrolling. The problem lies in the appearance of duplicate posts. I cannot understand why this is happening. Only some posts have duplicates. Here is my code ...
0 votes
1 answer
132 views

AJAX request blocked by CORS policy

I have an issue with CORS policy. The request to retrieve URL is being blocked. I tried everything (Access-Control-Allow-Origin: * in .htaccess, theme's function.php, theme's header and wp-config.php ...
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 ...
1 vote
1 answer
3k views

prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site

I have seen a number of methods dating back to about 2011 in order to take a form and have its data posted via ajax.jquery. I have tried a couple and am just getting the page to reload despite using ...
0 votes
1 answer
1k views

Use AJAX to fetch Current Post Thumbnail for Wordpress when Uploaded throughMedia Uploader Frontend

i Use WordPress Media Uploader on Frontend to allow users to upload Thumbnail for there UGC site. I also show a Preview of the Image on Frontend. When a user clicks the button the Media Uploader opens ...
0 votes
1 answer
960 views

Wordpress ajax filter returning all posts when it should be filtering by category

Here is My code, it should be filtering by category, it displays all posts on any checkbox I click, I don't know how to fix this, I have tried everything. <form id="filter"> <?php ...
0 votes
1 answer
3k views

get all products of one category

i use this function to get all products of one category in ajax request function get_products() { $cat_id = $_POST['category']; $args = array( 'post_type' => 'product', '...
0 votes
1 answer
999 views

Ajax call from Plugin using Class

I'm making a plugin with a class and methods. This class gets called through the theme ( hard coded ) to enqueue and localize my js. it also prepares it for ajax. However, i keep getting ERROR: 400 ...
0 votes
1 answer
4k views

How to pass array from jQuery to PHP with AJAX in WordPress?

I have a HTML form with 2 select boxes with multiple selection. I get the selected values on form submit with jQuery and store them in 2 different arrays: $('#assign_categories_form').on('submit', ...
0 votes
1 answer
2k views

How to echo a PHP code into WooCommerce variation product?

I have a little complex to explain the problem which I hope someone can understand and help me with. I have set custom fields on WooCommerce which I use to enter a specific code for each product (...
1 vote
2 answers
10k views

AJAX success response is not working but it's saving my changes

I'm a beginner in jQuery-Ajax so please bear with me. My Ajax response does not seem to load but my changes are being saved. but gives me this error on admin-ajax.php "call_user_func() expects ...
0 votes
1 answer
378 views

Can't have two simultaneous charts using Apex Charts

My problem is pretty simple: I have an HTML code block with an AJAX query that builds a perfectly fine chart using Apex Charts. When I duplicate this HTML block, it doesn't display one of the charts, ...
0 votes
0 answers
39 views

I am trying to add form using ACF plugin and acf_form() function, but my user fields dont show up properly

I am new at wordpress, so i am very sorry if this is a stupid question, but anyway... I am trying to create form on frontend to add my custom post types with custom fields which i created using ACF ...

15 30 50 per page