wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_parse_id_list › WordPress Function

Desde3.0.0
Obsoleton/a
› wp_parse_id_list ( $input_list )
Parâmetros:
  • (array|string|int) $input_list List of IDs.
    Required: Yes
Retorna:
  • (int[]) Sanitized array of IDs. May include zero. Keys are preserved
    from the input and `array_unique()` may leave gaps, so the
    result is not necessarily a list.
Definido em:
Codex:
Log de mudanças:
  • 5.1.0
  • 7.2.0

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



Fonte

function wp_parse_id_list( $input_list ): array {
	$input_list = wp_parse_list( $input_list );

	return array_unique( array_map( 'absint', $input_list ) );
}