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

How to load the page first then download the file with content-disposition?

Let me start by explaining what I want to achieve first. I have a download page where the user enters a URL with params example.com/join/123/456, where 123 is userId and 456 roomId it then connects ...
0
votes
1answer
19 views

WordPress is creating nonce as a logged in user but verifying it incorrectly

I'm having trouble validating a nonce created with wp_create_nonce() inside a hidden input with the name nonce in an html form: <input type="hidden" name="nonce" value="<...
0
votes
0answers
12 views

WooCommerce Load More Button functionality problem

I have a load more button (using this tutorial: https://rudrastyh.com/wordpress/load-more-posts-ajax.html) that I am using on a woocommerce product page. It all works great apart from when I click ...
0
votes
1answer
16 views

Is it possible to create new user from external form using REST API?

I created a new user (called external) in a WordPress site with manage users capabilites. I installed Application Passwords plugin to generate a token for that user. Now is it possibile to create a ...
-1
votes
0answers
11 views

Display category name , category posts and create pagination using ajax [closed]

Display category name , category posts and create pagination by clicking on category name the related category posts need to show using ajax
0
votes
1answer
15 views

jQuery Ajax not loading page with ACF fields

I'm using the following jQuery code to load contents from a template part into another on click. Without the ACF PHP tags, it works. However, when I add these tags in <?php the_field('field_name'); ...
0
votes
0answers
7 views

How to set Load more button for custom taxonomy products using Ajax

I want to show more products for Load more button but my tax_query is not working for that particular taxonomy category. So how can I get the current taxonomy name to find the products? My Taxonomy ...
0
votes
0answers
21 views

WooCommerce undefined variable “notices” for AJAX Add to Cart button

I'm currently developing a website with WooCommerce. I'm using AJAX for the "Add to cart" button on the Product page. In debug mode I have this message when a user add a product to his cart: ...
0
votes
1answer
30 views

WP ajax requests not stacking?

My ajax requests work individually, (if I wait for each request to return before submitting the next), but if I submit a bunch of requests at the same time, (eg click multiple buttons), only the last ...
0
votes
0answers
8 views

Wordpress ajax serial processing of and sending

I want to install/activate plugins via ajax.But i want to add a loading class on plugins list item which is being installing or activating. In jquery If i want to do it i need to write a lot bunch of ...
0
votes
0answers
15 views

wordpress admin-ajax.php blocking with Pop-ups?

I am using Pop-ups and want to place a table inside the pop up. It will not display due to admin-ajax calls being blocked for some reason. Is this a standard that happens with other pop-ups and what ...
0
votes
0answers
11 views

ERROR while passing data from JS to PHP via AJAX

I'm strugeling with this ptoblem for a while. Need to pass data from JS to PHP on wordpress site. The error: <script> function activatePlacesSearch(){ var input = document....
0
votes
0answers
9 views

AJAX filter not working with Google API state data

I've made an AJAX filter to filter my WordPress custom post type (agenda) posts. Now i have made it possible to select a location, and if this is set. I want users to be able to filter these on there ...
0
votes
1answer
5 views

Infinite Scroll appending Next Product Category Term pages

I'm using Infinite Scroll and the following great code from here to generate Next Taxonomy Term Link in a term loop. I want to ajax append Next Woocommerce Product Category when you reach the end of ...
0
votes
1answer
46 views

Unable to parse JSON response from wp_send_json_success

Trying to do this the WordPress way: wp_send_json_success PHP processing save_form return: $response = array( 'messages' => $message ); wp_send_json_success( $response ); jQuery: ...
0
votes
1answer
16 views

ajax form is returning the dreaded “[HTTP/1.1 400 Bad Request” and a zero

I've read dozens and dozens of posts on this error and I'm still not getting it. So, I'd like to add to the plethora of ajax 400 discussions. This is a plugin that displays/validates/records a simple ...
0
votes
0answers
13 views

Can't search posts using WP_QUERY inside AJAX Function

WP_Query is used to get posts via simple arguments provided by it. WordPress provides an argument called 's' for search. It basically searches content of all posts and lists the ones with that string ...
1
vote
1answer
40 views

How to save Clicks of a download link button while it doesn't matter if we refresh the page or again login/logout

I am working on a wordpress site and i am little stuck into one situation , what i want is that:_ I have one resume page, which shows resume posts from wp_postmeta table and each post have a downlaod ...
1
vote
1answer
39 views

Shortcode button dosent work for all posts. Work for first post only

I am creating a custom wordpress theme and i am little stuck in one situation, Actually i added a download link button and add some Java Script on it. The button on all posts showing and downloading ...
0
votes
0answers
14 views

Custom ajax registration

I have custom registration page, i want after registration redirect to home page. Via ajax i successfuly send data to backend and added user, but i have some problems with ajax, i cant get response ...
0
votes
1answer
19 views

How to get specific string/value from an array? php [closed]

I am creating a custom wordpress theme and i am little stuck in one situation. I created an array $ark and get some values in it <?php $ark[] = esc_url( add_query_arg( 'pdff', $post->ID ) ); ...
0
votes
1answer
10 views

WPBakery post content inside Bootstrap Modal

In a wordpress page I have a list of posts, each one links to a Bootstrap Modal where I want to load the post content. This is my PHP function (inside a custom plugin). Gets the post ID and return ...
0
votes
0answers
17 views

Wordpress Settings API using angularJS

i'm trying to update Wordpress General Settings page with AngularJS with a $http.post $scope.update = function(genSet){ $scope.generalSettings = angular.copy(genSet); $http.post('options-...
0
votes
1answer
34 views

coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error

I have a WordPress Frontend Form, that uses AJAX to save data. The form is processed in backend obviously using PHP post, I did a simple solution to inform form submission errors to users if the form ...
0
votes
1answer
19 views

Content including hooks inside wp-settings.php are being called twice in WordPress

I found that init hook is being called twice and then I try to trace and find out wp-settings.php is also being called twice. I originally want to post a question to find out why. And after some code ...
0
votes
1answer
25 views

Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?

Help! Cannot figure this out. I have built a plugin based on this tutorial that gives a user the ability to export a post from a custom post type into a formatted PDF using FPDF. As it stands, the PDF ...
1
vote
1answer
30 views

Slow WP_query due to nested wp_query. Need Suggestions

I'm facing an issue of slow queries. As I'm not that familiar with the WP_query, I managed to solve my problem with nested wp_query. https://it.zoetalentsolutions.com/technology-provider/aws/ in the ...
0
votes
0answers
6 views

Exporting and Importing WordPress Media Libraries and Galleries in XML Files

Failed to import media into WordPress Exporting and Importing WordPress Media Libraries and Galleries in XML Files Hi I used the WordPress Export file to export my site, [Tools> Export] and it ...
0
votes
1answer
23 views

Opening Modal popup on Ajax form submission

I´m migrating a form from an old website to a new one, but the jQuery modal that should open after the AJAX form submission doesn't work. You can test it here https://tomlab.dreamhosters.com/sign-the-...
0
votes
0answers
19 views

mailchimp integration on a custom footer

I want the user to be able to opt-in to a MailChimp newsletter within a custom footer, which one. of our clients has asked for. The client also uses MailChimp so we therefore cannot use anything like ...
0
votes
0answers
22 views

Woocommerce Variation product added twice to cart

I added in my theme custom ajax function add to cart. Just same like instruction $product_id = apply_filters( 'woocommerce_add_to_cart_product_id', absint( ($_POST['variation_id']) ? $_POST['...
1
vote
2answers
37 views

Ensure function has completed before allowing another Ajax call

I am updating an array saved in a users meta field using an ajax function. The values added to the array are taken from the data-attributes within the tags which also act at the trigger to make the ...
0
votes
1answer
9 views

Use a template for a specific url slug without creating a page

So, I'm grabbing a list of posts from one blog to another using the Wordpress API, I got the list of posts but now on click I would like to show the content of each individual post on my new website. ...
0
votes
1answer
44 views

How to change PHP variables with AJAX request in WordPress

I have a html form with select boxes and I want to display different data depending on what the users select. All I really need to do is change 1 variable in php based on the selection. I make an ...
0
votes
0answers
21 views

ajax call return 406 not acceptable for non logged users only

I wrote an ajax call to retrieve some info to print markers on a map: if(jQuery('#mapa_general').length){ var url_marcadores = 'http://localhost/rutaVino/wp-content/plugins/establecimientos/assets/...
0
votes
1answer
22 views

Database query and get_user_meta return incorrect data

I have a PHP script that gets details from a checkbox and a text field. The console.log data is correct and so is the updated data in the database, however, when I try and get the data, using $wpdb or ...
0
votes
1answer
30 views

Does $this context change in an AJAX callback?

When trying to get data within an instance of a plugin, all of the PHP methods defined in our plugin class file can "see" the data that was just set for a certain property. However, when we ...
0
votes
1answer
24 views

Load more posts in the same category - Ajax + Timber

I use Timber with WordPress. I'm trying to create a list of posts with a "Load more posts" button. I would like to display 10 posts of the same category and to load 10 others posts of the ...
0
votes
0answers
10 views

wp_ajax response not formatted correctly after adding new category via edit-tags page

This issue has existed in my WP instance for a while and I've been banging my head against the wall trying to fix it. Here is the issue: Adding a new category is successful, but the page doesn't ...
0
votes
0answers
14 views

Run a function after a certain admin-ajax call

Is it possible to run a function after a certain admin-ajax call is completed from wp-admin? That ceratin admin-ajax action is being called from a plugin. So, can not touch the plugin. But will have ...
1
vote
0answers
30 views

wordpress admin ajax url rename

I came across this topic : How can I rename the WordPress AJAX URL? on trying to rename the url for the admin ajax.php file. I tried the code suggested by Krzysiek Dróżdż which is this // This will ...
1
vote
1answer
8 views

Javascript / Ajax Error After Migrating To New Domain Name

I have migrated a client's site from their old spammy domain to their new domain that better represents their business. However, since the move, there seems to be some kind of Javascript/Ajax issue. ...
0
votes
0answers
18 views

How to use Load more button ajax in wordpress for post

I'm trying to display a click event for displaying the posts list in WordPress. I've used my template file for this code. template loadmore.php <?php /** * Template Name: Ajax pagination Template ...
0
votes
0answers
18 views

How to change this ajax function to submit to the default wordpress content area instead of the custom field 'seller notes'?

I am stuck editing this form submission. When a user fills out the form, I want to map the 'stm_seller_notes' to the default wordpress content area. There are two problems I am trying to solve, stop ...
0
votes
1answer
13 views

Ajax sometimes work and sometimes just don't work

So ive create load more posts using ajax following tutorial i found online. At first it works when there's just one button and so i create another one, and it works at first try but when i try again ...
0
votes
0answers
18 views

My function containing a mysql query launched by ajax is not working in wordpress. What am I missing?

I am trying to insert rows into a table I've set up based on user's answers. I have made a child theme and a custom template for the page with the form. My issue is that I have no way of knowing what'...
0
votes
0answers
22 views

Woocommerce paging incorrect url

I have a problem happening with the paging on a page, which is using the woocommerce plugin. Locally the paging works fine, and the 2nd page button(or the next arrow) points to: somePage/somePage/page/...
0
votes
1answer
35 views

Problem when sending file via ajax

I am trying to send a file via ajax but I get a 400 bad request error. My code data.coverQuestions.medicalMalpractice.file = docFile.prop('files')[0]; $.ajax({ url: '/wp-admin/admin-ajax.php', method:...
0
votes
1answer
20 views

AJAX Load more on CPT returning random posts

i have pieced together a post grid loop with AJAX Load More button for posts from a CPT category but I cant get the offset to work properly. There are supposed to be 6 posts per page but at the moment ...
0
votes
0answers
14 views

custom post query with ajax or some other option to refresh posts based on user selecting from dropdown menus on page

I have a page that lists all custom posts of type "the-talent". I have three Dropdowns each with a custom taxonomy (level, location, and specialty). I have a on-click function that grabs ...

1
2 3 4 5
48