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 ...

learn more… | top users | synonyms

0
votes
1answer
25 views

Ajax not working in my plugin ( frontend )

I'm trying to add a live search function to my website ( frontend ), but it isn't working and keeps returning 0. I've tried all possibilities but nothing is working. Could someone check my code ...
0
votes
0answers
7 views

Ajax Search results via Fancybox

What I'm trying to do: when the user clicks on the search icon, I open a lightbox overlay via fancybox. In the lighbox there's the search form where the user should type his search terms, hit the ...
0
votes
0answers
18 views

Ajax category pagination problem

I want to make a pagination or load more button for my ajax category display. Here is my attempt, I have no idea how it can work out. Any ideas? add_action( 'wp_ajax_nopriv_load-filter', ...
0
votes
1answer
40 views

ajax request not returning the result

i am using custom plugin to display the values on the wordpress admin side.. My Jquery html file is <script type='text/javascript'> jQuery(document).ready(function(){ ...
0
votes
1answer
30 views

How can I run shortcode after click with ajax

I have a little problem and need your help. I have tabs on my page and in one tab i have google maps. This tab is hidden by default and when i clik on it, i can see only small piece of maps. Map it is ...
0
votes
1answer
25 views

Using AJAX in WordPress Widget

The past few days I've been Googling and searching for answers to no avail. I'm building out a "Featured Content" widget where the user can easily (via ajax/jquery) search for posts. Is it possible ...
-2
votes
0answers
30 views

Woocommerce Shipping Calculator Dynamic Country/State/Postal Code fields [closed]

I have Woocommerce 2.1.12 with a shipping calculator on my cart page. I have it tied into the Fedex API to estimate shipping costs. Which means the user has to fill in Country, State/Province, ...
0
votes
2answers
41 views

Manipulate retrieved ajax data in php

I made a basic ajax request to 2 variables. I want the values to be sent and manipulated in the back-end in order to use them in a database query. All that should happen on page load. My main.js code: ...
0
votes
0answers
49 views

Unable to pass variable from jQuery/AJAX to PHP

I'm trying to pass the Post ID of an Option in a Select Drop Down field in Gravity Forms through jQuery/AJAX in order to be used in a different PHP function to dynamically populate a second Select ...
0
votes
0answers
29 views

Multi category dropdown doesn't work can't select subcategory

I've been working on multiple dropdowns where the first dropdown selects the parent category and the second the child of that parent. Now the form pops up and i can select the main category fine, but ...
0
votes
1answer
41 views

Ajax +wordpress onClick link redirect to new page and create html content

i have two pages in my wordpress plugin index.php charts.php in index.php i have some content and some link.. <a onclick="show_trend()" >Trend</a> while clicking this link ,i have ...
0
votes
2answers
34 views

Creating a new div onclick wordpress+ajax

I have a link in worpress page <a onclick="show_trend()" >Trend</a> and i am calling an ajax function onclick. function show_trend() { // This does the ajax request $.ajax({ ...
0
votes
0answers
7 views

Get the page address when using ajax

I have a page that uses jQuery to update some content. I want to run some PHP functions based on the url of the page. However, when I get the url of the page using PHP it returns the path of the WP ...
-1
votes
0answers
14 views

WooCommerce AJAX on add to basket not always working [closed]

I have an interesting issue with a WooCommerce instal which is actually two issues around the same thing (I think). Issue 1 The first is to do with the AJAX fired when you click add to basket on ...
2
votes
0answers
52 views

Chopping up a large ajax request of around 200 posts

I've put myself into an uneasy situation, where I have roughly 200 posts I need to load in with jQuery .load(). Nothing shows up until the whole .load() has executed, of course. Takes roughly 3 to 4 ...
0
votes
0answers
10 views

How to stop writing content twice on Wordpress using ajax?

I've been using javascript and ajax to do some post request inside a page and everything seems to work fine. Later on when content got more complicated I stop writing HTML code with javascript and I ...
0
votes
0answers
15 views

How to build new WP_Query using url

How to build a WP_Query using a url in wp_ajax_nopriv action. I have a following url for example: "http://example.com?paged=2 so I need to build a WP_Query which will retrieve a second page of posts. ...
0
votes
1answer
13 views

Ajax autocomplete based on usercode

I am trying to build a webform with autocompletion. The user can fill in a personal code and the related fields will be shown in the form fields. How can I fetch the results into my form fields? ...
0
votes
1answer
49 views

Add php function into .js file (for tinyMCE button)

I am creating a tinyMCE button for the wp WYSIWYG editor. Basically what happens is when a use clicks on the button a modal form pops up and they have to enter a few fields. However One of the fields ...
0
votes
0answers
42 views

wp_editor() in content that was loaded with ajax

I try to use wp_editor() in content that was loaded with ajax, but none of the required files and some other configuration script not loaded : The structure of ajax is something like this: function ...
0
votes
1answer
26 views

Admin WP List Table Columns Missing

The wordpress admin tables used on pages like www.example.com/wp-admin/edit.php uses a class class-wp-list-table.php In this class there are two functions that hide specific table columns with ...
0
votes
0answers
34 views

Grab the Post ID created by wp_insert_post($post)

Okay apparently there have been at least a few people already asked this question (1, 2), but none seems to get the right answer... wp_insert_post() and the following update_post_meta() & ...
0
votes
1answer
42 views

Ajax contact form return 0

I have a contact form that I want to submit using ajax. It seems like send the data, but the only retrieved is 0. HTML form: <form method="post" ...
1
vote
1answer
62 views

When using javascript to dynamically add a textarea, how can I render it as a tinyMCE editor (in wordpress)?

I have a plugin that allows the user to dynamically add sections that need to have the tinyMCE editor in them. The jQuery clones a div and places it into a container. One of the input boxes is a ...
1
vote
1answer
61 views

Why use wp_send_json() over echo json_encode()?

When sending a JSON response back to an AJAX request, why use the WordPress function wp_send_json() and not echo json_encode()? What is the benefit of using the WordPress function wp_send_json() over ...
1
vote
1answer
32 views

Plugins not working on AJAX requests

I have an AJAX request that retrieves information from a function I coded in my own plugin, here is how I set the ajax function: function my_ajax_function () { do_action('my_plugin_function'); } ...
-1
votes
0answers
95 views

Edit the database using AJAX

Putting it as simply as possible, I have a form that adds a row to the WP database, and an options page that displays both the form, and the appropriate rows from the database. I want to make it so ...
0
votes
0answers
32 views

Ajax doesn't work on second call

I'm using Ajax to load posts into a sidebar that are filtered by a chosen category. It works perfectly fine the first time, but for some reason the second time it loads a mixture of results from the ...
0
votes
0answers
24 views

What is the right way to include my Ajax script in wordpress [duplicate]

I've searched around for a solution to my issue to no avail. So here it is: I have created custom meta fields in the user section within the admin area. There are two fields in total, both select ...
0
votes
1answer
55 views

Ajax - Call to undefined function get_option()

So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left ...
0
votes
1answer
41 views

How do I convince this button to do something when it is clicked?

I'm trying to use ajax to give me an alert when I click a button. Eventually I want it to do some form validation, but for now I would be happy just to see the alert. I've read the docs and about a ...
0
votes
1answer
174 views

contact form in template with jquery,validate and ajax

I have a page-contact.php for my contact form in my template. I wanted to add jquery validation and some fancy ajax action to my form. This is already a working code in a simple PHP page, but getting ...
1
vote
1answer
45 views

Ajax requests without JQuery

I want to make Ajax requests without JQuery, and without including wp_load.php. I want to use a vanilla XmlHttpRequest object that I write myself. Any links, hints, done-it-befores, etc?
0
votes
1answer
73 views

Replace link with form to pass variables to javascript / ajax

I'm sending a single variable to javascript/ajax via a link, but want to send via a form so I can pass user input as well. (It's for a plugin that interfaces with an Echonest Remix python script to ...
1
vote
0answers
65 views

Using color picker in plugin, does input attribute order matter?

I'm trying to use the WP color picker in a plugin admin menu and it doesn't seem to be doing anything at all. I'm following the directions here: ...
0
votes
1answer
26 views

Variable not being returned from Ajax Javascript (though javascript receives it)

I'm receiving the variable to JavaScript, but not getting it back in PHP, and I think Its not being coded correctly in the JavaScript: function glitch_player_display(mix_name) { alert(mix_name); ...
0
votes
2answers
126 views

Function won't run onclick using Ajax

Ok, so my code is meant to be pulled from the function using the jquery code below, but it isn't pulling the code and I can't see why not. My pages code <script> var click_to_choose_user = ...
0
votes
0answers
20 views

Infinite scroll wont work on mobile browsers. Works on non mobile systems

I implemented infinite scroll on my WordPress blog using the following script: <script type="text/javascript"> var abc=66;//what is abc doing? $(window).scroll(function () { ...
0
votes
0answers
29 views

Ajax not working in Wordpress but works fine elsewhere?

I'm using an image gallery plugin with WP theme twentyfourteen. I embedded a submit field in one of the plugin's files which executes just before the gallery is loaded and sorts the images. All the ...
0
votes
0answers
130 views

Load Next Posts With AJAX not working with custom post type

I am using this plugin to load in my next posts with AJAX. I have implemented it into my site and it is showing the load more posts button however once you click on the 'load more posts' button it ...
0
votes
1answer
68 views

Current post in AJAX call is always zero

I have a custom post type named event and a button to load more timeline. I need to arange current timeline item to the left or right depending on his current_post from WP_query object. Ex: if ...
1
vote
1answer
43 views

Disallow second login session

I am trying to find a solution for 2 months now but unfortunately I came up with no results. I have a subscription based website which streams music. What customers basically buy is a "panel" where ...
0
votes
1answer
102 views

Form isn't inserting data into database with ajax plugin

I've been working at this for weeks without success. I've figured out problem after problem with the code, but none of the corrections seem to fix my core problem. The form doesn't insert anything ...
0
votes
1answer
46 views

Using foreach inside an ajax function

This is my first attempt to create an ajax function. My script takes the selected value of a dropdown list $('#state').change(function () { var state = $('#state ...
0
votes
0answers
42 views

Like/Dislike Bar not working when updating

I'm trying to integrate Like/Dislike Bar in a Wordpress plugin . It Works Properly when total page reload/refresh . But whentime Like/Dislike Bar refresh from ajax that time its not working . This is ...
0
votes
0answers
38 views

Theme Customizer – Conditional Controls

I would like to dynamically add / remove Controls to/from the theme customizer without completely reloading the customizer page. For example when I choose option1 from a drop down I want control A to ...
0
votes
0answers
10 views

wp_editor call with ajax [duplicate]

I'm working on a wordpress plugin that manages a database. The database has a table that has the id field name and descr. I have a php file that has two buttons, one and another rule change. When ...
2
votes
4answers
83 views

Wordpress Ajax Data problem

I couldn't add selected data to a div using ajax. Here is my code: <?php function master_ajaxurl() { $myOpt = $_POST['option']; bringDetails($myOpt); } ...
0
votes
1answer
60 views

bulk update meta value with ajax

I want to update posts meta value in the wp_query to a different value on click. What I am basically doing is making a notification bubble (like stackoverflow). wp_query with the number of posts ...
0
votes
1answer
64 views

Contact Form 7 submission does not complete

I have a Content Form 7 Version 3.8.1 form which seems to function perfectly in that the validation events all work and when submit is clicked the console shows no error, a 200 response comes back ...