Not getting result using ajax on wordpress

Its looks like you are not printing the admin ajax URL. add_action(‘wp_head’, ‘my_action_javascript’); function my_action_javascript() { ?> <script type=”text/javascript” > jQuery(document).ready(function($) { var ajaxurl = “<?php echo admin_url(‘admin-ajax.php’); ?>”; $(‘.myajax’).click(function(){ var data = { action: ‘my_action’, whatever: 1234 }; // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php $.post(ajaxurl, … Read more

Error Copying Directory On Plugin Activation

That was my fault! The problem is copy_dir isn’t a WP_Filesystem method, so it cannot be called as an instance of WP_Filesystem like this: $wp_filesystem->copy_dir(), but independently like this: copy_dir(“source”, “destination”) after the WP_Filesystem() has already been called and setup. Reference copy_dir

Using W3 Total Cache, I set expire headers to media, css and js files,but it seems doesn’t work [closed]

My first port of call would be to make sure that you have all the appropriate modules enabled for your server. For example, on a LAMP stack: In your apache’s http.conf the following lines would need to be uncommented LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so LoadModule mime_module modules/mod_mime.so You would need to restart your apache … Read more

Am I using an action hook correctly?

… (although I found it strange that I didn’t need to write activation or deactivation code…). You don’t need activation of deactivation code unless there is something you need to do on activation or deactivation. I tested my plugin by using a simple echo ‘fd is running’; which strangely shows up at the top of … Read more