aioseo_access_control_excluded_roles

Purpose & version added

This filter can be used to manage the excluded roles from Access Control.

Arguments (1)

  1. $roles (array) – A list of roles being ignored.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below, we’ll remove the customer role from the excluded roles.

// Removes the customer role from the exclusion list.
add_filter( 'aioseo_access_control_excluded_roles', 'aioseo_filter_access_control_excluded_roles' );
function aioseo_filter_access_control_excluded_roles( $roles ) {
	if ( ( $key = array_search( 'customer', $roles ) ) !== false ) {
		unset( $roles[ $key ] );
	}
	return $roles;
}

Changelog

VersionDescription
4.1.4Introduced.