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
0answers
33 views

WP_Query, How to identify if the offset reached the max posts count

I'm doing a custom WP_query to populate my post list via AJAX with some filters. I load additional posts once the user click the 'Load More' button, this fires the $.ajax and on success adds the new ...
0
votes
1answer
112 views

Populating content dynamically via AJAX and Advanced Custom Fields [closed]

I am using a repeater field from Advanced Custom Fields to create multiple photo galleries. There are 4 pages and each page has multiple image galleries. Because of this, I want to reduce load by ...
0
votes
0answers
88 views

AJAX doesn't pass variables to the php function in the plugin

I'm creating a plugin that at a certain point has to use AJAX to pass information to php depending on the events fired by front end user on the different page. The event itself is when the user ...
1
vote
0answers
192 views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
1
vote
1answer
27 views

Why does Wordpress Heartbeat login not refresh the nonces?

Here's an interesting experiment: Go to wordpress plugins listing page, notice the activate, deactivate links all have a nonce part in the request. In a second tab, log out of the site, and go back ...
1
vote
0answers
38 views

Wordpress ajax works on FF but not on IE & chrome

I have the following code <a href="#" class="loadmore centered" page-data="1">Show More</a><script type="text/javascript"> jQuery(document).ready(function($) { ...
1
vote
1answer
57 views

Using AJAX to generate front end / viewer end pages

I am currently trying to send certain data via POST method from code in the widget of my plugin to the theme's archive.php page. The code that contains the data for jquery/ajax is : <a ...
1
vote
1answer
64 views

What's the point of using Wordpress's built in admin-ajax.php?

I'm trying to understand why using admin-ajax.php is advantageous over doing something like this: add_action ('wp_loaded', 'my_ajax'); function my_ajax() { // Do Ajax, Check $_POST die(); } ...
1
vote
1answer
40 views

Can't get result from sql using ajax result

I'm using an AJAX form to feed the code something to lookup in db. Separate table, not WP options. I'm getting the result from AJAX, but when I try to do the sql it just returns 0. This is the ...
0
votes
0answers
43 views

Some shortcodes breaking after AJAX call

I have a content slider that displays my Academic posts on my website. Some of my posts have shortcode in order to display an accordion menu and some columns. I am using AJAX to fetch the posts and ...
0
votes
0answers
46 views

Using Ajax to autocomplete a form with data from db

I'm struggling to get the following: User fills out personal number Other input gets autocompleted with data from database As I have never made a plugin, help is greatly appreciated, my database ...
0
votes
0answers
138 views

AJAX filter posts on click based on category

This is my first foray into AJAX, I've been splicing bits of code from various tutorials which probably hasn't helped. I have a list of categories on my homepage (index.php) and a list of the most ...
0
votes
0answers
14 views

Access Shortcode in ajax code?

I have some data which is pulled over using ajax. Data works all fine, however, I have some shortcode been used in the same data which doesn't display as expected. It looks like shortcode function ...
0
votes
1answer
33 views

Retrieving post ID from current page

I am following the tutorial here. Wordpress Ajax is a bit complicated but this tutorial helped me out a bit. The only question I have is, when I view any page, I want to be able to get the current ...
0
votes
0answers
24 views

Post where filter not working with Ajax

I am trying to add filter "add_filter('posts_where', 'location_multicity_where_changes_ajaxin'); " with ajax but it is not working. After i call this in functions.php via add action it ...
0
votes
0answers
50 views

Fire query on ajax post url page

Here i am sending the ajax response to load_post.php page from my ajax call.I am getting response on load_post.php on load_post.php i have to fire word press query. I was try this but getting bellow ...
0
votes
1answer
40 views

Get custom fields when hover link of post

I have custom page and get some links of post if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><a href="<?php ...
0
votes
0answers
24 views

Wanted to collapse all the widgets in sidebar by default via jQuery

I already applied jQuery on footer to Slide them up but i noticed that when the page is completely loaded the widget slides up properly but dont know how this again slides down automatically. I m not ...
0
votes
5answers
103 views

How to call ajax in plugin file

I am very new to ajax with wordpress . Here i am getting a selected option value in var test using bellow function when i alert it its showing a right value. This var test value i have to send using ...
0
votes
1answer
65 views

Using AJAX and PHP to load next post object

After looking through the jQuery documentation and many stackexchange community forums, I am still faced with this problem. Taking little bits from here and there have helped me get this far, but I ...
0
votes
2answers
194 views

jQuery Autocomplete not working with wp_localize_script

Bit of background: I am building an autocompleting-search box for a list of Trades (a Custom Taxonomy). I asked this question and very helpfully got a much better understanding of how WordPress and ...
1
vote
1answer
223 views

jQuery UI Autocomplete showing all results

I've built an Autocompleting search box for WordPress categories (it's actually a Custom Taxonomy), which works great (i.e it shows the categories when typed). However, when 1 key is typed, it will ...
1
vote
1answer
67 views

Filtering posts by multiple taxonomies

I have a page on which I want to display all posts of a specific custom post type, let's call it "persons". I want to allow the user to filter all persons by multiple (!) taxonomies: age, city, ...
0
votes
1answer
93 views

Not getting the Correct JSON response from Ajax Request

I am trying to save data from backend with ajax. But its returning data in HTML as well. But i want only JSON data. ////////////////////////////////// // Do Ajax Request to ...
0
votes
1answer
53 views

using jquery serialize in ajax operation for plugin

I am writing a plugin with dynamic no. of input fields in form. To submit form via ajax, I have used jquery serialize() function. $(".submit").submit(function( event ) { ...
0
votes
1answer
39 views

Storing temporary data for a custom post type

I've created a Rental custom post type to a rental site I'm developing for a client. I'd like to add an ajax availability calendar in the backend so the client can mark/unmark unavailable dates ...
0
votes
0answers
79 views

Infinite scroll on sidebar widget

I am trying to add an infinite scroll functionality to a website i am building, but i want to add it to a sidebar widget. I have a widget that shows a list of recent posts, and i would like to add an ...
0
votes
0answers
22 views

Ajax returning 0 when in shortcode, but working when i directly run the function [duplicate]

I have a very wierd problem, maybe very easy to fix for any of u, but im struggling with it for days now. I have a live search in my plugin, that works fine when i directly fire the function ( ...
-1
votes
1answer
89 views

Why is my ajax live search not working when i use a shortcode to call it?

I've finally managed to get my live search in Wordpress working, but it only works when i directly call it in the class. I want to put it in a shortcode, so i can call it on every page i want. But ...
0
votes
0answers
63 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
56 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
55 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
59 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
48 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 ...
0
votes
2answers
84 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
201 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
151 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
211 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
11 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 ...
2
votes
0answers
87 views

Chopping up a large ajax request of around 200 posts [closed]

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
23 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
24 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
27 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
118 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
1answer
111 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
3answers
205 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
53 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
96 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" ...
2
votes
1answer
434 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
140 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 ...