Page 1 of 1

WP Ajax Returns whole page content when user is not login

Posted: Fri May 23, 2014 11:59 pm
by m.rizwan_47
I'm using ajax to update clicks on post (post_meta). When user is logged in it works fine, but the problem is, when user is not logged in wordpress, ajax returns whole page content. instead of what I want it to return. Even both hooks for ajax have same function:

Code: Select all

add_action( 'wp_ajax_ajax-mapsinputtitleSubmit2', 'dv_ajax_result' );
add_action( 'wp_ajax_nopriv_ajax-mapsinputtitleSubmit2', 'dv_ajax_result' );
Here's my code on pastebin: http://pastebin.com/Yt1jqzWe

Any help would be appreciated.