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
14 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' ...
-1
votes
0answers
16 views

Get the default variation for a variable product in Woocommerce, for use in Ajax add-to-cart [on hold]

I'm trying to edit woocommerce/loop/add-to-cart.php so that customers can add variations to their cart via Ajax links. Currently, variable products just show a "Select Options" button that jumps over ...
0
votes
1answer
64 views
+50

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
5 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
13 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
28 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
17 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
21 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
44 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
49 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
16 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
36 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
26 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
32 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
26 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
20 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
8 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 ...
-1
votes
0answers
56 views

woocommerce add to cart button ajax clear cash after adding

Hi all I have big problem with Woocommerce add to cart button. When I select th quantity of item 1 and press add to cart button after that if i change quantity to 2 or 3 or 4 it add just one item. if ...
0
votes
0answers
22 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
33 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
7 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
0answers
93 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
27 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
0answers
64 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
14 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
25 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
55 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
109 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
36 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
81 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
16 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
61 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 ...
0
votes
1answer
24 views

Is it OK to use a system cron to trigger a function hooked into the AJAX API

I have a real cron job setup and it seems to work. I have outlined the basics below. The reason I ask is I don't see this method mentioned often and I'm wondering if that is because doing so is a bad ...
0
votes
0answers
18 views

Add custom functionality on WooCommerce complete button

I've a situation to add some data to the database tables on order status completed button. I can see the url in class-wc-admin-post-types.php Can someone help me for any hook? Or how the ...
0
votes
1answer
99 views

Ajax load more posts - WP_Query parameters not working

I'm trying to replace the standard WP pagination with an Ajax load more posts button. I'm basically following the code from this question which for the most part works well. Here's the relevant ...
0
votes
0answers
15 views

ajax and php code

I try to send ajax data to my Wordpress site. The ajax code seems to work fine and it POSTS to a php file its data(this php file is located in my plugin folder). I send the ajax data when I navigate ...
0
votes
1answer
45 views

Server hammered by queries to admin-ajax.php

I'm getting tons of requests (a dozen per second) from a bunch of different IPs for POST /wp-admin/admin-ajax.php. Strangely enough none of these IPs ever request any other page (as far as I can tell ...
0
votes
0answers
26 views

Create a popup/modal to select category before enter site

I need to create a Popup or Modal that works like this: When user access the website, a modal appears at screen and makes user choose two categories: STATE and CITY. States are parents of Cities. ...
0
votes
0answers
68 views

Woocommerce “Add to Cart” ajax

On the product category page, when someone clicks "Add to cart", woocomerce adds automatically "View cart" below this button through Ajax. I found that the script in /assets/js/frontend/add-to-cart.js ...
0
votes
0answers
35 views

Generating a URL with no content for captcha

I modified my regular form to ajax form. I have captcha simple_php_captcha in my form which is generating captcha. I need to chage it's image if the user request it to change. I am thinking to ...
0
votes
1answer
49 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: ...
0
votes
1answer
17 views

Simulate a specific page when making AJAX calls

I'm interested in loading parts of the interface of our theme over AJAX and wrote a function to handle generic functions. (Code below.) It works fine, but wp_nav_menu(), when run through this ...
0
votes
1answer
21 views

Can't add classes using jQuery from a JSON string with get_body_class()

In order to refresh the classes on the <body>element after an AJAX call, I am writing at the top of my AJAX response the following in JSON: $o[ 'classes' ] = get_body_class('project'); I can ...
1
vote
0answers
53 views

Admin wp_ajax hook returning 0

I've done some research but I can't seem to find the correct answer so I'm hoping someone can give me a hand. I'm attempting to use the wp_ajax hook in the admin section. The functionality should be ...
1
vote
0answers
45 views

AJAXIFY WordPress Theme Frontend menu

I have the next code in my functions.php add_action('wp_enqueue_scripts', 'my_frontendscript'); function my_frontendscript() { //registering script wp_register_script('frontendscript', ...
0
votes
1answer
43 views

Ajax specific template not loading in replacement of index.php

Following my previous post (Full-Ajax Theme: parseJSON error while building a JSON object from a Wordpress custom template) regarding a few problems concerning JSON (now resolved), I am trying to load ...
0
votes
0answers
23 views

Widgets: Ajax Filtering and Add rewrite rules

I have built an Ajax filtering plugin for my widgets that works by adding url params through jQuery (when a link is clicked) and having pre_get_posts $_GET these values. These values then setup the ...
0
votes
1answer
46 views

Full-Ajax Theme: parseJSON error while building a JSON object from a Wordpress custom template

Trying to make a full-ajax navigation on my new portfolio, I read online on a few different blog that building the templates using JSON would be easier in order to treat the datas however I want. It ...
0
votes
1answer
33 views

Wordpress ajax not working in registration

guys. I've tried to build a wordpress simple registration form with ajax, but it doesn't work at all. Here is my code, a php and jQuery ajax. Please tell me what's wrong with my code. FYI, (1) the ...
0
votes
1answer
70 views

Using AJAX to return search form results

I'm trying to take user input from a search form, build a query based on user input, and then return relevant posts using AJAX. Right now, the form builds the select dropdowns properly. The form ...