wc_get_string_before_colon()
Get part of a string before :.
Used for example in shipping methods ids where they take the format method_id:instance_id
No Hooks.
Return
String
.
Usage
wc_get_string_before_colon( $string );
- $string(string) (required)
- String to extract.
Changelog
Since 3.2.0 | Introduced. |
wc_get_string_before_colon() wc get string before colon code WC 9.6.1
function wc_get_string_before_colon( $string ) { return trim( current( explode( ':', (string) $string ) ) ); }