wpcf7_flat_join()
Creates a comma-separated list from a multi-dimensional array.
Хуков нет.
Возвращает
Строку. Comma-separated list.
Использование
wpcf7_flat_join( $input, $options );
- $input(разное) (обязательный)
- Array or item of array.
- $options(строка|массив)
- Output options.
По умолчанию:''
Код wpcf7_flat_join() wpcf7 flat join CF7 6.1.6
function wpcf7_flat_join( $input, $options = '' ) {
$options = wp_parse_args( $options, array(
'separator' => ', ',
) );
$input = wpcf7_array_flatten( $input );
$output = array();
foreach ( $input as $value ) {
if ( is_scalar( $value ) ) {
$output[] = trim( (string) $value );
}
}
return implode( $options['separator'], $output );
}