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.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

How can I count the clicks on a button in a post loop list?

This script is fine to count clicks on any button by id or class in a single post type template to save the counts into a custom field. But I want to count the clicks in the loop post list in the blog ...
0
votes
0answers
11 views

Wo to add an AJAX Link to the “Featured Image” meta box in Gutenberg?

I am new to React and Gutenberg. So, I don't have an idea how to do this: I've installed the YoImages Plugin in WP, wich inserts a link into the Feautured Image Box. A click on the link opens a ...
1
vote
1answer
16 views

Loading comments in ajax - comment-reply function missing $args

I'm loading comments with AJAX. It all works fine except reply link isn’t being rendered on the page. As I understand, the problem is can’t pass $args. How would I access $args or max_depth outside ...
0
votes
0answers
14 views

500 error when AJAX filter params are empty for WP_Query tax_query

I've created an AJAX taxonomy(product_cat) filter that's used on my WooCommerce product archive page (archive-product.php). The page loads the normal WooCommerce shop loop onload: ...
0
votes
0answers
15 views

Ajax result show in console if is called outside function and not showing in array

In wordpress theme I must change custom functionality and use ajax, so I have dropdown and on change I grab selected option: JS $( ".select-class" ).change(function(e) { var ...
0
votes
1answer
34 views

Trouble with AJAX using GET

I am creating a event calendar. It works fine on our Intranet fine, but when I copy the plugin to an external site, I keep getting the following: Sorry, that didn’t work. Please try again or come back ...
0
votes
2answers
19 views

Render Modula Plugin Shortcode On Ajax Request

I am using Modula Plugin to speedup the galleries creation process. It works wonderfully but I don't understand how to render it correctly on the ajax call. I read through the available posts on ...
0
votes
0answers
23 views

Generate multiple pages pdf with AJAX using mPDF library

I am developing a plugin that generates various PDFs using AJAX. I have done all but stuck on generating multiple PDFs for each user using the loop. I prefer to generate PDF with multiple pages for ...
0
votes
0answers
7 views

Taxonomy page's table doesn't update on create & delete

Created a custom taxonomy, and it works. But the table that displays the taxonomies in the wp-admin does not update on adding and deleting a entry without reload but the "quick edit" works ...
0
votes
0answers
32 views

jQuery.post returns 0

I'm currently working on a WordPress login popup, which is created as a plugin. I am relatively new to jQuery and AJAX in particular. I have a small issue with the return value always being 0, though ...
0
votes
0answers
11 views

Update shortcode when changing varients

With WooCommerce when you change the attribute options to select a variant, the Price and Stock amounts are updated via Ajax. I am currently using a shortcode on the single-product page where one of ...
0
votes
0answers
16 views

Confused. How to remove WP_Query $args from AJAX posts loop and make it work?

I am currently working on a custom theme project where I am trying to make AJAX load more function work for custom-post-type, 'product' I just made. I went through a tutorial on internet and got the ...
0
votes
0answers
20 views

AJAX Load More Posts not working in my custom WordPress theme. Help!

I have been working on my custom theme since last week. I am trying to code kind of an eCommerce solution. Well, I registered custom-post-type called 'product' and was coding archive-product.php. I ...
0
votes
0answers
13 views

WooCommerce mini cart fragments click event

I'm trying to add click event to the WooCommerce cart icon. However it doesn't work I guess because of the WooCommerce Ajax fragments. I want to keep Ajax fragments active and just add click event on ...
0
votes
0answers
11 views

How to make AJAX Load More Posts on Scroll for custom theme and custom-post-type?

I am currently working on a project where I am coding a custom theme with custom-post-type called products. Now, I am coding archive-product.php and stuck at making an AJAX load more posts on scroll ...
0
votes
0answers
17 views

how to do wordpress ajax post

I'm using Wordpress code snippet plugin to write my javascript codes. as I'm pretty new to wordpress coding, I tried doing an AJAX post that saves some data to a database table I created (inserting ...
0
votes
0answers
11 views

admin-ajax.php 404 bad request

I created ajax listing for data on my web site. Tomorrow it was worked but today I'm getting this error when the site is calling ajax : jquery.min.js?ver=5.6.2:5 POST https://domain.com/wp-admin/...
0
votes
1answer
18 views

How to control ajax calls without effecting memory of server?

I am trying to understand how ajax call and memory of server are linked? Is there any parameter in WordPress control this. Say if am importing something big using ajax how can perform that without ...
0
votes
1answer
38 views

Filter Custom Post Type by Category with Ajax

I've used the below tutorial for my WordPress site to add a filter to one of the pages. https://www.youtube.com/watch?v=KRc47o8uDhk&list=PLSeCxQ7f7r87qbYmqXmOAcvoshw1e6ewQ&index=3 It works ...
0
votes
0answers
17 views

AJAX - get_posts for a specific post type returns empty

I'm trying to load more posts via an ajax call but the array always returns empty. To troubleshoot, I replaced the "testimonial" in "get_posts" with "post" and "...
0
votes
0answers
15 views

Save shortcodes attributes and use them via AJAX

I am trying to develop a shortcode to show people's phone numbere. I developed a shortcode and pass attributes like these: [show-phone-number name="person1" phone1="111111111" ...
0
votes
0answers
18 views

How to delete post meta array by value

I have three fields I am saving as an array to a custom post meta. Like such... <label>Member:</label><input name='cantcommit[mbr]' value='' /> <label>Arriving:</label>&...
0
votes
1answer
57 views

Can't pass var from php wp_ajax into ajax script : result undefined or null

I can't understand why I get always a null or undefined response while trying to pass an php error from registration form into ajax script. I work in a custom plugin to add login, registration and ...
0
votes
0answers
11 views

Running JavaScript after using WooCommerce Filter Plugin

I’m using the Product Filters Plugin for filter products on my WooCommerce Store. I wan’t to do a complex design for the filter menu with JavaScript/jQuery but once I click on one of the filter’s ...
0
votes
1answer
15 views

Ajax Call 400 Bad Request error with POST request but not with GET request

I created a Vanilla JS Ajax handler as follows: var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { alert(this....
0
votes
0answers
14 views

Disable Ajax features to trash, approve or spam comments in WordPress admin

I need to disable ajax features in WordPress admin panel. My website has a lot of visitors which participate and interact via comments, this kind of behavior exhausts the admin-ajax.php and uses too ...
0
votes
1answer
65 views

Filter posts with ajax form and checkboxes

I have a loop for my Custom Posts Type workshop filtered with two custom taxonomies group and teacher on the same page. The Ajax filter works perfectly. Each links of the filter works with a <input ...
0
votes
2answers
17 views

Ajax filter button display all posts

I created a loop for my Custom Posts Type workshop with two custom taxonomies group and teacher on the same page. The Ajax filter works perfectly thanks to the solution provided here. The user can ...
0
votes
1answer
34 views

Ajax filter with custom taxonomies

I created a loop for my Custom Posts Type workshop with the lists of two custom taxonomies group and teacher on the same page. What I'm trying to do is create an Ajax filter with both taxonomies. The ...
0
votes
1answer
20 views

don't call ajax if not plugin page

I created a plugin that uses ajax the problem is that the plugin requests are loaded on the whole site and not only on the plugin page I need to call the function only on the plugin page plugin main ...
1
vote
1answer
32 views

How to make custom total price reactive in navigation

I created navigation for my custom template and added total price inside the <li></li> elements and it show the price if I add product to the cart, but if I add another product to cart ...
0
votes
0answers
12 views

Add a dropdown to filter CPT by tags

I have a page, in which it is shows posts in a custom post type called Podcast, and a custom category (podcast_category) called the-building-code. You can see my test page here - Test Webpage I want ...
0
votes
1answer
42 views

WP Ajax DB issues

I am having a weird issue in regards to getting data from a DB Table via AJAX. My outcome is to get the employees from the DB and into a dropdown list, but i haven't been able to get it to work. So ...
0
votes
0answers
17 views

how to make sure js is enabled before executing php function

I have a function that is in my post template and i need to make sure before executing the function that javascript is enabled. i have found a way using a cookie but it need to refresh the page twice ...
0
votes
1answer
14 views

How to keep scripts persistent during admin-ajax process when saving widget?

Is there a hook to keep scripts that are included with widgets, persistent during the admin-ajax.php process? I use jQuery show() to open an element within a widget and the element should remain ...
0
votes
0answers
16 views

External API integration in WordPress

I have API URL where I have access key and token along with JSON format. Now I need help as to how to integrate it. My clients need his form leads directly into his API. Below is the code with the ...
0
votes
1answer
29 views

Ajax: Populate <div> with content from a post's ID not working - duplicating current page html instead

Ok guys and gals, I'm losing my mind here... I am looking to append the content and a custom field of a post to a div on page. The ID of the content and custom field is defined by a data attribute on ...
0
votes
1answer
30 views

Bad request 400 using class based files

after digging through a lot of Ajax Bad Request 400 problems here on SO, that, unfortunately, didn't help me to solve this problem. After instantiating my custom post, I add a submenu page where I ...
1
vote
0answers
22 views

Admin Ajax always return 0 on form submit

I'm trying to make an ajax call on a form submit in WP. Call seems to be good, but response is always 0 ... I read that it meant that my call function was not found. But I believe my call is right. I ...
0
votes
0answers
6 views

Adjusting Prevent Concurrent Logins plugin to refresh the pages of older sessions

Is it possible to adjust the "Prevent Concurrent Logins" plugin to refresh "old sessions" browsers right after the "new sessions" logs in? The plugin works currently fine ...
0
votes
0answers
12 views

How to send AJAX answer but not die nor wp_die

Is there any way you could send an Ajax response from the server but keep the server doing other actions? Currently when we try to send the answer we use die or wp_die or wp_send_json_success, so the ...
0
votes
0answers
26 views

Admin Ajax always return 0

I'm trying to make an ajax call on a form submit in WP. Call seems to be good, but response is always 0 ... I read that it meant that my call function was not found. But I believe my call is right. I ...
0
votes
0answers
20 views

How to use Google recaptcha V3 inline badge with ajax request

I make a custom form with ajax request in WordPress. How i can validate the Google Recaptcha? This is the HTML/PHP code: <form id="traiteur_form"><div class="traiteurform-...
1
vote
0answers
10 views

Problems adding in-store product managers

I wrote a code to allow in-store product managers, without post editing permissions, and without other product editing permissions. I have a number of issues with the code, I would love to resolve. ...
0
votes
0answers
27 views

error when using reCaptcha v2 in wordpress custom login form!

I have been successful to create a custom login form by ajax and reCaptcha v2. every thing is OK but when the user enter incorrect username or password and submit the form, then enter the correct ...
0
votes
1answer
23 views

Admin-ajax.php 400 error in custom theme

It seems that this is a common issue. I have googled and searched Stack Exchange about this but didn't find any solution that helps in my situation. Problem: When trying to use Ajax with admin-ajax....
0
votes
1answer
37 views

AJAX jQuery post frontend returning failed to load resource status 400

I've created a custom post template for a front-end question bank/quiz in which I have two elements: A div which displays question text A button when pressed should trigger an ajax query to get the ...
0
votes
1answer
29 views

Ajax filter with loadmore button

I'm struggling with ajax filters mixed with a load more button. I will try to be as clear as possible I've got a custom post type called Companies. I've created a page listing all of them , they can ...
0
votes
0answers
59 views

Drag and drop multiple file upload using Ajax WordPress

How can i upload multiple files via drag & drop and browse with ajax. But I select and upload the file, it works. But when I drag & drop, Ajax's error is coming. My HTML Code here. <...
1
vote
0answers
34 views

Wordpress ajax doesn't display object method on jQuery .change() function

I'm coding a plugin that will be fetching data from the database and display it into a table. I want to get a page with a select tag that will always be on the plugin's main page, select something and ...

1
2 3 4 5
50