• subagh

    (@subagh)


    Hello I would like to be the only to have access to the history log of users with simple history. I don’t not want any other user role having access to the logs.I am the admin

    How do i do this?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author eskapism

    (@eskapism)

    Hi! I saw in another support thread that you found this solution.

    I can post the same solution here and you can try it and post any remaining questions here. The code below can be added in for example the functions.php file in your theme.

    <?php 
    
    // Allow only the users specified in $allowed_users to show the history page, the history widget on the dashboard, or the history settings page
    add_filter( 'simple_history/show_dashboard_page', 'function_show_history_dashboard_or_page' );
    add_filter( 'simple_history/show_dashboard_widget', 'function_show_history_dashboard_or_page' );
    add_filter( 'simple_history/show_settings_page', 'function_show_history_dashboard_or_page' );
    add_filter( 'simple_history/add_admin_bar_menu_item', 'function_show_history_dashboard_or_page' );
    add_filter( 'simple_history/add_admin_bar_network_menu_item', 'function_show_history_dashboard_or_page' );
    
    
    function function_show_history_dashboard_or_page( $show ) {
    
    	$allowed_users = array(
    		'[email protected]',
    		'[email protected]',
    	);
    
    	$user = wp_get_current_user();
    
    	if ( ! in_array( $user->user_email, $allowed_users ) ) {
    		$show = false;
    	}
    
    	return $show;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Simple History Plug In Access to Only Admin User’ is closed to new replies.