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
8 views

Strange AJAX problem (SOMETIMES works in Chrome/FF, ALWAYS works in Midori)

I have an ajax function that sometimes doesn't work in Chrome and Firefox (doesn't load the data), but displays no errors in the console. However, it ALWAYS works in the Midori browser (Bhodi distro). ...
0
votes
0answers
9 views

Ajax submitting form values on same page

Having trouble with WP's ajax processing forms. My goal is to submit form values (type: 'post') to the same .php page and show them in appearing . How it is possible?
0
votes
0answers
13 views

Ajax Vote Plugin e.preventDefault not working

I tried to build a plugin with which i can let users vote for articles so i can track kind of 'likes'. The Ajax works fine and I use a link as a trigger. Somehow every time I click on the link (which ...
0
votes
0answers
10 views

WordPress plugin returns 0 on admin page

I'm searching for an answer here for hours, and I can't find what's wrong with my code... my wordpress ajax keeps responding "0" no matter what I do... Here's the code: header.php file: ...
0
votes
0answers
22 views

Post being updated as draft/pending instead of being submitted/published when using JS/AJAX validation

I'm using code from this answer to validate some fields for a custom post type before it's submitted for review as well as it's published. Here's my code - //AJAX to validate allocation request ...
0
votes
0answers
13 views

AJAXed function does not like sending mails with certain headers?

Out of all the emails below, only the one with 2024 gets sent when I ajax to the function that contains the code below. And none of the wordpress email gets sent even though other wordpress functions ...
0
votes
0answers
17 views

WordPress Ajax Spitting out a page as a response?

So I have attempted to create a class to contain the ajax based functions and what not, in PHP and then call that through the functions.php and then use javascript to make calls back. But I am so ...
0
votes
0answers
30 views

Wp mail does not work when Ajaxed to

I tried to including wp-load, but the wp mail refuses to work when it is called from an ajax hooked function. How can I work around this? Also, on another note, the parameters I sent through AJAX to ...
0
votes
0answers
17 views

Using Customizer value in an external PHP file inside a theme

I'm working on a theme for a company and they don't want the users to touch the code at all. So as I love, they asked me to use Customizer API. Now, there's a PHP file in the theme which we don't ...
0
votes
0answers
24 views

Session variables lost during Ajax calls - Wordpress - Sage Starter Theme

I'm using the starter theme Sage to create a custom Wordpress Theme. I made a very simple infinite scroll system to display every posts. On that point, everything seems to work fine. Now, I have to ...
0
votes
0answers
13 views

Is it possible to get Wordpress shortcode output with ajax

I'm trying to develop a booking system with a plugin. There is a couple of "book now" buttons with unique ids. What I want to do is to create a popup box (a div which shows when the "book now" button ...
0
votes
0answers
20 views

Display parent and child taxonomies in separate drop down select fields

I've used a piece of code from another question here but my second select field did not changed accordingly. Can anyone tell me what's wrong? Below is my code: My php functions: function ...
0
votes
0answers
29 views

Unexpected WordPress search results

I'm making a simple project management plugin. I want to have a AJAX powered search feature for the projects. I have it working kind of. It just a simple search form. <form ...
0
votes
1answer
40 views

WooCommerce add to cart triggers 2 times

Im running a ajax based woocommerce shop. But When i click add to cart, the product gets added twice. when i turn off 'Enable AJAX add to cart buttons on archives' everything goes well, but once ...
0
votes
1answer
94 views

Ajax not firing properly using Firefox, but works in Chrome

I'm working on a plugin that seems to be fine in Chrome, but is not firing the PHP script via Ajax in Firefox. It is driving me to distraction. Here are the code blocks that relate to it. First, the ...
0
votes
1answer
19 views

functions.php filters not applied in AJAX call

I've added an element to a menu with php (code simplified for illustrational purposes): add_filter( 'wp_nav_menu_' . $menu_slug . '_items', 'add_menu_item' , 10, 2 ); function add_menu_item ( $items ...
-1
votes
0answers
25 views

Search and Filter posts with AJAX [closed]

I'm working on a Wordpress website for a college program and the goal is to create a course catalog that lists all the courses being offered in that particular semester. An example of what I would ...
3
votes
0answers
24 views

WordPress AJAX Login Screen

In recent versions of WordPress, when you have been logged in to the dashboard a while with the page still open, WordPress times out your session and opens a login box. This box appears in a little ...
0
votes
0answers
21 views

How to achieve an elegant way when using ajax to get data for a table in WordPress?

I'm working on the update for a website which wasn't originally developed by me. The task is to have a table on a main page and, if you move a slider with value on it (100, 200, ... 1000), the table ...
0
votes
1answer
23 views

Ajax function on #publish only saves as draft - how to make it publish?

I have a custom post type called "shift" (as in shifts worked by employees). When shifts are published, I run an Ajax function to check that this shift does not have a scheduling conflict. If there ...
0
votes
1answer
29 views

Get a different meta value with ajax when different elements are clicked

I have a custom post type of Hero, and each hero has some spells with spell icon, name, description stored in custom fields (repeatable fields through the "custom fields suite plugin"). What i want ...
0
votes
1answer
35 views

Ajax not working for certain user roles

What would cause front end Ajax requests to not work for certain user roles? I have successfully registered (enqueued) my .js file and I know that I have registered ajaxurl successfully as if I ...
3
votes
1answer
52 views

Fetch and show multiple custom fields via AJAX

I am trying to fetch custom field values from database and show them on page. I am able to do that for single custom field but not sure how to do that with multiple values at once. Here is my ...
0
votes
1answer
24 views

Javascript not working

Here is my js code var geoSearch = new google.maps.Geocoder; jQuery(document).ready(function() { var address = FYN_search.postcode; if(jQuery.type( address ) === "string"){ var region ...
0
votes
0answers
13 views

How to check for dependencies for a specific page and enqueue them

I am creating a one page site where the content of the sections (separate pages) above and under the actual page section are lazy loaded via AJAX. Say in one of the pages a shortcode for a gallery ...
0
votes
1answer
26 views

Trouble with Wordpress Ajax Login System - 302

I'm trying to create a simple Ajax Login system with Wordpress. Unfortunately, every time the "wp_signon" function is fired, my system failed and the only information I have is this one : POST ...
0
votes
0answers
18 views

wp_ajax_action, wp_ajax_nopriv_action not working

I'm using jquery autocomplete. Here is my code.. admin-ajax.php function my_search_one() { die($_GET['term']); //..sample data.. } add_action( 'wp_ajax_my_search', 'my_search_one' ...
0
votes
2answers
158 views

WP_Session not acting with AJAX

The concept is to put a Button in Post Content which the user will click. Two things - The ID of the post and Number of times the user clicks the Button should be displayed. Reason - With this we ...
0
votes
0answers
14 views

insert new fields after first call success without repeating all data ajax

my ajax after first call it's repeating all results i need after first call just loading the new data or field that doesn't exist in the first success call my here it is my ajax code <script ...
0
votes
1answer
17 views

Deny dashboard access breaks ajax requests

I need to restrict the access to the dashboard fon non-admin. Therefore i'm using this function in the functions.php: function ggp_restrict_dashboard_access_function() { if ...
0
votes
1answer
80 views

Fire two Ajax Calls in one time (Category Filter -and- Load More Posts )

I have a wordpress website that has a custom post type called (product), that applying two custom taxonomies (Books -and- Authors), simply I am trying to make the filter process by Ajax and also I am ...
0
votes
0answers
29 views

Localising AJAX strings: gettext fails to translate when called in admin-ajax

I'm trying to solve a problem very similar to this one on WPSE: gettext-does-not-translate-when-called-in-ajax but my functions are in custom a plugin, and the solution suggested there isn't working ...
1
vote
1answer
27 views

Are there actions or filters I can use for Ajax calls?

I'm interested in writing a caching function for Ajax calls. If a third party plugin does their thing, calls wp_ajax_whatever, how do I pick that off? If a person does slideshow updates with a ...
0
votes
1answer
57 views

How to return multiple arguments from AJAX callback function

First of all, please don't mark the question as duplicate as I didn't ask how to send arguments with ajax request. I want to receive some extra arguments on ajax success. My callback function will ...
0
votes
1answer
54 views

Run javascript upon successfully set featured image

I'm looking into running Color Thief against the featured image whenever it is set or updated. I can't seem to find any way on how to hook into this event. Currently I'm doing what I feel is a bit ...
0
votes
0answers
25 views

Images loading over http instead of https

I am new to wordpress and recently launched my blog on self-hosted version of wordpress. Everything is working fine except some images are loading over http resulting in insecure contents warning by ...
0
votes
1answer
47 views

Admin AJAX doesn't work in plugin admin page - Even though code is copied verbatim from Wordpress Codex

So I have been working on this for... 3 days now - and have resorted to just pasting in the code directly from the wordpress codex to get that to work then go from there. That code however doesn't ...
-1
votes
1answer
70 views

add Additional class to woocommerce cart-contents link

I am working on a woocommerce based website. I have used the suggested code snippet found here to add a cart-contents link to my header. The code is as follows: In your functions.php <?php // ...
0
votes
2answers
63 views

Call Ajax URL in Plugin

Plugin Class File: function __construct() { add_shortcode('user_registration_form', array($this, 'shortcode')); } public function hook(){ add_action( ...
0
votes
0answers
47 views

How to Mimic WP Custom Fields Ajax Methods

I have an admin metabox that allows the user to add multiple items. I am attempting to mimic the effect and styling that the default WP custom fields metabox gives users on posts/pages. I have the ...
2
votes
0answers
37 views

SSL breaks customizer: page isn't returned from ajax

I have a WordPress install using a Comodo SSL certificate. I have the WordPress HTTPS plugin installed and I'm using the AZ theme, and the admin is set to load over HTTPS. So far so good. On the ...
0
votes
0answers
12 views

Using ajax to serve personal data on top of cached pages

We run a membership site powered by Wordpress. However, with most caching methods, the cache is, understandably, ignored for logged in users. One of the techs at the host we use (pagely) recommended ...
0
votes
0answers
41 views

ajax drop down change second drop down data

i have a custom post type called "item" and it has taxonamies called "item_location", "item_category" now i am trying make two dropdowns in home page. first drop down has data of "item_location" ...
0
votes
1answer
63 views

'Lazy loading' list of posts with pagination

I have reading settings set to show 30 posts per page, and what I'd like to do is show half of the list of posts and then 'lazy load' the remaining half on scroll. I've checked out some the available ...
0
votes
0answers
11 views

How to load individual widgets within sidebar(Not all at once)

I want to load my Wordpress site sidebar widgets when scroll down. So I want to know how to load individual widgets one by one. I tried plugins like 'Lazy Widget Loader'. But they didn't work for me. ...
2
votes
1answer
137 views

How to save dismissable notice state in WP 4.2?

In WordPress 4.2 the is-dismissible class was introduced to allow notices to be dismissed. This code is working to add the notice. function prefix_deprecated_hook_admin_notice() { if ( ...
0
votes
1answer
37 views

WordPress Get Header and Footer using in Admin Area

I was wanting a way to get the site header and footer and use it in the admin area. Idea #1 An answer to another related question states to use an iframe instead I think we can use an ajax call get ...
0
votes
1answer
90 views

WP AJAX is not working, always returns 0

I've checked any threads here regarding this and did a debug test which worked, I'd like to understand why my own code doesn't work as it presents the same functionality explained in every possible ...
0
votes
0answers
15 views

I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views

This is my Ajax Handler function function get_total_post(user_ID) { jQuery.ajax({ type: 'post', url: ajaxforall.ajaxurl, cache: false, data: { action: ...
0
votes
1answer
52 views

PHP session when called wp_ajax_nopriv

I'm trying to work with sessions using wordpress ajax call api, but unsuccessfully. In begining of functions.php writed: if (!session_id()) { session_start(); } When doing ajax call for ...