Add support to get_terms() to allow 'include' & 'exclude' args to be arrays(). Fixes #11076 props scribu.

git-svn-id: https://develop.svn.wordpress.org/trunk@12658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2010-01-08 08:44:45 +00:00
parent 2a93c55f43
commit b2360778ee
2 changed files with 41 additions and 29 deletions
+15
View File
@@ -2749,6 +2749,21 @@ function wp_parse_args( $args, $defaults = '' ) {
return $r;
}
/**
* Clean up an array, comma- or space-separated list of IDs
*
* @since 3.0.0
*
* @param array|string $list
* @return array Sanitized array of IDs
*/
function wp_parse_id_list($list) {
if ( !is_array($list) )
$list = preg_split('/[\s,]+/', $list);
return array_unique(array_map('absint', $list));
}
/**
* Determines if default embed handlers should be loaded.
*