0
votes
0answers
13 views

Can You Require the Use of JavaScript in a WordPress Plugin?

I commonly use Mozilla Firefox for testing changes I make for a plugin that I'm developing. I also have the NoScript addon installed because it is also my main browser. I noticed that the ...
0
votes
0answers
2 views

Accordion script fails after widget save process in admin [migrated]

I used the ddaccordion 2.0 script by Dynamic Drive to create an accordion function for a widget in admin area and some vexing issues are occurring as I cannot determine a solution. On initial ...
1
vote
0answers
84 views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
0
votes
1answer
113 views

Ajax +wordpress onClick link redirect to new page and create html content

i have two pages in my wordpress plugin index.php charts.php in index.php i have some content and some link.. <a onclick="show_trend()" >Trend</a> while clicking this link ,i have ...
1
vote
1answer
55 views

Including the necessary functions for a custom ajax registration form

I know there are a few questions on registration forms but I think mine differs a bit as I haven't found an answer through searching. I'm making a simple subscribe widget that takes a user's email ...
0
votes
1answer
482 views

Wordpress plugin: admin-ajax.php not passing data to custom function

n this basic plugin skeleton, I am trying to get the data sent by ajax to wordpress admin-ajax.php to be processed by a custom function. It looks like the data send from the form does not reach my ...
0
votes
1answer
68 views

Ajax, jQuery and Wordpress

I'm having trouble getting AJAX and jQuery to work with WP, and wondering if someone can point me in the right direction. I have a form, and I want to pass the data from the form to a PHP function, ...
0
votes
0answers
36 views

remove_action(“wp_ajax_function”, “function”); not working

