function wp_parse_id_list( $list ) {}

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


  • array|string $list

Return values

returns:Sanitized array of IDs

Source code

function wp_parse_id_list( $list ) {

	if ( !is_array($list) )

		$list = preg_split('/[\s,]+/', $list);

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



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: