Events Made Easy Forums Generic Improvement : not show Widget when not logged

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42488
    Anonymous
    Inactive

    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’ );

    }

    }

    #46562
    Franky
    Keymaster

    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”

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top