This topic has 2 replies, 2 voices, and was last updated 9 years by mattylb.

  • Author
  • #41667
     mattylb
    Participant

    Howdy! I noticed an issue where maintenance mode could post a problem while testing. While working with my test site for integration of a wcvendors feature, I had a user with “vendor” role that was not able to view the front-end site, only their back-end area. Is there a way to allow known users to bypass the front-end block that maintenance mode provides?

    THANKS

    #41772
     Radu
    Moderator

    Hello,

    Paste this code in your kleo-child theme functions.php

    COPY CODE
    
    /***************************************************
    :: MAINTENANCE MODE
    ***************************************************/
    if (!function_exists('kleo_maintenance_mode')) {
    	function kleo_maintenance_mode() {
    
    		$logo_path = apply_filters('kleo_logo', sq_option_url('logo'));
    		$logo_img = '<img src="'. $logo_path .'" alt="maintenance" />';
    		
    		if (sq_option('maintenance_mode', 0) == 1) {
    
    			if ( !is_user_logged_in() ) {
    				wp_die(
    						$logo_img 
    							. '<div style="text-align:center">'
    							. sq_option('maintenance_msg', '')
    							. '</div>',
    						get_bloginfo( 'name' )
    					);
    			}
    		}
    	}
    	add_action('get_header', 'kleo_maintenance_mode');
    }
    

    Logged in users can bypass the maintenance mode.

    Let me know if is ok.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #42002
     mattylb
    Participant

    Hi Radu,

    That didn’t work for me on my multi-site testing site, but I will try it again on a normal wp site as soon as possible and let you know. Thank you for the quick response, by the way!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?