I have the following code in a file called contact-form.php. The file lives here: wp-content/themes/NAMEOFTHEME/ (premium theme) function theme_contact_form() { // some code here (send mail when ...
0
votes
1answer
246 views

insert query on a custom table using ajax with jQuery plugin Jeditable

I've read tons of post already but found no solution... I'm tryin to implement Jeditable functionality in a plugin with this code: jQuery(document).ready(function() { ...
0
votes
0answers
46 views

Thumbnails to append content from database via ajax

Completely re-edited question: I am displaying music album covers as thumbnails in a page template. I would like to be able to click on an album thumbnail and pull the corresponding details for that ...
0
votes
0answers
209 views

Can't get query string in ajax call

I'm developing a plugin that exports to a PDF your current posts view in the admin panel. Suppose you're in a post type "product", then the url must be: edit.php?post_type=product. What I want is to ...
0
votes
1answer
17 views

How to get site homepage from plugin?

I am creating a plugin that has a preview, kind of like the theme customizer preview. It displays the users site in an Iframe. The issue is that I can't seem to be able to get the users homepage using ...
0
votes
1answer
104 views

Execute Jquery when a specific page in my plugin is loading

I am building a plugin and I would like to be able to hide the wordpress admin side menu and top bar when a specific page is shown(or menu item clicked)? Should I call the jquery directly as a ...
1
vote
1answer
92 views

Wordpress Plugin Page is Loading in Admin Content Container Instead of Separate Page

I am creating a wordpress plugin that has it's own UI. It looks like a standard web application, so everything that is done within the plugin is handled in this UI instead of integrating it with the ...
0
votes
2answers
162 views

WP_LOCALIZE_SCRIPT doesn't work

I am creating AJAX loading and need to use WP_LOCALIZE_SCRIPT but cannot make it work. Here is my code. I place it in functions.php wp_enqueue_script( 'page_data'); $gallery_js_data_array = array( ...
0
votes
0answers
110 views

How can I include scripts in a jquery loaded page, for a jquery wordpress widget?

Iam writing a wordpress widget with the following pages 1) I have master page (master.php) - is the main plugin page - Loads a second page (slave.php) with jQuery 2) The slave page - has php, ...
0
votes
0answers
14 views

Alternative ways to make ajax requests in wordpress [duplicate]

I'm currently having a problem with working with AJAX. Well not really a problem since I can pretty much do what I want to do. The only problem is my boss saying that the admin-ajax.php file is an ...
0
votes
1answer
46 views

Admin-ajax.php is dying “0” without processing function

I am trying to learn how to process AJAX requests in Wordpress the correct way. To do this I am adapting this tutorial to create a super simple AJAX request to place the ID of a post (from a link) ...
2
votes
1answer
190 views

Comment `Reply` link doesn't work if comments are loaded from ajax

I am writing a plugin that displays custom home page that is in fact only one post with comments. The first time home page is displayed by the initial call by php. Then user can click a menu button to ...
5
votes
1answer
357 views

Why does WordPress add 0 (zero) to an Ajax response?

Unless I end Ajax processing function by exit() or die(), the Ajax function receives desired and correct output but following by 0. Any idea why is that happening? Is that meant to be like that or ...
0
votes
1answer
107 views

Do I require the use of nonce?

Im creating a visit/page views counter with ajax,jquery and php, I have been reading a few articles that recommend the use of nonces for data manipulation through ajax, however i am not sure if i need ...
0
votes
2answers
2k views

jquery & ajax sending data to php

In my jquery script I have; jQuery.ajax( ajaxurl, { action: 'lu_ajax', status: 'enabled' }, success: function (a) { alert(a) } In my file.php ...
2
votes
2answers
168 views

Adding callback function for wp_ajax_ has no effect

I was trying to add one more callback function to the WordPress AJAX action woocommerce_apply_coupon. This action is defined in the WooCommerce plugin, I want to add my own callback function to this ...
0
votes
1answer
98 views

PHP: How to access db the right way in plugin?

I thought I would find an answer to my question on the internet but I was not able to. This is not a big question, but as it is my first plugin, I want to make sure that everything is right before ...
0
votes
1answer
460 views

Ajax url value to pass 'variable' to use in query

I am in the midst of modifying a plugin in which I wish to get a value from a select list and auto-populate a textarea with values based on the selected value. The php code come from a file named ...
0
votes
1answer
333 views

How to get error object returned by wp_create_user

I'm creating a registration widget for my wp site and it works as expected, however if the user already exists I need a way of retrieving that information. I'm using ajax to make the call here is my ...
0
votes
2answers
1k views

Check if email address exists front end with AJAX in a plugin

I am pulling my hair out trying to figure this out. I have followed the wordpress codex here for AJAX: http://codex.wordpress.org/AJAX_in_Plugins All I keep returning is 0, I never get a 1. Any idea ...
0
votes
1answer
360 views

wp_localize_script is not adding a global variable for javascript

So I've read a few tutorials on ajax and the codex documentation on it and I think I understand now how it is supposed to work, however it appears that wp_localize_script is not doing anything at all. ...
0
votes
2answers
266 views

Ajax functions - no access to wp-admin.php only online

I'm having some trouble with my custom ajax function. I have this on my console log : "POST MYSITEURL/wp-admin/admin-ajax.php 302 Found". So my functions won't work... And I really don't understand ...
0
votes
1answer
314 views

Plugin AJAX Save to Custom Table

I am learning how to use AJAX in the admin for a new plugin I am writing. In the PHP I have the function: function ppmhnh_add_location(){ global $wpdb; $values = array(); ...
0
votes
1answer
71 views

Capturing POST data

I am trying to modify the Member Status Plugin so that the status are based on the data saved on a custom database table. Basically I wanted to change the administration menu with a form that can ...
0
votes
1answer
167 views

calling admin-ajax.php from admin-ajax.php

I'm writing a plugin that calls the output of another plugin's ajax, which is set-up at wp_ajax_ I would have called the functions directly, but limitations in the plugin make that a non-option. To ...
0
votes
1answer
63 views

Submit form to db

I am unable to get this insert to db function to work using ajax and a form. When I execute this, I receive a blank alert box on success. HTML <div id="rsvpContent"> <form ...
0
votes
2answers
372 views

What are the Best Practises When Using AJAX in Plugin Development?

I am in the middle of creating a plugin and everything works fine with the AJAX calls but one question I can't seem to find the answer to is about best practise. I route the AJAX calls through ...
0
votes
2answers
298 views

AJAX request not routing through proxy

I've built a plugin that uses AJAX to post a URL to the URL2PNG API and bring back a screenshot into WordPress via wp_remote_get. It works beautifully in my development environment. In production, ...
3
votes
1answer
221 views

Nonces can be reused multiple times? Bug / Security issue?

I've read that nonces are meant to be for one time use only, and after an ajax request, you should issue a new nonce so with the next ajax request, a new nonce would be sent to the server. However, I ...
0
votes
1answer
119 views

An adiitional function fires on my AJAX submit

I am working on a small community style website for my family to use. Mainly it is a small version of a social network so my nieces and nephews can have fun with each other. I have set up "freinding" ...
1
vote
1answer
70 views

Execute a function using ajax

I have a function called function getSingleAmazonProduct($asin=''). It returns an amazon product. I have a form field to enter the $asin. <div id="asinform"> <form ...
1
vote
1answer
290 views

Plugin Settings not Saving on Ajax re-ordered table

This is an extension of Update Option Stored in Multi-Dimensional Array which was help getting draggable plugin options to save via ajax (which works), but unfortunately this is specific to the actual ...
0
votes
2answers
415 views

include wp-blog-header not working on MAMP

To clarify my question... My plugin is/was using AJAX to call the file pluginname/submit/pick.php My pluginname/pluginname.php contains the usual plugin header and wordpress automatically finds it. ...
0
votes
1answer
642 views

Fatal error: Call to a member function query() on a non-object in my ajaxpage

i am creating a new plugin,i got this error Fatal error: Call to a member function query() on a non-object in my ajax page. how to solve this error. this is my code: if ...
0
votes
3answers
324 views

Page reload occurs before request finishes

I wrote a plugin to send an invitation to a friend and am submitting a form using AJAX and used the tips talked about in 5 tips for using AJAX in wordpress and another article referenced in the AJAX ...
1
vote
1answer
212 views

How to post form in ajax mode and handle it in wordpress

currently I can only do it in a normal non-wordpress way. So, does wordpress provide a solution for this circumstance?
0
votes
1answer
138 views

Ajax request sends url rather than data

I have a very weird error running on my plugin. I am currently developing a plugin that will allow the user to create routes and specific dates for the route. The dates are more or less tickets that ...
3
votes
2answers
2k views

How-to implement admin Ajax inside an admin WP_List_Table?

I am new to WordPress if someone will help me I will be very appreciate. There is parameter ajax "true" but in docs. wasn't said how to implement Ajax using WP_List_Table Class? parent::__construct( ...
1
vote
3answers
2k views

Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script

I think i've almost got my head around this ajax is Wordpress business, thoroughly ejoying learning it but i'm now totally stumped. First up is the nasty bits! I have these in my main plugin file: ...
1
vote
2answers
825 views

Using Ajax call in jQuery doesn't work in widget

So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is ...
1
vote
2answers
159 views

Any problem in using native jquery ajax style instead of using admin-ajax.php?

I had problem using admin-ajax.php while creating one plugin. I had problem using "add_action( 'wp_ajax_ajax_action', 'ajax_action_stuff' )" in my plugin where i have used oop module. So I want to go ...
1
vote
1answer
302 views

How can I rewrite a URL to pass requests to a custom method via AJAX? (I can't use admin-ajax.php)

I have to build a WordPress plugin which gives out HTML for an AJAX call. However, because of the server environment I cannot use the traditional admin-ajax.php. Someone told me that I could build a ...
1
vote
1answer
512 views

AJAX search posts and pages

Im trying to make a plugin where i need to create an AJAX search. Im using the method described in http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/ to perform the ajax calls. So far ...