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
1answer
9 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
14 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
26 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
29 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
35 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
0answers
14 views

Should I make data available using an exported file or an ajax request? [on hold]

For a project I have to make a lot of data available to a javascript, on the scale of hundreds of posts. Since the data shouldn't change all that often, I thought it best to basically cache it as a ...
0
votes
1answer
19 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
30 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
37 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
1answer
15 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
20 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
33 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
15 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
20 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 ...
1
vote
0answers
27 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 ...
3
votes
3answers
147 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
48 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
47 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
35 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
19 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
43 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
117 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
34 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
110 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
21 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
29 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
56 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
43 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
37 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
21 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 ...
0
votes
1answer
47 views

200 return code on 'POST /wp-admin/admin-ajax.php' while NOT logged in

I noticed the following log entry: 111.22.3.444 - - [13/Mar/2015:08:31:00 +0100] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 618 ...
0
votes
1answer
16 views

What exactly does 'authenticated' mean for wp_ajax_nopriv?

When building AJAX functionality for WP, I've always thought 'wp_ajax_nopriv' was meant for non-admin users. But now I have gone and read the documentation and it says it is for non 'authenticated' ...
0
votes
0answers
69 views

Load a single post into a modal

Another one for you guys. I'm trying to load single.php into a modal. It loads, but then it loads the content into the target to open the modal. The Call: <a href="<?php the_permalink(); ...
0
votes
0answers
81 views

Sending post request to admin-ajax.php but $_POST['data']['events'] is NULL

I am trying to debug a plugin that I purchased but I have come up short and could use some help. Whenever I attempt to save settings that are stored in the "events" object (see below) the plugin ...
0
votes
0answers
30 views

How to specify url for ajax call in wordpress plugin

I want to use ajax form submit in a plugin, the submitted data will be processed by a script saved as handler.php in the plugins folder, how do I specify this in the jquery script, ordinarily ...
0
votes
0answers
51 views

Retrieve customizer value using ajax or customizer api and print the value in theme

one of my clients have Branches. one located in new york another in los angeles and etc... in the live site we print new york phone and address(from the customizer) as default. what i need is to ...
0
votes
1answer
67 views

Don't allow access to wp-admin but allow admin-ajax requests to be fulfilled on frontend?

I have a site that requires users to have an acccount to use it. I don't want certain user roles to have access to wp-admin. All account changes should happen on the frontend account management ...
1
vote
1answer
74 views

How to check an ajax nonce in PHP

I'm modifying the media modal adding a new menu item to add external attachments to the media library. From the JS code I'm calling a PHP function that touches the database and accepts three ...
0
votes
1answer
64 views

Plugin Form Submitting to admin-ajax.php instead of admin-post.php

I am building a plugin which loads a form into a table cell when clicked. Here is the AJAX: public static function cp_libhours_ajax(){ ?> <script> ...
0
votes
0answers
17 views

why full page is being feedbacked when using ajax?

Having kind of strange problem. The code i'm using in the plugin is as below //user login form add_shortcode('ajax_login', 'atest'); function atest(){ global $load_js; $load_js = true; return ...
0
votes
0answers
32 views

admin-ajax.php is slow [duplicate]

On this site, it usually takes around 5-7 seconds for admin-ajax.php to process and return the response for when the user clicks on the plus icon on project hover. I'm not sure if this is a WordPress ...
0
votes
3answers
112 views

Dequeue script to prevent javascript event conflict on wordpress child theme

I've built a child theme of Divi Theme to use with Buddypress. So far so good, except for a script conflict on commenting buttons. The theme load a javascript (js/custom.js at 2642:2662) with the ...
0
votes
1answer
39 views

Handling AJAX with custom taxonomy custom fields on add

I wrote some extra fields for my custom taxonomy. I added the form fields to the add form. I got it to save by handling the appropriate values in $_POST. In 4.1.x, the add form is Ajax-ified. How can ...
0
votes
0answers
31 views

Send email in wordpress

I want a functionality to send email in wordpress but what I have tried below code but what I want is that an additional textbox forinstance called "name" is appended to my email ... can be append the ...
0
votes
1answer
55 views

Wordpress Insert not working with ajax

I am trying to enter insert data with form in wordpress and want to use ajax for that. Without ajax it works fine but when I use ajax pressing the submit button gives 0 in result and the data is not ...
0
votes
0answers
23 views

Rotate image media item 90° anti/clockwise ajax front end function?

Is there a rotate image function that I can create a button on the front end of my website, using ajax inconjuction with the id number of the media item? I'm thinking having 2 buttons, rotate left ...
0
votes
1answer
36 views

Add a counter for mouseovers (custom field)

I am trying to count mouseovers on the div for each post. The div is inside the loop. I am almost there, I think you might have to just help me correct some mistake. The div and jquery. Notice that I ...
1
vote
1answer
61 views

wordpress count link clicks by ip address

I am building wordpress web site, which will have an option to download zip file from certain custom post type. By clicking on download button, user automatically starts with downloading zip file. ...
0
votes
0answers
24 views

Change php via js, is it possible?

i want to change my headers dynamically ( not in WP admin dashboard ) <div id="Header_wrapper"> <?php if( header_style == 'header-creative' ) get_template_part( 'includes/header', ...
0
votes
0answers
103 views

Ajax Form data is not posted back to the get_results()

I am trying to run a wordpress wpdb->get_results select query and I want to get the search criteria from a textbox. I want to do it form and with ajax without refreshing the page. No matter what I do ...