Skip to main content

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.

55 votes
2 answers
25k 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 ...
Mike's user avatar
  • 813
51 votes
1 answer
9k views

What's the preferred method of writing AJAX-enabled plugins?

I'm wondering what the preferred method is for dealing with AJAX calls. Should one use the same plugin php file to process the POST or a separate one? Which is cleaner or safer?
James's user avatar
  • 625
45 votes
15 answers
117k views

Admin Ajax is returning 0

I am relatively new to jQuery and AJAX in particular. I have a small issue with the return value always being 0, though I think this is actually the success message and it's not returning anything. I ...
Apina's user avatar
  • 659
41 votes
5 answers
158k views

ajaxurl not defined on front end

I am trying to create a ajaxform on the front side. I am using the code jQuery.ajax( { type: "post", dataType: "json", url: ajaxurl, data: ...
dread_cat_pirate's user avatar
35 votes
4 answers
28k views

How to check if I am in admin-ajax.php?

Right now for my plugin, I am using in_admin() to determine if the user is in the frontend of the site or in the admin area. However, the problem occurs when plugins use admin-ajax.php to process ajax ...
Extrakun's user avatar
  • 1,004
26 votes
7 answers
77k views

Ajax call always returns 0

I have a problem with AJAX returning 0 always! I have done everything by the book and can't figure out what is wrong? Please help!! Here is my Ajax call: //Pass data through AJAX var ...
Kuka's user avatar
  • 277
25 votes
2 answers
6k views

Does the functions.php file ever get called during an AJAX call? Debug AJAX

Trying to figure out an issue a fellow programmer is having. I was wondering if the functions.php file get called at all when you do admin side AJAX? I know that when you do an AJAX call a part of ...
Manny Fleurmond's user avatar
25 votes
8 answers
26k views

How to load wp_editor() through AJAX/jQuery

I have a theme that is custom developed and really complex. One of the things that I have is multiple content areas where users can specify content for specific tabs. I load multiple instances of ...
Aaron Wagner's user avatar
24 votes
8 answers
21k views

Best way to end WordPress ajax request and why?

Considering regular WordPress ajax requests like these: add_action( 'wp_ajax_merrychristmas_happynewyear', array( $this, 'merrychristmas_happynewyear' ) ); add_action( '...
prosti's user avatar
  • 4,303
24 votes
4 answers
108k views

400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook

I've been working on ajax lately. The tutorials you find on the net are all very similar and quite easy to implement. But I always get a bad request 400 on my ajax-admin.php file. After a long and ...
Sin's user avatar
  • 374
22 votes
1 answer
18k views

Why does WordPress add 0 (zero) to an Ajax response?

Unless I end Ajax processing function by exit() or die(), the Ajax function receives desired and correct output but following by 0. Any idea why is that happening? Is that meant to be like that or ...
Radek's user avatar
  • 595
21 votes
4 answers
126k views

How does admin-ajax.php work?

We are having some issues with an external developer. We want to limit access to the wp-admin site to internal access only (via VPN). Simply so it will not be attacked by external users. We can ...
nick's user avatar
  • 211
17 votes
3 answers
12k views

Adding admin-ajax.php to the frontend. Good or bad idea?

I love admin-ajax.php. But I hate having to localize in order to point frontend scripts to it, and I wish there was an equivalent, easy-to-find file for themes. (It also just bothers me to see ...
MathSmath's user avatar
  • 5,588
17 votes
2 answers
5k views

How to load wp_editor via AJAX

Does anyone know how o load wp_editor via AJAX in WordPress? My markup and editor is getting loaded properly but editor controls are not getting loaded properly, it may be because Javascript is not ...
user17108's user avatar
  • 181
16 votes
4 answers
8k views

How to cache json with wp-super cache

In a new project we are using wp-super-cache (the client's preferred plugin) to create the static html files for custom content types. But we are trying to figure out if everything is being cached ...
Starfs's user avatar
  • 507

15 30 50 per page
1
2 3 4 5
180