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
2 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
11 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
19 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
12 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
30 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
11 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
21 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
20 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
21 views

AJAX - respons return 0 [closed]

I have a problem by returning some information of the AJAX I know it's a question that frequently comes over here, but I could'nt found any answer for me... The code, which is placed in one file (in ...
0
votes
0answers
16 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
65 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
0answers
18 views

Stop registration field validation from running based on condition

I have am trying to customize the registration process for a wordpress/buddypress site. Each user must either select a pre-existing company from a dropdown box, or if the company does not exist, they ...
0
votes
1answer
23 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
52 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
56 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 ...
0
votes
1answer
23 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
0answers
25 views

Custom function won't work in JS but human_time_diff() will [closed]

I have a function the_rooms() defined as: function the_rooms() { $latteParams['post'] = WpLatte::createPostEntity( $GLOBALS['wp_query']->post, array( 'meta' => ...
0
votes
1answer
33 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
17 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
18 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
21 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
19 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
28 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
25 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
26 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
43 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
37 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
32 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
54 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
107 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
52 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
61 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
54 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 ...
2
votes
0answers
70 views

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

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
12 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
17 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
18 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
62 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
57 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
2answers
142 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
39 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
51 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
95 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
78 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
35 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'); } ...
0
votes
0answers
35 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
60 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 ...