A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
9 views

How to generate MySQL automatic Application id

I have web application using PHP and MYSQL. I have application form i want to generate automatic application form number which is count number of row inside Mysql then add value + 1
0
votes
0answers
16 views

custom mailchimp form using HTTP API

I have a simple <input type="email"> that I want to use to create a subscription form for mailchimp newsletter. I will use the HTTP API and no plugin, this because I think this will be less ...
0
votes
1answer
22 views

Change AJAX filter from POST to GET for URL Parameters

I have a well defined AJAX filter, in two parts, one for a load more button, and one for a selection of drop down filters. Both reload a list of properties on the front-end in AJAX, and work together ...
0
votes
0answers
7 views

To create a dependent select dropdown with multiple taxonomies?

I want to create a dependent dropdown with an ajax call in WordPress. Suppose I have a custom post type named Uniblog with custom taxonomies Countries, Courses, Levels and Intake. I want to create a ...
0
votes
0answers
21 views

AJAX request from Chrome Extension to Wordpress Website

I developed a chrome extension which extract some data from the user visiting page and I want to transmit them to my database by an AJAX call (my website is a basic wordpress website). The point is ...
0
votes
1answer
22 views

Ajax call to my Wordpress website from an external application [duplicate]

I have on website on wordpress and a external web app. I try to make an AJAX call from this external web app to get some info from my wordpress site/ database but i got an error message 400. Here is ...
0
votes
1answer
25 views

Wordpress sound bell when new data will add

I'm working to add a bell notification when any new data row inserted in the attached table this will give sound bell. (very similarly when we receive new message we get notification sound bell on ...
1
vote
1answer
21 views

jquery not calling php function

I just can't seem to get my jquery to call my php handler function in my plugin. Please help. TQ UPDATED : I updated the codes. It is working now. My php file // INIT function nizam_scripts() { ...
0
votes
0answers
25 views

How to make tabulator ajax call in wordpress?

As per tabulator documentation the ajax request can be made using the format like this Ajax documentiation : http://tabulator.info/docs/4.5/data#ajax var table = new Tabulator("#example-table", { ...
0
votes
0answers
11 views

How to fix WordPress Ajax call loading endless? [closed]

I am currently developing a WordPress site called https://fishnmeats.com/ and I am having issue with it's Ajax call ... Because if we click on any action they loads Ajax for live time update is not ...
0
votes
0answers
11 views

How to add gallery images to custom post from frontend [closed]

I want to add functionality of gallery images where user can add the images for the gallery which will be attached to the custom post type. I need to do this with help of Ajax
0
votes
0answers
16 views

Autosuggest endpoint ElasticPress [closed]

The only other SO q&a that matches this question is out of date and no longer works. I thought autosuggest was a core, enabled feature of ElasticPress out-of-the-box. This does not appear to be ...
0
votes
0answers
14 views

Add extra cost to shipping method itself in woocommerce

I found the following code from this link: https://stackoverflow.com/questions/52138784/add-a-fee-based-on-shipping-method-and-payment-method-in-woocommerce The code works great if you want to add ...
0
votes
1answer
16 views

ajax response strips multidimensional array and unable to decode

