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.

7 votes
1 answer
4k views

admin-ajax returning 400 error when request is made with Fetch API

I'm developing a plugin with an ajax handler. I first coded the ajax request setting up the XHR object. Looks like this: var data = new FormData(); data.append('post_title', 'Hola como'); data....
oquiroz's user avatar
  • 95
7 votes
3 answers
2k views

Help with 4.6. Attachment response object in JSON API plugin

I am a big fan of the JSON API plugin. The developer did a great job and I thank him very much. I am learning how to work with json and jquery and am trying to limit the information I get back from ...
generalchaos's user avatar
7 votes
1 answer
6k views

Adding "Remember Me" in custom login

im currently using an ajax login i found here: http://wpsites.org/wordpress-ajax-login-and-register-without-a-plugin-10835/ Everything works perfectly fine. However i'd like to add a "REMEMBER ME" ...
Archangel17's user avatar
7 votes
1 answer
5k views

Nonces and Cache

It's clear that form submissions and AJAX requests, especially sensible ones, need "nonces" to avoid certain exploits. However, with heavy use of caching systems it becomes harder to generate them ...
gyo's user avatar
  • 326
7 votes
2 answers
3k views

wp_set_auth_cookie() doesn't work in Ajax call

I am trying to create a Facebook JS-SDK based auto login feature. When user is "Connected" passing FbID and aother user data to an ajax function which creates the session cookie. Cookie is created (I ...
Attila's user avatar
  • 361
7 votes
2 answers
5k views

gettext does not translate when called in ajax

When loading content in gettext calls (__(), _e(), etc.) they translate fine when I render the page in the browser normally (PHP delivers the content to the browser), however when I make AJAX calls, ...
ako977's user avatar
  • 171
7 votes
1 answer
7k views

Ajax Load More Posts in Category Page

I am developing a theme where I need to load more posts with ajax. Currently, when I click load more on the category pages, all the posts are loading. The category.php looks like this : ` ...
Ranjan Agarwal's user avatar
7 votes
1 answer
408 views

Development of a Wordpress Search Plugin - Best Practices

Searching for around two days to find an answer to my question, I finally registered for this StackExchange. :) My Question is not simple, so I need to start at the very beginning. But to give you an ...
Christoph's user avatar
6 votes
2 answers
22k views

Getting the post_id in wp_ajax function

I wrote a custom AJAX function in which I have assigned a post type to be a child of another post type. In one function I am looping through those child posts, and I want to update the database to ...
janedit's user avatar
  • 81
6 votes
2 answers
797 views

How bad is it if I write AJAX functions using wp-load.php?

My question is: When I write an AJAX function I can write it using a separate file. I can include wp-load.php to that file and use WP core functions. I know this is wrong. Can you tell me how bad is ...
Dhanuka Nuwan's user avatar
6 votes
3 answers
56k views

WordPress AJAX File Upload - FrontEnd

So I have been reading through every WordPress front-end AJAX file upload tutorial I can fine. Nothing is working for me at the moment. The one that makes the most sense to me is this one: http://...
hootsmctoots84's user avatar
6 votes
2 answers
176k views

Execute one AJAX request after another AJAX request finished

One JS file is making an ajax call. Within the success of this ajax call another AJAX call is made. The second call checks whether the email has already been registered. If it has been then the ...
Istiaque Ahmed's user avatar
6 votes
4 answers
24k views

How to add a " waiting" icon for an ajax in WP frontend?

This is my search js code for processing search : jQuery(document).ready(function($){ $('#searchsubmit').click(function(e){ e.preventDefault(); var searchval = $('#s').val(); //...
Derfder's user avatar
  • 2,052
6 votes
1 answer
4k 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 ...
INT's user avatar
  • 1,281
6 votes
3 answers
19k views

AJAX nonce with check_ajax_referer()

I want to use check_ajax_referer() to verify a WP_nonce field using AJAX. Here you can find my html element. <input type="hidden" name="login_nonce" value="<?= wp_create_nonce('login_nonce'); ?...
ronnyrr's user avatar
  • 373

15 30 50 per page
1
3 4
5
6 7
180