WordPress at Your Fingertips

wp_parse_slug_list() WP 1.0

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

1 time — 0.000199 sec (fast) | 50000 times — 3.64 sec (fast) | PHP 7.0.8, WP 4.7

No Hooks.

Return

String[]. Sanitized array of slugs.

Usage

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

Changelog

Since 4.7.0 Introduced.
Since 5.1.0 Refactored to use wp_parse_list().

Code of wp_parse_slug_list() WP 5.8.1

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

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

array list help functions (sorting arrays objects)

sanitize_

Helper Functions

No comments
    Log In