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

learn more… | top users | synonyms

4
votes
3answers
457 views

WordPress function that makes HTML safe to be sent via AJAX request

What is correct way to send HTML back to an AJAX request in WordPress? I currently have this: add_action( 'wp_ajax_nopriv_get-location-info', 'sc_locations_get_location_info' ); add_action( '...
0
votes
1answer
1k views

Problem running Ajax in Wordpress

FIXED I changed this: wp_enqueue_script( 'pfxconversion', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery' ) ); wp_localize_script( 'pfxconversion', 'MyAjax', array( 'ajaxurl' => ...
1
vote
1answer
1k views

jQuery ajax call throws an HTTP 302

I'm trying to implement a jQuery Autocomplete where the Autocomplete gets its data from a ajax source. However, for some reason when I make the call it results in a 302 which in turn results in a 404. ...
1
vote
2answers
2k views

wp_localize_script escaping my url - fix or alternative

Here is my wp_enqueue_script and wp_localize_script - which i am using to run an Ajax call. wp_enqueue_script( 'function', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery', 'json2' ) ); ...
0
votes
1answer
155 views

Ajax request sends url rather than data

I have a very weird error running on my plugin. I am currently developing a plugin that will allow the user to create routes and specific dates for the route. The dates are more or less tickets that ...
37
votes
2answers
10k views

Ajax takes 10x as long as it should/could

I have just hit my first serious issue with WordPress and for someone that enjoys Ajax this is a biggy. I have an Ajax request that is taking 1.5 seconds to complete while using the Ajax API. If I ...
1
vote
1answer
220 views

Plugin for loading comments on-demand [closed]

Is there a plugin which would allow visitors to load comments when they want to, rather than always showing them by default? Preferably through an AJAX call or something to prevent page reload. I'm ...
0
votes
1answer
389 views

Problem with ajax plugin for refreshing posts

Im using a cool plugin called "wp ajax random posts". It basically lets me call a function into a template that can auto refresh a loop of posts. It works great until I tried to change the loop ...
0
votes
2answers
863 views

How to use Jeditable plugin with admin-ajax.php?

Jeditable is saving data to the file like: $('.edit_area').editable('http://www.example.com/save.php', { type : 'textarea', cancel : 'Cancel', submit : 'OK', ...
0
votes
1answer
116 views

Problem loading ajax in the header

Im using this tutorial http://digwp.com/2009/07/display-a-random-post-with-ajax-refresh/# to create a section on my homepage where I can refresh a section with ajax. I have it all setup but the post ...
5
votes
2answers
2k views

How-to implement admin Ajax inside an admin WP_List_Table?

I am new to WordPress if someone will help me I will be very appreciate. There is parameter ajax "true" but in docs. wasn't said how to implement Ajax using WP_List_Table Class? parent::__construct( ...
3
votes
1answer
2k views

How-to debug wp_ajax_* hook callback?

I'm currently developing a plugin that uses ajax functionality. Problem: The callback isn't fired = no data gets processed. if ( ! is_admin() ) add_action( 'after_setup_theme', array( '...
0
votes
1answer
52 views

Trouble Removing Plugin [closed]

I'm editing this site http://www.millermusicproductions.com/ currently and I am trying to get rid of the login in the upper-right corner. I go to plugins and deactivate a plugin called "Login with ...
0
votes
1answer
110 views

grab or load text on demand

What i want to do I want some content (could be stored any where in a post or custom field) to load only when the user clicks for it to load. This content could be any thing (text,images,html etc) ...
0
votes
3answers
1k views

Ajax save data to database on document ready, no data being saved

I have written a plugin which collects stats on document ready. Keep in mind that my database table is already created. I've added the following code to do the ajax code add_action( 'wp_head', '...
1
vote
3answers
3k views

Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script

I think i've almost got my head around this ajax is Wordpress business, thoroughly ejoying learning it but i'm now totally stumped. First up is the nasty bits! I have these in my main plugin file: ...
1
vote
2answers
1k views

Using Ajax call in jQuery doesn't work in widget

So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is ...
1
vote
2answers
1k views

Why none of the plugins that have ajax doesn't work in my website?

This is my website. I installed many plugins but if a plugin have ajax, then it doesn't work in main page. can anybody help me?!?
2
votes
1answer
757 views

How to use get_option() without any filter?

I'm using the newest WordPress 3.3.1 and newest qTranslate 2.5.27. I have made some an AJAX script which returns a value and message in the current language. Here I get my first problem, I solve it ...
1
vote
2answers
175 views

Any problem in using native jquery ajax style instead of using admin-ajax.php?

I had problem using admin-ajax.php while creating one plugin. I had problem using "add_action( 'wp_ajax_ajax_action', 'ajax_action_stuff' )" in my plugin where i have used oop module. So I want to go ...
3
votes
3answers
3k views

How do I hook an Ajax request into a PHP callback?

Following the directions here http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Administration_Side I wrote this code: EDITED TO INCLUDE DIE(), STILL NOT WORKING function my_button() { echo "&...
3
votes
1answer
582 views

Metabox cloning via Admin Ajax call issue

I've created a fairly simple class for handing the creation of metaboxes within wordpress admin. I've set up the class so that each instance of the class represents an new metabox definition. Each ...
-1
votes
1answer
2k views

Using WP Ajax and jQuery to process multiple forms on the same page?

I'm using the following to make ajax calls: wp_enqueue_script( 'my-ajax-request', TAF_PLUGIN_URL . 'js/ajaxcf.js', array( 'jquery' ) ); wp_localize_script( 'my-ajax-request', 'MyAjax', array( '...
3
votes
1answer
538 views

Real time Duplicate title check

On my website there are a lot of authors and they are all writing about italian 'scene' so sometimes it happens that two of them write the same post or use same title so what I'm looking for is a way ...
2
votes
1answer
361 views

Sharing templates with the JSON API?

Is there any way to share 'templates' between JS and Wordpress? For instance, this sort of modest seat-of-the-pants templating feels ok: var AJAXSuccessFunc = function(data){ // calling this on ajax....
0
votes
2answers
1k views

Not sure why wp_ajax isn't working?

I'm trying to get into grips in using AJAX in wordpress, the following code creates a form with an input box using the wordpress feature shortcode [ajaxf]. <?php add_action( "wp_ajax_ajaxcf", "...
0
votes
3answers
5k views

Load Next WordPress Posts With AJAX?

I found an amazing plugin that loads the next posts with Ajax. http://www.problogdesign.com/wordpress/load-next-wordpress-posts-with-ajax However it doesn't work with custom post types. The code ...
2
votes
2answers
505 views

How WordPress converts URL to $query_string

My home.php shows a list of (N) posts and << Previous & Next >> links. When clicked, I want to fetch previous/next list of (N) posts using Ajax. This is: I do NOT want to load the entire ...
1
vote
1answer
340 views

How can I rewrite a URL to pass requests to a custom method via AJAX? (I can't use admin-ajax.php)

I have to build a WordPress plugin which gives out HTML for an AJAX call. However, because of the server environment I cannot use the traditional admin-ajax.php. Someone told me that I could build a ...
5
votes
2answers
3k views

ajax stopped working when not logged in?

Have had an autocomplete field working for months but has stopped working when not logged in? Not sure when but within the last few days or week (not updated wordpress recently). already have; ...
1
vote
0answers
102 views

Ajax from various plugins not generating responses (endless spinners) [closed]

This isn't a problem with a specific plugin, but with all of my plugins that use Ajax on the front-end (though surprisingly, none of the Ajax requests on the back-end are experiencing any issues). I'm ...
-2
votes
1answer
289 views

Can a scrollable date picker be done in Wordpress for archives?

I've been asked by a client to do this: But I have no idea how I would go about it, particularly in Wordpress. I searched around Google a bit, but it looks like this design was just lifted from an ...
1
vote
1answer
719 views

Update Loop with Form

I have a photo gallery I'm developing using WP as a means for content management. I'm relying heavily on some jQuery plugins to manage the UI styling and manipulation (via sorting). My problem is ...
0
votes
1answer
848 views

register_setting and AJAX?

Please pardon me if this question is totally unrelated in itself, but I'll do my best to point out the issue I am having and what I would like to achieve. Scenario: I have a custom theme option's ...
9
votes
2answers
1k views

Can I use the same nonce for multiple requests on the same page?

Or does this break the purpose of the nonce, which I admint I don't quite understand it? :) For example on two ajax requests that run on page load, or when something is clicked: $.ajax({ type: '...
5
votes
2answers
7k views

Ajax and autocomplete

I got a set of meta boxes on a custom post type. Two of them are simple input/text-type fields, that should have autocompleted input: A) Another Custom Post Type B) Users Now I have the problem ...
1
vote
1answer
814 views

AJAX search posts and pages

Im trying to make a plugin where i need to create an AJAX search. Im using the method described in http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ to perform the ajax calls. So far ...
0
votes
1answer
715 views

Right way to include blog-header.php?

I have a voting system on a custom post which uses AJAX, and I have a file that handles the AJAX request. This file is inside a sub folder named php of my theme. Hence the structure is: ../wp-...
0
votes
1answer
77 views

Custom loop attached to link

I have a custom post type named companies. When you add a new company you need to check if it's a leader or not, so I created custom metabox with two radios, one for "yes" and another for "no". In ...
0
votes
1answer
725 views

Display custom-post type based on the Title matching the current selected value

Ok quite a complex thing I'm trying to do here, and I'm a bit unsure how I will do it with wordpress, but I'm hoping some genius out there can help. I'm basically creating some comparison ...
1
vote
2answers
1k views

How to declare a JS variable in an AJAX call

I'm using: wp_localize_script( $handle, $namespace, $variables ); to declare some variables before the initial AJAX call is made, but I imagine I can't do the same thing again within a callback ...
1
vote
1answer
954 views

Wordpress AJAX - how to return true or false in the callback function

So I've set up AJAX with Wordpress properly, having followed some good tutorials, and it's working great. One thing I can't quite work out is how to properly return either TRUE or FALSE from within ...
1
vote
1answer
17k views

Using ajax on categories and wordpress loops

I want my index.php to be a simple page with a horizontal list of category names on the top. But instead of having the page reload with the list of posts in that loop each time a category is clicked ...
1
vote
3answers
696 views

Bind to WPSetAsThumbnail

is there a way to bind some extra script to the WPSetAsThumbnail function? the function automatically inserts the image into the post's metabox, but what if i wanted to do something else with it? ...
0
votes
1answer
2k views

ajax jquery update custom field meta value front end

There is probably a much easier way to do this. After much trial and error trying to get a postid from a url, I've opted to add the id to the permalink. However I have no idea how the custom value ...
3
votes
4answers
814 views

Conditional check for front-end which includes ajax

I need a conditional which exits if the context is not a front-end view including AJAX requests. I have this at the moment: if (is_admin() && !DOING_AJAX) return; The DOING_AJAX bit ...
1
vote
1answer
203 views

How to localize admin.php only once

I am creating a set of plugins that all use AJAX. Now localizing the admin.php in all the plugins seems to be a bit of an overkill. Is there a way to localize the script only once.\ Now I do not know ...
0
votes
1answer
883 views

Does wp_localize_script call a Javascript Function or Simply Pass PHP Parameters to It

Easy question: I'm trying to understand wp_localize_script. Does wp_localize_script call a JavaScript function or does it simply pass PHP parameters to JavaScript? I want to pass PHP parameters to ...
0
votes
1answer
812 views

Ajax page load in wordpress the right way?

I tried something like the following but if the page I'm loading has javascript it's not running because the elements are created after page load. When the javascript is something I wrote I simply ...
3
votes
1answer
2k views

Custom column for changing post status via ajax

I'm currently trying to implent a new custom column at the page manage screen that will let me change the status (published/pending) of the different pages via an easy toggle link. From what I've ...