wc_get_string_before_colon( string $string )
Get part of a string before :.
Description Description
Used for example in shipping methods ids where they take the format method_id:instance_id
Parameters Parameters
- $string
-
(Required) String to extract.
Return Return
(string)
Source Source
File: includes/wc-formatting-functions.php
function wc_get_string_before_colon( $string ) { return trim( current( explode( ':', (string) $string ) ) ); }
Changelog Changelog
Version | Description |
---|---|
3.2.0 | Introduced. |