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
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
51 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
232 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
1k 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
145 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 ...
0
votes
0answers
78 views

Missing data in admin ajax calls on fresh install 4.2.1

I have a fresh install of wordpress (no plugins installed), and i noticed that $_REQUEST in admin-ajax.php doesn't have data fields. For example, $_REQUEST for adding new menu looks like this: Dump ...
0
votes
1answer
42 views

Ajax live search, “No products found” when the title contains apostrophes and quotations

my website theme has an Ajax search bar. My search bar does not seem to work properly when searching for products containing apostrophes and quotes in the title. Example: Title of a product is ...
2
votes
0answers
74 views

Making a follow button, Ajax not talking to php

I'm trying to make a user follow button using AJAX, but for some reason my AJAX isn't talking to my jk_user_follow function and setting the wp_set_object_terms. PHP function ...
0
votes
2answers
31 views

Get Page Type (Category/Tag) Using AJAX

I want to know if the opened page is a category/tag page. From the JavaScript file, I can pass only the permalink of the page. Is there a way I can find the page type?
0
votes
0answers
107 views

Wordpress JSON API - Prev Post / Next Post using Ajax

I am using Wordpress JSON API to pull data from posts and display it via ajax on a click event. I would like to an include a .next & .previous link which will rerun the ajax request replacing the ...
0
votes
1answer
266 views

click event to unhide something after ajax not firing

I am working in wordpress and my ajax function result showed one button whose html is mentioned below. Now I want to run a click event on that button but when I click it nothing happens. Below is the ...
0
votes
1answer
72 views

Registration form not registering First and Last name

I'm creating a custom registration form which works using username and email inputs, but when I include First and Last name fields it won't let me register. Here is the form: <form ...
0
votes
1answer
97 views

403 (Forbidden) delete file image in themer folder

I'm having trouble with permission to delete files that are within the theme folder. All folders and files are with permission 775 and there is no error in the code , because when I use the code in a ...
0
votes
0answers
151 views

AJAX: admin-ajax.php is adding extra content to my script's response - how to exclude header, footer, etc.?

I am requesting something using WP AJAX through admin-ajax.php . But I've noticed, that response from my ajax hook is modified by admin-ajax.php - it buffers the hook function output and posts back ...
0
votes
0answers
97 views

Ajax is running my insert query twice

