WordPress at a glance

wp_parse_slug_list() WP 1.0

Clean up an array, comma- or space-separated list of slugs.

Works based on: sanitize_title()
1 time — 0.000199 sec (fast) | 50000 times — 3.64 sec (fast) | PHP 7.0.8, WP 4.7

No Hooks.


String[]. Sanitized array of slugs.


wp_parse_slug_list( $list );
$list(array|string) (required)
List of slugs.


Since 4.7.0 Introduced.

Code of wp_parse_slug_list() WP 5.7.2

function wp_parse_slug_list( $list ) {
	$list = wp_parse_list( $list );

	return array_unique( array_map( 'sanitize_title', $list ) );

From tag: array list help functions (sorting arrays objects)

More from tag: sanitize_

More from category: Helper Functions

No comments
    Log In