id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 34525 Use wp_parse_id_list() in the WP_Query class birgire "We have this handy core function to clean up an array, comma- or space separated list of IDs: {{{ function wp_parse_id_list( $list ) { if ( !is_array($list) ) $list = preg_split('/[\s,]+/', $list); return array_unique(array_map('absint', $list)); } }}} Why not use it where we can? == Examples: == Instead of the following lines, in the {{{WP_Query}}} class: {{{ $q['category__in'] = array_map( 'absint', array_unique( (array) $q['category__in'] ) ); $q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ) ); $q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ) ); $q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ) ); $q['tag__not_in'] = array_map('absint', array_unique( (array) $q['tag__not_in'] ) ); $q['tag__and'] = array_map('absint', array_unique( (array) $q['tag__and'] ) ); }}} we could simplify it with: {{{ $q['category__in'] = wp_parse_id_list( $q['category__in'] ); $q['category__not_in'] = wp_parse_id_list( $q['category__not_in'] ); $q['category__and'] = wp_parse_id_list( $q['category__and'] ); $q['tag__in'] = wp_parse_id_list( $q['tag__in'] ); $q['tag__not_in'] = wp_parse_id_list( $q['tag__not_in'] ); $q['tag__and'] = wp_parse_id_list( $q['tag__and'] ); }}} Similarly for: {{{ $author__not_in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__not_in'] ) ) ); $author__in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__in'] ) ) ); }}} we could use: {{{ $author__not_in = implode( ',', wp_parse_id_list( $q['author__not_in'] ) ); $author__in = implode( ',', wp_parse_id_list( $q['author__in'] ) ); }}} I will check it further and soon add the relevant patches. " enhancement new normal Query 4.3.1 normal has-patch