tidalbobo
Forum Replies Created
-
Forum: Plugins
In reply to: add_action not appearing in wp_filterSucess!!!
I made a silly mistake, but one with a good learning point.My Demo.php had the following code
add_shortcode( 'contactus_showform', 'contactus_showform' ); function contactus_showform() { include('1.php'); }All my code was in the 1.php
So when AJAX call was made, the referrer was demo.php. But the code for add_action was in 1.php, and executed only on the activation of the short code. Hence it did not run via the WP mechanismOnce i moved all the code in to one single file, it all worked flowerlessy.
Thank you all for the invaluable assistance that helped me on the task
This helped me immensly
http://byronyasgur.wordpress.com/2011/06/27/frontend-forward-facing-ajax-in-wordpress/see http://ww.wp.xz.cn/extend/plugins/posts-per-cat/installation/
#5
Put code <?php do_action(‘ppc’); ?> in your template file (for example in index.php just before closing </div><!– #content –> tagForum: Plugins
In reply to: add_action not appearing in wp_filterAny one got a working AJAX code sample or plugin for 3.3.1 that i might be able to have a look at?
Forum: Plugins
In reply to: add_action not appearing in wp_filterSorry. Yes it needs 2 parameters. My code looks as the following
function f1(){ echo "1234"; exit; } add_action( 'wp_ajax_dan_nopriv_makeWebServiceRequest', 'f1' ); add_action( 'wp_ajax_dan_makeWebServiceRequest', 'f1' );The main concern I have is that once we use add_action, this should be added in to $wp_filter, so that inside admin-ajax.php the proper do_action can call it.
In my case the added action is NOT in the wp_filter