Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter orangebubble

    (@orangebubble)

    I found an issue with multisites – user could edit other sites themes from the admin bar theme menu even if they didnt have the access to the other multisite sites!!

    Add the following code above line 19 which states
    $wp_admin_bar->add_menu( array(

    Add this code:

    $admin_access = apply_filters( 'et_showcontrol_panel', current_user_can('switch_themes') );
    	if ( !$admin_access ) return;

    The code should now look like this:

    function add_theme_selector( $wp_admin_bar ) {
    
    	if (is_user_logged_in() && (!isset($_REQUEST['template']) || $_REQUEST['template']=='')) 
    
    	$admin_access = apply_filters( 'et_showcontrol_panel', current_user_can('switch_themes') );
    	if ( !$admin_access ) return;
    		$wp_admin_bar->add_menu( array(
    		'title' => __( 'Change Theme', 'direitoamoradia' ) ,
    		'id' => 'change_theme',
    		'href' => get_bloginfo('url').'/?customize=true' )
    	);	
    
    }
    add_action( 'admin_bar_menu', 'add_theme_selector' );

    I am using the wordpress 3.3, the wp_get_themes() is not supported by this version, I replaced the line
    $avaliable_themes = get_themes();
    with
    $wp_list_table = _get_list_table(‘WP_Themes_List_Table’);
    $wp_list_table->prepare_items();
    $avaliable_themes = $wp_list_table->items;

    to display network enabled themes

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite Support’ is closed to new replies.