app()->namespace . '/role_has_access'

The members app()->namespace . '/role has access' hook.

Published Date - July 31, 2023

Description

return apply_filters(
		app()->namespace . '/role_has_access',
		in_array( $role, get_roles_with_access() ),
		$role
	);

Parameters

  1. $in_array)

  2. $role


Usage

The following example is for adding a hook callback.

// define the app()->namespace . '/role_has_access' callback 
function custom_app()->namespace . '_role_has_access'( $in_array), $role ){ 
   //custom code here
    return $in_array)
} 

//add the action 
add_filter('app()->namespace . '/role_has_access'', 'custom_app()->namespace . '/role_has_access'', 10, 2)

Defined

The filter is defined in the following location(s).

members/addons/members-admin-access/app/functions.php

return apply_filters(
		app()->namespace . '/role_has_access',
		in_array( $role, get_roles_with_access() ),
		$role
	);