I am working in WordPress and I run a function to insert a row in database with ajax. Ajax runs but for some reason insert operation is performed twice. Below is my code Ajax jQuery(function ($) { ...
2
votes
1answer
121 views

AJAX only works when I'm logged as Admin

I want to make an AJAX request on every select value change to update the real value from database. I'm coding inside a shortcode on functions.php. I have a select element like this one below, echo ...
0
votes
0answers
65 views

Use result of first ajax call to trigger another

I am working in wordpress. I have below form 1 which is a search form and when I press search I get results with ajax. Now the result rows have button or link which when clicked should trigger another ...
0
votes
2answers
171 views

Custom Form with Ajax

I am having problems with my form. When the submit button is clicked a 404 error is spit out. If anyone has any suggestions I'd be grateful. Ajax handling of form. Going into theme's js. <script ...
0
votes
2answers
95 views

Ajax not returning anything on form submit

I am working in wordpress and on pressing the submit button I want the function to return result through ajax and result should be shown as an alert on the screen. But when I press submit nothing ...
1
vote
0answers
35 views

Correct way to write jQuery functions in Wordpress

I'm working with an AJAX based Wordpress template (custom), but I'm having some issues getting jQuery to play nicely. I've enqueued everything (in the right order) and to an extent it does work, but ...
0
votes
1answer
92 views

How to request admin-ajax.php correctly when wordpress URL and site URL are different?

When site_url() and home_url() are different, how a request should be directed to admin-ajax.php (both in front-end and admin)? Using A. admin_url('wp-admin/admin-ajax.php') or B. ...
0
votes
1answer
28 views

Nonce doesn't validate in nopriv call

I have a function which uses Ajax calls: function bs_reserve_gift() { if (!wp_verify_nonce($_POST['_wpnonce'], 'reserve_gift')) { $response['status'] = 'error'; ...
0
votes
1answer
67 views

Ajax button not working

So i'm trying to make a follow button in wp, and for some reason the ajax button isn't working right. Here are the steps of what's supposed to happen user clicks #followbtn Ajax goes to $_POST ...
0
votes
1answer
101 views

Prevent wp_debug from polluting ajax within plugin

I've ran into an issue here where wp_debug notices foul up my ajax response. The codex suggests using ob_clean just before returning or echoing: To parse AJAX, WordPress must be reloaded through ...
0
votes
1answer
173 views

How can I pass a variable to wp_ajax action?

I'm writing a plugin that pulls data from an external API and inserts it into a bbPress topic. Here's some sample code: function bbp_ajax() { $topic_id = bbp_get_topic_id(); $the_issue_key = ...
0
votes
1answer
54 views

Workflow for new importer plugin - your advices?

I'm building a new plugin to import Pinterest Pins from a user into Wordpress. It will NOT work using the Pinterest API (which is too limited for what I want to do) and requires the user login and ...
0
votes
0answers
111 views

AJAX login without a plugin does not work. when add a action to function.php

I am using wordpress ajax login without a plugin. I want to not be allowed users access to the WordPress profile after login, Because i have designed a specific profile in the link: ...
0
votes
2answers
182 views

WordPress API functions not working at AJAX functions.php call

I am trying to show subcategories of a category in WordPress using AJAX: when I select a main category, there is a call to WP Ajax and the result is used in showing the subcategories. So far, I have ...
0
votes
2answers
74 views

Trying to send AJAX data to WordPress hook

I'm trying to send jQuery data via AJAX to a WordPress template file. I've tried several different techniques and solutions based on other questions posted that pertain to this topic, with no ...
0
votes
0answers
132 views

Wordpress WP_Query offset parameter not working with search parameter

On a wordpress query every time i add the 's' parameter the 'offset' and 'posts_per_page' will not work, it will query all posts by using the 's' parameter only, why is that? am I missing something? ...
0
votes
1answer
99 views

Add Ajax loaded posts to existing posts

I manage to get the Ajax loading to load wordpress post. But my problem is when I click the next posts button it replaces the previous post with new posts. But I want to display next set of post below ...
0
votes
1answer
51 views

update_option in WordPress AJAX

I have this example: For example, this code will register a callback called "wpa_49691": add_action( 'wp_ajax_wpa_49691', 'wpa_49691_callback' ); add_action( 'wp_ajax_nopriv_wpa_49691', ...
0
votes
0answers
74 views

wp_enqueue_media problem

I am trying to build up a form where user can request some post information including feature image. For uploading the image i have used wp_enqueue_media() which works nicely in all free themes ...
2
votes
0answers
68 views

AJAX requests broken due to HTTPS for wp-admin

I have my wp-admin section forced to HTTPS via a plugin. I also have specific pages that are using https on the frontend (login, billing, etc.) I seem to be having an issue with HTTP pages using AJAX ...
4
votes
3answers
920 views

The correct method to pass query vars in AJAX using ajaxurl

OK, I had no idea how to title this topic. I'm trying to override the default behavior with ajax. The problem here is not actually a problem, but a wish more. I have this url: <a ...
0
votes
1answer
244 views

Fatal error: Call to undefined function get_post() with ajax

I have an index.php page with about link, which will get about author content from created page (post) inside WordPress dashboard with name about. I'm using Magnific Popup plugin for poups. I have ...
0
votes
1answer
113 views

Plugin not working locally, but works on server

This is a hail Mary throw, but I appreciate any ideas that could point me in the right direction. I had a "plugin" created for my wordpress site. I have a live site that is on a server and one that ...
0
votes
0answers
61 views

Pass max posts to Javascript

I'm doing a fairly standard situation where posts are loaded with AJAX via a list. I'm having difficulty passing from WP/PHP to JS when the max posts are reached. Here's what I use to enqueue assets ...
0
votes
0answers
20 views

call post via ajax [duplicate]

I want to call my post or post url via ajax. Currently I call in iframe. The reason I want to show ajax instead of iframe is because with ajax, I can make responsive layout easily. My iframe url is. ...
0
votes
0answers
92 views

WordPress page content only in fancybox except direct click

it's really hard to describe the issue in one sentence! i tried this solution (Load page content with AJAX using Fancybox?) but that doesn't work for me, even though it seemed like it was exactly what ...
0
votes
1answer
648 views

Jquery ajax to custom php file: returning blank data

I created a custom php file, put it in my folder. The files does insert some data to the database to a custom table i created. require wp_path() . "/wp-load.php"; global $wpdb; $favorite_table = ...
0
votes
1answer
146 views

Using wp_send_json to return HTML

I don't understand how to return HTML correctly via AJAX. I have this routine function DisplayEventInfoBox() { ?> <div id="eventInfo"> <div class="avail-from cart-right"> ...
0
votes
1answer
1k views

Updating site content after an AJAX call without a page reload

I've created this PHP function that deletes a product with an id passed by an AJAX call: function deleteSelectedProduct() { if ( isset($_POST['productToDelete']) && ! ...
0
votes
1answer
40 views

Result from wp_send_json adds line feed

I've got a local Windows stack running AMPPS at 5.4.35 and my code runs fine but when I deploy to my Bluehost server running PHP 5.4.28 the execution of wp_send_json is different. wp_send_json( ...
0
votes
0answers
44 views

Why is $wp_query fetching nothing?

I have created a ajax file from where response will return named "ajax_show_nxt_cat.php" and here I want to list all post using $wp_query but when I try to print the $wp_query, it returns nothing. I ...
0
votes
2answers
92 views

How to run ajax in Wordpress Post?

I am trying to use ajax in wordpress I have two comboboxes in single-meetings.php the second combobox values are based on selection from the first one here is my single-meetings.php <form ...
0
votes
2answers
126 views

Ajax insert or update data

I've been browsing through similar questions and have yet to get this functionality to work. I'm tracking the progress a user makes an embedded vimeo video and insert data or update data. JS on the ...
0
votes
1answer
70 views

wordpress add_action() issue in ajax call

After a hole day finding solution for the issue, i didn't get what is exactly i am making the mistake. Please give your valuable answer for my issue and humble request not to block if you can't ...
0
votes
0answers
64 views

Extract a WordPress shortcode attribute from function and apply in another one

I try to modify simple AJAX contact form so that it could take shortcode arguments. Specifically I need to send a message about the successful submission of the form, and as well error message based ...