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

2
votes
2answers
107 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
280 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
67 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
106 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
20 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
116 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
30 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
1answer
263 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
17 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
56 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
48 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
170 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
40 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
112 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
24 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
34 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
67 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
63 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
60 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
26 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
63 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
37 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
93 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 ...
1
vote
1answer
136 views

Can't trigger an AJAX function with a submit button in the dashboard

I'm writing a WordPress plugin. My plugin has forms that post data to other pages generated by my plugin within the WordPress dashboard. I am trying to create an AJAX function that is triggered when ...
0
votes
0answers
137 views

Woocommerce checkout update totals with datepicker

I've added a new date field on the checkout page. I'd like to create a date based delivery fee calculation. The date field has the 'update_totals_on_change' class. When changing this manually the ...
9
votes
2answers
187 views

Why not register shortcodes if is_admin dashboard?

I have noticed that some plugins such as Contact-form-7, Nextgen-gallery, possibly others, have an interesting anti-feature of not registering their shortcodes when is_admin() is true. The ...
0
votes
0answers
98 views

Front-end Ajax File Upload

I'm working on a project where registred users can upload file to a specific post type. For a more fluid navigation, I'm making this whole part with Ajax, so the page never reloads. However I'm having ...
0
votes
0answers
42 views

map with ajax content load

Hi i made a svg mapa to load data from a locations cpt, so when i click the location it loads the content through ajax. It all works fine, but that is in the cpt page archive page. Now i need a map ...
0
votes
0answers
16 views

Tie the sending of an ajax request to Wordpress hooks

I'm tracking events on my site such as login & registration and need to send an AJAX post when these events occur. I've explored ways to do this from the frontend, but have determined that the ...
0
votes
0answers
46 views

Conditional forms with wordpress ajax

I'm creating a wordpress megamenu plugin, i've setup the walker and all frontend things But stuck in the backend i changed some of the walker class <?php /** * /!\ This is a copy of ...
0
votes
0answers
69 views

How to use nonces for frontend AJAX voting if the page gets cached?

I'm building a custom voting solution for my site that would allow public AJAX voting on multiple posts per page. Votes can be added/changed/revoked. Values are stored in custom post meta. I ...
1
vote
1answer
42 views

How to remove an Ajax action

There is a plugin that is loading ajax actions like so: add_action( 'wp_ajax_nopriv_func_name', array( &$this, 'func_name' ) ); add_action( 'wp_ajax_get_func_name', array( &$this, 'func_name' ...
0
votes
0answers
24 views

Run insert if no entry otherwise run update with ajax

Below function works with ajax ... but I am getting a null result ... I want that if there is no data in the database then insert operation is performed and when there is data the update should work. ...
0
votes
1answer
87 views

AJAX call broken after actualization

I have a simple form, where user can set some numeric value and add a comment. Then it is being send to database via AJAX call. So I have two inputs: a numeric slider (text field) and a textarea for ...
0
votes
1answer
26 views

Know which script/page is being called by ajax call

I have to reverse-engineer a wordpress site, which requires some updates, but I am unable to make it work properly at one place. Here, on click of a link, an AJAX call is being made to some page that ...
0
votes
1answer
104 views

Null/undefined return in WordPress AJAX request

I really need help on this one. I've been looking at it for hours and been getting nowehere. I am working with ajax in WordPress and this is kind of my first time doing so. I have a function in my ...
2
votes
1answer
88 views

Timeout on Admin-Ajax?

I am writing a plugin and using admin-ajax. It's a long-running function - that is, it's connecting to an API and loading in posts. This could take 5-10 minutes sometimes. Seems like after 1-2 minutes ...
0
votes
0answers
45 views

Not including wp-load.php in plugin

Okay, so I'm trying to get a plugin approved, and I've fixed most issues except the fact that I'm using require_once to load wp-load.php. I create a button in the admin bar, and there is a javascript ...
0
votes
0answers
221 views

Ajax Button to load more Posts into a timeline

I am setting up a timeline page for a customer and so far i have designed the timeline and i am using 2 loops to place the posts in 2 columns (left and right) where the first post is located at the ...
0
votes
1answer
248 views

Custom Wordpress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB

I'm building a little form to let users update their contact information outside of the vanilla Wordpress user management systems. I plan to use a simple CRUD setup and throw in some sanitation. I've ...
0
votes
0answers
26 views

Extract and amend variables from 'like' plugin and put into visual meter gauge plugin

I am trying to extract the total number of likes associated with different posts from the WTI Like Post Pro wordpress plugin, then subtract the number of unlikes and feed this total into a meter gauge ...
0
votes
1answer
67 views

Pass the updated value of aid from form using ajax

I am working in wordpress and I want to fetch the updated value of aid field from form each time a submit button is pressed. There are two submit buttons and I want the id as per the clicked row HTML ...
0
votes
1answer
38 views

Placement of add_action() for ajax callback?

This is probably a palm slap question, but I'm confused. I created what I thought was a simple WP template page. A form to update a form to a db via ajax callback. At the bottom I placed the ...
0
votes
0answers
79 views

Update a div with ajax result

I am working in wordpress and this is an ajax call and I want the result of a row returned to a div with id #hero. Now since the result is a for loop and hero div is in each row. And the form has ...
0
votes
0answers
88 views

Set cookies based on visitor choose (first time visit site)

i am working on solution to set cookies based on visitor choose. when the visitor first time visit my site, popup uppers with "select branch". so when the visitor select the branch i make the ...
0
votes
0answers
28 views

How to add AJAX to PHP table who's data is called through API

I made a plugin which shows a list of all the plugins available in the wordpress repository through API. (More info about that is here: ...
0
votes
0answers
49 views

Ajax request with get_posts

I am new to wordpress development. I basically am pulling information from a custom post based on a category. What I want is to load more post when a button is clicked. I've searched for hours but ...
0
votes
0answers
223 views

ajax form with multiple submit buttons and values

I am working in wordpress and I have an html form with two submit buttons with same classname and different value. I am passing the submit button clicked value through ajax and show it on the screen. ...
0
votes
1answer
875 views

Simple Button onClick to trigger jQuery function

I have looked similiar questions but any of it didn't worked I want to trigger jQuery function with onClick button, but it didnt worked. HTML structure : <button class="my-button" ...
0
votes
0answers
141 views

Ajax call through admin-ajax.php returns 404 error

I am trying to do a pretty basic AJAX request at the moment, just to test functionality, routing my calls through admin-ajax.php. However, every time I try to fire the AJAX request, I get a 404 error ...