WordPress.org

Forums

Sidebar Login
Hide sidebar login when disconnected? (4 posts)

  1. AngelysProd
    Member
    Posted 1 year ago #

    Hello,

    Is it possible to hide Sidebar login when a user is offline please?
    Just show Welcome "user" when the user is connected?

    Thanks

    http://wordpress.org/plugins/sidebar-login/

  2. WikeC
    Member
    Posted 1 year ago #

    Hello,

    Yes it is possible.
    Use this function : is_user_logged_in()
    here is the link to see more:
    http://codex.wordpress.org/Function_Reference/is_user_logged_in

  3. Skalibur1
    Member
    Posted 1 year ago #

    The same question.
    Can anybody write the complete code for this function?
    Thanks!!!

  4. HolgerG
    Member
    Posted 1 year ago #

    Open includes/class-sidebar-login-widget.php
    Find

    // Filter can be used to conditonally hide the widget
    		if ( ! apply_filters( 'sidebar_login_widget_display', false ) )
    			return;

    Replace with

    if ( is_user_logged_in() ) {
    
    		// Filter can be used to conditonally hide the widget
    		if ( ! apply_filters( 'sidebar_login_widget_display', false ) )
    			return;
    
    }
    else
    {
    
    		if ( ! apply_filters( 'sidebar_login_widget_display', true ) )
    			return;
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sidebar Login
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic