Home>Support>edit home page displays in the admin bar – need to hide this

edit home page displays in the admin bar – need to hide this

I am using the Vantage theme and from my expert (google) research, I believe the solution is somewhere in this theme. I have added the plugin “Admin Bar Login” and “White Label CMS” to display a login / register / PW etc at all times. when a user is not logged in.

When a user isn’t logged in, the link to edit the home page appears in the admin bar….. This really seams counter-intuitive considering who would be visiting the site.. http://www.precmarketing.com

I NEED to hide this and can’t find the solution, nor do I see it in a quick scan of the wp-includes file. Any help would be appreciated!!!

Thanks!

URL: http://www.precmarketing.com

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 10 months ago Andrew Misplon
    Hi, I Work Here

    Hi Todd

    This is unfortunately a known bug. It’ll be resolved in Page Builder 2.0. For now you can hotfix. Open siteorigin-panels.php. This file can be located on your server at: /wp-content/plugins/siteorigin-panels/siteorigin-panels.php. Search that file for the function that begins with the following lines:

    /**
     * Add the Edit Home Page item to the admin bar.
    

    Replace that entire function with the following:

    /**
     * Add the Edit Home Page item to the admin bar.
     *
     * @param WP_Admin_Bar $admin_bar
     * @return WP_Admin_Bar
     */
    function siteorigin_panels_admin_bar_menu($admin_bar){
    	// Ignore this unless the theme is using the home page feature.
    	if( !siteorigin_panels_setting('home-page') ) return $admin_bar;
    	if( !current_user_can('edit_theme_options') ) return $admin_bar;
    
    	if( is_home() || is_front_page() ) {
    		if( ( is_page() && get_the_ID() == get_option('siteorigin_panels_home_page_id') ) || current_user_can('edit_theme_options') ) {
    			$admin_bar->add_node( array(
    				'id' => 'edit-home-page',
    				'title' => __('Edit Home Page', 'siteorigin-panels'),
    				'href' => admin_url('themes.php?page=so_panels_home_page')
    			) );
    		}
    
    		if( is_page() && get_the_ID() == get_option('siteorigin_panels_home_page_id')  ) {
    			$admin_bar->remove_node('edit');
    		}
    	}
    
    	return $admin_bar;
    }
    add_action('admin_bar_menu', 'siteorigin_panels_admin_bar_menu', 100);
    
Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More