members_sanitize_role

The members members sanitize role hook.

Published Date - July 31, 2023

Description

return apply_filters( 'members_sanitize_role', str_replace( ' ', '_', $_role ), $role );

Parameters

  1. $str_replace

  2. $role


Usage

The following example is for adding a hook callback.

// define the members_sanitize_role callback 
function custom_members_sanitize_role( $str_replace, $role ){ 
   //custom code here
    return $str_replace
} 

//add the action 
add_filter('members_sanitize_role', 'custom_members_sanitize_role', 10, 2)

Defined

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

members/inc/functions-roles.php

return apply_filters( 'members_sanitize_role', str_replace( ' ', '_', $_role ), $role );