Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
1answer
10 views

Delete ACF repeater field row on Front End

I would like to delete row from front end. This is what i did : HTML : <?php $row = get_row_index(); ?> <tr data-rownum="'. $row .'"> <td> <span class="deletecontrat ...
0
votes
1answer
22 views

Loading two different AJAX requests on two different pages

I hav ebeen trying to call two separate AJAX requests, on separate pages, each pulling in their respective parts. Right now, it only pulls in ONE of the AJAX requests on both pages even with specific ...
0
votes
0answers
11 views

WordPress Media Grid - not loading pictures

The following page contains 2 media grid sections. The media grid under title: Finishes is not loading. I only see animated loading dots but the pictures won't load: http://acdwheels.com/brixton-...
1
vote
1answer
39 views

How to get Metabox custom field to show checked if value is updated using post meta query?

I have two radio buttons as custom metabox fields for pages/posts. One radio button has the value of "enable" and the other has the value of "disable". My radio buttons will stay checked only if I ...
0
votes
1answer
37 views

AJAX Breaking Offset Argument In WP Query

I have been using AJAX on my website successfully and for my category.php page I need to use the offset argument. Unfortunately, AJAX creates complications with offset and I get the same posts looping ...
0
votes
2answers
28 views

Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test

I've been trying to grasp AJAX for the past 12 hours and i'm slowly losing it. How can I simply pass two basic input dates via form or any other means, not refresh the page, and have it execute the ...
0
votes
1answer
14 views

admin-ajax.php slow website, how to fix

I have a function in my wordpress that load a dynamic css. I checked that this admin-ajax.php call made the website slow (+5s) about. add_action( 'wp_enqueue_scripts', 'theme_custom_style_script', 12 ...
0
votes
1answer
26 views

Search database with WPDB using a php variable

I'm trying to do a basic search feature for my website database. I want to search the text content inside a custom database table using Wordpress and WPDB. For some reason the search is not returning ...
0
votes
0answers
28 views

Ajax load more posts with Ajax taxonomy filter

I'm trying to create taxonomy filter with Ajax load more posts, everything is working except the first page on my template! I have a custom template page for taxonomy downloads as below the load ...
1
vote
1answer
29 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
0answers
26 views
+50

How to link Wordpress heartbeat to ajax form

I have a form that $_POSTs an input value, and user's ID that saves the data to the database: // frontend form <form id="form"> <input type="radio" name="location" id="name1" value="1"&...
1
vote
1answer
16 views

Wordpress Admin AJAX Serialize

I have tried to send serialized data via wordpress admin ajax, but i am getting output in below format instead of serialized format. reviewerNotes=approved&app_rej_posts=118059 Jquery Ajax ...
1
vote
1answer
17 views

Ajax posts filter by date, comments, top views, top likes

I'm trying to create a simple Ajax posts filter, It's working with date and comment but not working with the top views or top likes. So, how can i make the isset( $_POST['top-views'] and isset( $...
0
votes
0answers
13 views

Cannot transfer ajax post data from js to php file

I need to click on the button to send some data to the php file and update the user's balance in the database. quotes.js Part of the code: var data = { sell: sell_current_quote, buy: ...
2
votes
2answers
31 views

How can I rename the WordPress AJAX URL? [duplicate]

I'm currently looking for a way to change / hide the default WordPress admin-ajax.php URL. I want to do this to remove the admin from it to prevent misunderstandings by my customers when I use the ...
0
votes
1answer
30 views

Why does admin-ajax load slow and what are ways to speed it up?

I am developping a theme for wordpress which uses woocommerce. Currently I have developed a new page where I show the products. Initially I did the page and the filters for categories without using ...
0
votes
2answers
21 views

WordPress Ajax filter: Create two loops for different output styles?

I have two different pages, with filters. Those two pages, have different layouts and styles. I have three different filters for one page, where the output and style is the same. For the “newsfilter”...
0
votes
0answers
12 views

Get String returned by function get_the_title () and show it in Metabox without clicking on “Update” or “Publish” Button

I have the following code in my functions.php that shows or replicates the same text in Capitals of the "Title" field of a WP entry, in a Metabox that appears when the same entry is edited. ...
2
votes
3answers
139 views

Where to include php files in wordpress and how to refer to them later [closed]

I am currently creating a customize web page and I am willing to refer to a php file inside an ajax command open(GET,"url php",true) so my question is where to put my php file so that it would be seen ...
-1
votes
0answers
26 views

How to display query result using ajax within plugins?

Well,i want to fetch order details from database whenever user input correct order id in text box and submit button.The issue is when iam doing it using it without using ajax,its displaying order ...
0
votes
1answer
30 views

WordPress ajax-action how to return content

So I'm trying to set up an AJAX action for a plugin I'm building. When using /wp-admin/admin-ajax.php?action=beacon_podio-get_apps I was just getting hello world0 and I'm not seeing Request is ...
0
votes
0answers
7 views

How to get post content when click on menu using ajax?

I am thinking to get post content without reloading the page using ajax. Is there any suggestion?
-2
votes
1answer
29 views

Ajax load more posts button

I'm trying to use this tutorial but it doesn't work: https://artisansweb.net/load-wordpress-post-ajax/ Correct order is: Post 4, Post 1, Post 3, Post 2. The first 2 posts are OK (before click), but ...
0
votes
1answer
35 views

No errors in the console but Ajax call doesn't seem to be working

Trying to get a dynamic filter working which will filter a custom post type by custom taxonomies on click of a button. Was getting an error of ajax_url is undefined but I think I have solved that part....
1
vote
0answers
13 views

Why ajax doesn't work on certain wordpress hooks and reload the page instead?

I built an ajax function which works perfectly when i hook it to admin_head or admin_notices hooks but it doesn't work when i hook it to manage_posts_extra_tablenav hook, instead of doing the ajax ...
1
vote
0answers
16 views

Why ajax doesn't work on certain wordpress hooks?

I built an ajax function which works perfectly when i hook it to admin_head or admin_notices hooks but it doesn't work when i hook it to manage_posts_extra_tablenav hook, instead of doing the ajax ...
0
votes
0answers
22 views

autocomplete in wordpress using ajax with json-data

The scenario is whenever client press the key, automatically the suggestion should come below the text box, and that suggested value is fetched from the database. Here i am stucked in a situation ...
-1
votes
1answer
62 views

external api call dont know what i´m doing wrong

Hi I'm trying to make a Call to the API I'm pretty new to PHP so if there is an obvious mistake enlighten me. <form method="POST" action=""> <div class="...
0
votes
0answers
15 views

List current category children on form results that uses AJAX

Ok I will try to describe my problem as best as I can. I have a website with ad listings. On listings page there is a filter form which has categories list on the left that uses AJAX to print results ...
0
votes
1answer
27 views

How to change response of admin-ajax request?

Request generated by fullcalendar js, which implemented by plugin WP FullCalendar (github link for code) Request url: http://sitename/admin-ajax.php?action=WP_FullCalendar&type=event&month=...
0
votes
0answers
17 views

Wordpress and woocommerce impossible to set variable in admin ajax in plugi devlopment

i got a problem in my plugin development. My class got some variable and i want to stock product from woocommerce on it. I use ajax to search product on my database and it work fine, but when i call ...
0
votes
1answer
26 views

Getting the post terms 'wp_get_post_terms' per post when within the functions.php file

I have used a form with an Ajax action to pull post information through on submit. It works a charm. However, I have used categories to separate the work into categories. One of which is the brand. ...
0
votes
0answers
23 views

How to display custom post type pagination buttons when processing AJAX request

Good morning everyone, I am trying to filter posts using ajax by custom fields and custom taxonomy values from a custom post type. Ajax request works fine, It retrieves all needed data to display, but ...
1
vote
1answer
55 views

Conditional action hooks

Im developing an plugin that uses AJAX, but im having trouble controling the codeflow. I want to hook functions after running conditionals. My hooks wont fire when adding them inside a control ...
0
votes
0answers
20 views

Filters posts using AJAX and then reset query with a button

I am using ajax to filter a custom post type. I want to add a "reset" button that destroys the ajax session and shows all posts instead of the filter. The filters are activated on change with query. ...
0
votes
1answer
10 views

Preprocess submitted data

I created WordPress module, which adds my custom field in general settings in WordPress Admin. However after submitting whole form in admin settings, I need to modify my field's value before saving to ...
0
votes
1answer
16 views

Getting a GET error in console - 404 not found for wp-json

I am trying to use ajax for a Load more posts button on a Custom Post Type In my functions file I have this: add_action('rest_api_init', 'custom_api_get_news'); function custom_api_get_news(){ ...
0
votes
0answers
35 views

Display all posts by default, then use ajax filter on categories

I've got this in functions.php: add_action( 'wp_ajax_nopriv_load-filter', 'prefix_load_cat_posts' ); add_action( 'wp_ajax_load-filter', 'prefix_load_cat_posts' ); function ...
0
votes
0answers
12 views

Log with Query Monitor during AJAX

I am trying to log my own messages using Query Monitor API, which I found in the code, like \QM::info($msg), \QM::error($msg) etc. But nothing is written to the query monitor console or developer's ...
0
votes
0answers
19 views

Ajax Issue for Add Media (Not All Images Load)

I'm working on a website that has over 300 images, using WordPress 5.1.1 with Classic Editor enabled. In Media Library, I can view all the images since it uses pagination. However, when I click Add ...
0
votes
1answer
28 views

Retrieve custom post types by custom taxonomies with WP_Query

I am trying to filter custom post type data using ajax. For that, I display some custom taxonomies as select tags. I've been trying for 6 hours to retrieve custom post types using WP_Query with these ...
0
votes
2answers
53 views

All AJAX requests return a 400 error

I have been delving into AJAX within WordPress and have followed many tutorials on how to do so, but every single request returns a 400 error. In my functions.php I have added the following: Step 1 -...
-1
votes
2answers
22 views

Load css classes after using ajax calls

I wan to add a responsive div to my wordpress page using bootstrap css, just when i enqueued bootstrap style it distroy themes, so i wan to make that div load using ajax call, call that enqueued style ...
0
votes
0answers
70 views

Is there a way to disable ajax add to cart for specific products on single product pages

I would like to disable ajax add to cart for specific products, products that have add on's enabled by the Woocommerce product add on plugin as ajax add to cart is not compatible with products using ...
0
votes
0answers
30 views

call to jquery ajax failing with 500 error when passing extra data field

I have the following jQuery for doing an Ajax call and it works fine: jQuery(document).ready( function($){ $( "#mystatus" ).change(runMyStatus); function runMyStatus() { var mystatus = this.value;...
0
votes
1answer
23 views

AJAX on Front-End Button Click not working - Custom Plugin

I'm trying to make a custom plugin, and something that should be simple is giving me a huge headache. I followed the Wordpress Codex example exactly and have looked at countless similar posts but ...
0
votes
1answer
15 views

Registration form AJAX check for existing username (simple version)

I know they are already many questions related to this topic but I was looking for a simple way to make an ajax check for an existing username. So basically I have the HTML form and two functions (in ...
-2
votes
1answer
34 views

Detecting IP Address of someone using 'copy' function [closed]

Is it possible through WordPress (through a plugin, PHP or otherwise) to detect the IP of someone copying (ctrl+c) content on my website, and have that data sent/displayed to an admin? Appreciate ...
1
vote
0answers
48 views

Repeating admin-ajax.php not found error in admin

I seem to be getting a repeating 404 error in the Chrome console when in wordpress admin very occasionally it gets marked as a 500 error for the same line, perhaps is something to do with an ...
1
vote
1answer
90 views

WP /wp-admin/admin-ajax.php produces 404

Our site has been working fine in the last week. Today, I can't add a new page to our menu. Clicking "Add to Menu" just produces a spinning icon that never disappears. If I look at the Chrome console,...