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

    (@wuri)

    more concrete. i like to change edit_users to edit_pages for

    User Logger
    SimpleUserLogger
    edit_users

    User Switching Logger
    PluginUserSwitchingLogger
    edit_users

    Plugin Author Pär Thernström

    (@eskapism)

    There is a filter you can use to modify this: simple_history/loggers_user_can_read/can_read_single_logger.

    An example on how to use this:

    
    // Modify who can read a logger
    // Modify the if part to give users access or no access to a logger
    add_filter( 'simple_history/loggers_user_can_read/can_read_single_logger', function( $user_can_read_logger, $logger_instance, $user_id ) {
    	// in this example user with id 3 gets access to the post logger
    	// while user with id 8 does not get any access to it
    	if ( $logger_instance->slug == "SimplePostLogger" && $user_id === 3 ) {
    		$user_can_read_logger = true;
    	} else if ( $logger_instance->slug == "SimplePostLogger" && $user_id === 9 ) {
    		$user_can_read_logger = false;
    	}
    	return $user_can_read_logger;
    }, 10, 3 );
    
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Editor History View’ is closed to new replies.