wc_get_string_before_colon() WC 3.2.0
Get part of a string before :.
Used for example in shipping methods ids where they take the format method_id:instance_id
Хуков нет.
Возвращает
Строку.
Использование
wc_get_string_before_colon( $string );
- $string(строка) (обязательный)
- String to extract.
Список изменений
С версии 3.2.0 | Введена. |
Код wc_get_string_before_colon() wc get string before colon WC 4.9.1
function wc_get_string_before_colon( $string ) {
return trim( current( explode( ':', (string) $string ) ) );
}