• Fixed view of login/out button in widget.
    I.e. added wrapper

      and

    • to text link in widget as it is in the default themes in WP. And removed the excess closing tag </ li> in the markup in line 548.
    /**
    		 * Outputs the HTML for our login link.
    		 * @param String $login_text  The text for the login link. Default 'Login'.
    		 * @param String $logout_text The text for the logout link. Default 'Logout'.
    		 * @param String $logout_url  The url to redirect to when users logout. Empty by default.
    		 * @param Bool   $show_admin  The setting to display the link to the admin area when logged in.
    		 * @return HTML
    		 *
    		 * @version 1.1
    		 * @since 1.0
    		 */
    		public function modal_login_btn( $login_text = 'Login', $logout_text = 'Logout', $logout_url = '', $show_admin = 1 ) {
    			// Check if we have an over riding logout redirection set. Other wise, default to the home page.
    			if ( isset( $logout_url ) && $logout_url == '' )
    				$logout_url = home_url();
    
    			// Is the user logged in? If so, serve them the logout button, else we'll show the login button.
    			if ( is_user_logged_in() ) {
    				$link = '<ul><li><a href="' . wp_logout_url( esc_url( $logout_url ) ) . '" class="logout wpml-btn">' . sprintf( _x( '%s', 'Logout Text', 'geissinger-wpml' ), sanitize_text_field( $logout_text ) ) . '</a>';
    				if ( $show_admin )
    					$link .= ' | <a href="' . esc_url( admin_url() ) . '">' . __( 'View Admin', 'geissinger-wpml' ) . '</a></li></ul>';
    			} else {
    				$link = '<ul><li><a href="#login-box" class="login wpml-btn login-window">' . sprintf( _x( '%s', 'Login Text', 'geissinger-wpml' ), sanitize_text_field( $login_text ) ) . '</a></li></ul>';
    			}
    
    			return $link;
    		}

    Forgive me if I’m wrong.

    https://www.ads-software.com/plugins/wp-modal-login/

Viewing 1 replies (of 1 total)
  • Thread Starter svtux

    (@svtux)

    I.e. added wrapper <ul> and <li> to text link in widget as it is in the default themes in WP. And removed the excess closing tag </ li> in the markup in line 548.

Viewing 1 replies (of 1 total)
  • The topic ‘View of widget’ is closed to new replies.