wpcf7_flat_join()
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() wpcf7 flat join CF7 5.7.5.1
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 ); }