wp_get_list_item_separator()
Gets the separator for list items. What the separator will be depends on the current site locale.
What separator will be used is determined by the translation string __( ', ' ).
1 time — 0.000005 sec (speed of light) | 50000 times — 0.01 sec (speed of light)
No Hooks.
Returns
String. The list item separator corresponding to the locale.
Usage
wp_get_list_item_separator();
Examples
#1 Demo
var_dump( wp_get_list_item_separator() ); // string(2) ", "
Notes
- Global. WP_Locale.
$wp_localeWordPress date and time locale object.
Changelog
| Since 6.0.0 | Introduced. |
wp_get_list_item_separator() wp get list item separator code WP 7.0
function wp_get_list_item_separator() {
global $wp_locale;
if ( ! ( $wp_locale instanceof WP_Locale ) ) {
// Default value of WP_Locale::get_list_item_separator().
/* translators: Used between list items, there is a space after the comma. */
return __( ', ' );
}
return $wp_locale->get_list_item_separator();
}