I am using the wp_ajax_ and wp_ajax_nopriv_ in localize script I am passing a big multidimensional array( it's big!). It works without any JSON encode, decodes. But I want to encode it is while I make ...
0
votes
1answer
25 views

Move some posts to end of sort order, even if there is a sort in the wp_Query already

I have a site that lists properties for sale. I have a custom wp_query, with a sort dropdown I created. This dropdown reorders the posts query by date, price (low-high & high-low) and beds (low-...
0
votes
0answers
20 views

$.ajax results in 403 forbidden

I am trying to fetch debug information from a piece of javascript, to make it easier to copy the debug information code (if find my self often doing this). However, when I send a request to a page, ...
0
votes
0answers
6 views

Pass data to hidden field Gravityforms in Ajax popup Fancybox

Currently I'm working on a project where we use Gravityforms to generate a lead form. We have a list of posts on an archive page where we have button. Once the users clicks on the button a fancybox ...
0
votes
1answer
34 views

Ajax not sending the data correctly- Multidimensional array

I have a big multidimensional array being sent as ajax post. But in some servers, it does not send the data completely a portion at the end of the array is being cut out. Is there any limitations? ...
0
votes
0answers
18 views

How to make 'show_option_all', that comes from wp_list_categoreis, to work with get_categories or with get_terms?

My problem is that I want to make an ajax category filter, where it shows the categories, but also to have a button "all Posts" so the user can go back to viewing all posts. My current code is using ...
0
votes
1answer
16 views

400 bad request admin-ajax file upload

I'm having some trouble while I'm making an upload plugin. I'm using ajax to do the upload, but during the first test I get a 400 bad request error. Is there a fix for this? Here is the js code (...
0
votes
1answer
20 views

WordPress Pagination with ajax - Dots

I am using paginate_links() along with pagination. It works whenever a number is clicked but if I click 3 dots stays there so no 4 pages can't be selected. Is there any workaround?
0
votes
0answers
11 views

Add upload progress bar for ajax upload form

Is there any way to add a progress bar to an ajax upload form in wordpress? I've searched here for a similar question, but I was not able to found nothing.
0
votes
1answer
22 views

jQuery AJAX url wit variable

For an AJAX call I try to get the url from a variable jQuery(document).ready(function($) { var url = 'test'; $.ajax({ 'url': url, 'data': ({todo: "food-page_catfetch"}), 'success': ...
0
votes
1answer
27 views

Add “All Posts” button to custom post taxonomy filter with ajax in wordpress

Does somebody know how to add "All Posts" button to my custom post ("albums") with custom taxonomy ("album_category")? I can see my categories (Mixing, Mastering, Production) and when I click on them ...
0
votes
1answer
15 views

how to handle multiple ajax wordpress queries?

I am having a problem with two ajax action. I have a post grid it has a frontend sorting "ASC" and "DESC". So if I click on "DESC" it changes the WordPress query arg "order by" to "DESC". It works. ...
0
votes
1answer
11 views

Search for categories

I would like to propose on my site a search engine allowing to find categories (with suggestions), and not posts or pages. I tried different plugins, including ajax search lite, but without success, ...
0
votes
1answer
34 views

Put CSS inside a PHP file and include it the right way

I want to put CSS inside a PHP file, because with that I can use 'conditional CSS', depending on the value of a customizer control. My idea is to create a new php file, somewhere in my theme ...
0
votes
0answers
15 views

How to get a list of users who like a current wordpress post & remove post dislike & comment like/dislike system

I have the code, the code working fine. But i want modified somethings. //function file add_action( 'wp_enqueue_scripts', 'sl_enqueue_scripts' ); function sl_enqueue_scripts() { wp_enqueue_script(...
0
votes
1answer
44 views

400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true

As Salamu Alaikum, I am working wp_ajax and try to upload a file through ajax. When I processData: true it returns error illegal invocation on file upload. But when I set processData: false it returns ...
0
votes
0answers
13 views

Custom Meta Box (SELECT2) Giving Wrong Taxonomy Tag

I have update this code, Category taxonomy working fine, but tag taxonomy not working. /* * Add a metabox * I hope you're familiar with add_meta_box() function, so, nothing new for you here */ ...
0
votes
1answer
36 views

Remove entire [$key] from array stored in custom field using Ajax - unset($array[$key]); not working

I'm looking to use Ajax to delete the key [1] from the following array which is stored in a custom user field and then re-save it... I am trying to do this by using unset($array[$key]) then saving ...
0
votes
0answers
37 views

Unable to delete attached file from folder programmatically

I am unable to delete attached files from their folders programmatically or even through the wordpress admin as the admin user. The attachment record deletes from the database but the file remains in ...
0
votes
1answer
21 views

Foreach-generated custom tax queries, each with an ajax “Load more” button

I'm looping through custom taxonomy terms to create a WP_Query for each term, then displaying the posts on the front-end. I'm also attempting to adapt this helpful tutorial(and accompanying comments) ...
0
votes
0answers
11 views

Can't make lazy load for my site, help!

I am trying to make a custom AJAX lazy load, load more posts system on scroll but not able to make it. As I am working on my custom WordPress theme, it is hard for me to make lazy load while keeping ...
0
votes
1answer
34 views

How to know what page is calling admin-ajax.php?

The original goal is this: all users can add and remove images from the page on front end, but, they can only see their own images. When in the admin part of the website, administrators should see ...
1
vote
1answer
162 views

Ajax gives 400 error

Basically I am trying to fire an ajax call in an Elementor widget. So I have a button on the click it executes a function in the widget class. To elementor basic template I have added this. ...
0
votes
1answer
25 views

400 Bad Request, in wordpress theme development, wp_ajax

As Salamu Alaikum, I am developing a theme and I have tried every way of getting a successful ajax request and it is still showing me the 400 bad request error. And there is no solution I found going ...
0
votes
1answer
15 views

React to AJAX adding to the page

How can I have my JavaScript run every time AJAX finishes adding content to the page? My JavaScript file loads and runs, but only on first page load. I'm looking for the equivalent of Drupal....
0
votes
0answers
35 views

How I could save IDs of search results of FacetWP in DB?

I would like use FacetWP along with ACF in order to create Questions as CPTs that will have difficulty, grade, rating and other like that fields and I want to be searchable using WP AJAX. Those ...
0
votes
0answers
19 views

How to write the backend for a simple single page application

I want to write a small app on a particular wordpress page which should have following basic functions: After choosing an item in a drop-down menu, get respective information via a GET request (AJAX?)...
0
votes
1answer
32 views

ajax_object is not defined when ajax calls the function

When I call a function in PHP using ajax I get Uncaught (in promise) ReferenceError: ajax_object is not defined html2canvas(document.getElementById("primary")).then(function(canvas) { ...
0
votes
1answer
19 views

Rate limiting ajax requests in WordPress

I have using ajax requests in my website to verify data provided by user. Already I'm using wp-nonce with minimized lifetime. But unlimited requested are triggered on that ajax action so help me to ...
0
votes
1answer
19 views

Wordpress is setting from header wrongly in wp_mail

I am sending a contact email using ajax on wordpress on submit. From the code below you can see that the FROM header is correctly set but instead wordpress is picking the header from phpmailer_init ...
0
votes
0answers
11 views

How to execute/run a JavaScript file everyday

I am working with the https://www.themoviedb.org/ API to fetch data tv shows. For tv shows under "Airing today", I need to update those shows every day.I have implemented data fetching and saving to ...
0
votes
0answers
32 views

gform_after_submission does not work on ajax enabled form

I have a Gravity Forms multi-step form. I need to run my own function when the form is submitted so I'm using the GF hook 'gform_after_submission' The hook works perfectly on forms that do not ...
1
vote
1answer
33 views

Get Author Post on author.php with AJAX

Hi I'm trying to display post by author on author.php but I can't get the author ID. domain.com/author/user_23/ ( display post from that user ) JQuery jQuery('#menu_posts').click(function(){ ...
0
votes
0answers
15 views

Is a global nonce a bad idea?

I'm trying to build a central system that will delegate certain functionality and serve me some nice things when dealing with AJAX calls. Basically, I want to dumb the whole charade of checking ...
0
votes
0answers
30 views

TinyMCE code works as Theme Template File But Not as Short Code

I have a strange problem I'm hoping you can help me with. The following code works fine in a template file for a theme. But it does NOT work as code in a class in a plugin for a short code. I am ...
0
votes
1answer
22 views

Attend event form with ajax

I've created a Wordpress website with gigs from a band. All the logged in users can select if they've attended that specific gig. Something like setlist.fm. So I've created a new table ...
0
votes
0answers
32 views

AJAX numerical pagination problem in TwentyFifteen-child theme

I want to create a Ajax Numeric Pagination. And found code in a website. And it's work perfectly in first click event, but in second click it doesn't. And clear example is if I click in pagination ...