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
28 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
16 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
31 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
38 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
26 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
77 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
15 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 ...
1
vote
0answers
86 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
33 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
200 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
24 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 ...
3
votes
1answer
55 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
31 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
29 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
34 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
45 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
78 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
30 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
15 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
36 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
28 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
202 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
26 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
18 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
131 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
34 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
33 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
79 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
64 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
35 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
59 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
164 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
92 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
72 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
46 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
17 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
52 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
126 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
188 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
41 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
151 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
17 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
71 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 ...
2
votes
2answers
199 views

Why use admin-ajax.php and how does it work?

My ajax call for json data works ok like this functions.php: add_action( 'wp_ajax_nopriv_load-filter', 'prefix_load_cat_posts' ); add_action( 'wp_ajax_load-filter', 'prefix_load_cat_posts' ); ...
0
votes
2answers
532 views

Show success or error messages in Ajax response to Wordpress custom registration form

I have this custom form inside a Wordpress page template <?php if(!is_user_logged_in()) { if(get_option('users_can_register')) { if($_POST){ $username = ...
0
votes
0answers
120 views

Display post content from category name using ajax

I'd like to display categories as buttons. When I click the button I'd like to display a list of the post in that category The post have a title, thumbnail image, content(text) In the list of posts ...
1
vote
1answer
134 views

Load categories with ajax

I don't have any link or demo to show cos I'm working locally I have news posts with different categories. I want to show the categories as buttons. When you click a category I want to load those ...
0
votes
0answers
22 views

Show added custom fields under “Custom Fields” section in the page edit without page refresh

I have a theme that when Page A is used, functions.php adds a custom field "custom 1." When the value is assigned for "custom 1" then the page is updated, it creates "custom 2." Above behavior is ...
0
votes
0answers
173 views

How to add a Custom Mailchimp AJAX Newsletter Subscribe Form

I want to add a custom Mailchimp AJAX Newsletter Subscribe Form to my WP Blog. I found this tutorial and have followed it: http://neal.codes/blog/custom-mailchimp-ajax-newsletter-subscribe. I've got ...