WordPress has function to check whether user is logged in or not
is_user_logged_in(){
/**Your code goes here**/
}
wrap your code inside this to allow only logged in users the access
WordPress has function to check whether user is logged in or not
is_user_logged_in(){
/**Your code goes here**/
}
wrap your code inside this to allow only logged in users the access