wpcf7_flat_join()CF7 1.0

Creates a comma-separated list from a multi-dimensional array.

Хуков нет.

Возвращает

Строку. Comma-separated list.

Использование

wpcf7_flat_join( $input, $args );
$input(разное) (обязательный)
Array or item of array.
$args(строка|массив)
Output options.
По умолчанию: ''

Код wpcf7_flat_join() CF7 5.9.3

function wpcf7_flat_join( $input, $args = '' ) {
	$args = wp_parse_args( $args, array(
		'separator' => ', ',
	) );

	$input = wpcf7_array_flatten( $input );
	$output = array();

	foreach ( (array) $input as $value ) {
		if ( is_scalar( $value ) ) {
			$output[] = trim( (string) $value );
		}
	}

	return implode( $args['separator'], $output );
}