Converts a function name to an ability name.
Description
Transforms “wpabteccreate_event” to “tec/create_event”.
Parameters
$function_namestringrequired- The function name to convert.
Source
public static function function_name_to_ability_name( string $function_name ): string {
$without_prefix = substr( $function_name, strlen( self::ABILITY_PREFIX ) );
return str_replace( '__', '/', $without_prefix );
}
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.