- This topic has 1 reply, 2 voices, and was last updated 13 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘Generic’ is closed to new topics and replies.
Events Made Easy › Forums › Generic › Improvement : not show Widget when not logged
For Privacy and security reasons i need to hide the widget for no logged users.
I don’t want visitors could see informations like phone or email.
I resolved my problem with the following code (not sure this the right place, but working).
Could be to add an option to include these function in standard.
File : eme_widgets.php
function eme_load_widgets() {
global $current_user;
get_currentuserinfo();
if ($current_user->ID != 0 )
{ register_widget( ‘WP_Widget_eme_list’ );
register_widget( ‘WP_Widget_eme_calendar’ );
}
}
Not showing the widget is not the same as not being able to access the event data. If you want an event to be private, just indicate the event like that (private events exist).
Concerning the technical part of your solution: use the wordpress function “is_logged_in”