WP Ajax Returns whole page content when user is not login

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m.rizwan_47
Forum Newbie
Posts: 1
Joined: Fri May 23, 2014 11:55 pm

WP Ajax Returns whole page content when user is not login

Post 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.
Post Reply