Extracts the directive attribute name to separate and return the directive prefix and an optional suffix.
Description
The suffix is the string after the first double hyphen and the prefix is everything that comes before the suffix.
Example:
extract_prefix_and_suffix( 'data-wp-interactive' ) => array( 'data-wp-interactive', null )
extract_prefix_and_suffix( 'data-wp-bind--src' ) => array( 'data-wp-bind', 'src' )
extract_prefix_and_suffix( 'data-wp-foo--and--bar' ) => array( 'data-wp-foo', 'and--bar' )Parameters
$directive_namestringrequired- The directive attribute name.
Source
* This method registers a script module to be loaded during client-side
* navigation in the Interactivity API router. Script modules marked with
* this method will have the `loadOnClientNavigation` option enabled in the
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.