0
votes
1answer
56 views

Ajax - Call to undefined function get_option()

So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left ...
0
votes
2answers
80 views

wp_ajax action is not running

I'm writing a plugin. I want to run the method get_my_option when someone pressing a button in the settings page of my wordpress plugin. The ajax call is made but the method never runs. In the page I ...
0
votes
0answers
63 views

Post Rating System with wordpress

I'm using a Post Rating System with wordpress and jQuery, i followed this tutorial for that. ` jQuery(document).ready(function(){ jQuery("a.like:not('.voted')").live("click",function(){ ...
0
votes
0answers
33 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
0answers
62 views

Ajax Request not coming back to class

I'm struggling with an ajax request. It's executed but not returning back to my class. My PHP: ... public function __construct() { add_action( 'admin_print_styles', ...
1
vote
0answers
54 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
2
votes
3answers
2k views

Using Ajax with a Class file

At the moment I have an ajax that works (I get a success [200] response), but having an issue with the action hooks on the response. The JSON object is not coming back, instead I'm getting a 0. I ...
10
votes
1answer
492 views

Using jQuery to delete data stored in wp_options

I wonder if anyone could advise me further on my problem. Part of my plugin stores log files for debugging purposes. I have successfully displayed them in a (div#log) in my admin page using jquery ...
1
vote
2answers
160 views

admin-ajax.php “ Missing argument 2” warning

I have the following code in functions.php <script type="text/javascript"> var post_id = "1055"; // hardcoded post id for testing purposes var type = "some_type"; var data = {action: ...
0
votes
2answers
484 views

WordPress Ajax Problems

Update I got it to fire using the following curl command: curl -H "Accept: application/json" -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d ...
0
votes
1answer
130 views

where does my function output from load-* go?

I've got a function hooked into load-edit.php that prints out print content: add_action('load-edit.php', array($this, 'generate_bulk_print_content')); public function generate_bulk_print_content() { ...
1
vote
1answer
209 views

Add/remove action on jQuery toggle

I have Ajax setup and I'm trying to toggle a function from being loaded into wp_head. It works on the first toggle function, but the second function doesn't register. function ...
3
votes
2answers
276 views

How to modify wp_ajax function?

I want to modify wp_ajax_find_posts function. It receives search string from find-posts form and delivers search results by ajax. Part of the function looks like this: function wp_ajax_find_posts() { ...
0
votes
1answer
184 views

Which hook to use when adding ajax to viewer-facing side?

I have a shortcode that contains a form. I want to use jQuery/Ajax for POSTing. For this, I want to add javascript to the page where shortcode is added? Which hook should I use? wp_enqueue_scripts ...
3
votes
2answers
633 views

Why can't I hook into save_posts after admin_init?

I'm trying to hook into the "save_post" action from an AJAX callback in my plugin, but it doesn't seem to work. In fact, hooking into "save_posts" only seems to work from a few key action execution ...
2
votes
2answers
2k views

add_action('wp_ajax_[action name]', myfunction) problem

I'm having the exact same problem described in this post: add_action('wp_ajax_[action name]', myfunction) problem I set add_action('wp_ajax_my_function_call','my_ajax_function'). If I ...
2
votes
1answer
2k views

add_action('wp_ajax_[action name]', myfunction) problem

I'm trying to integrate ajax in wordpress using the wp codex guidelines. In the PHP I added: wp_enqueue_script ( 'my_ajax', ADMIN_URL . 'js/ajax.js','jquery','1.0.0' ); wp_localize_script( 'my_ajax', ...