aam_get_resource_filter

Purpose

Supply a custom resource object for an access level.

Callback

Example

add_filter('aam_get_resource_filter', function ($resource, $access_level, $resource_type) {
    if (defined('WP_DEBUG') && WP_DEBUG) {
        error_log('aam_get_resource_filter ran');
    }
    return $resource;
}, 10, 3);

Shows when this filter runs during debugging and preserves the incoming value. Replace the diagnostic with a narrowly scoped change to the returned value.

See the complete hook list.