Role Manager #9
@ -1365,6 +1365,9 @@ if ( ! function_exists( 'fictioneer_get_font_colors' ) ) {
|
||||
/**
|
||||
* Explodes string into an array
|
||||
*
|
||||
* Strips lines breaks, trims whitespaces, and removes empty elements.
|
||||
* Values might not be unique.
|
||||
*
|
||||
* @since 5.1.3
|
||||
*
|
||||
* @param string $string The string to explode.
|
||||
@ -1373,8 +1376,11 @@ if ( ! function_exists( 'fictioneer_get_font_colors' ) ) {
|
||||
*/
|
||||
|
||||
function fictioneer_explode_list( $string ) {
|
||||
if ( empty( $string ) ) return [];
|
||||
if ( empty( $string ) ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$string = str_replace( ["\n", "\r"], '', $string ); // Remove line breaks
|
||||
$array = explode( ',', $string );
|
||||
$array = array_map( 'trim', $array ); // Remove extra whitespaces
|
||||
$array = array_filter( $array, 'strlen' ); // Remove empty elements
|
||||
|
Loading…
x
Reference in New Issue
Block a user