acf_merge_atts()
acf_merge_atts
description
Хуков нет.
Возвращает
$post_id. (int)
Использование
acf_merge_atts( $atts, $extra );
- $atts(обязательный)
- .
- $extra
- .
По умолчанию: array()
Список изменений
| С версии 5.0.9 | Введена. |
Код acf_merge_atts() acf merge atts ACF 6.4.2
function acf_merge_atts( $atts, $extra = array() ) {
// bail early if no $extra
if ( empty( $extra ) ) {
return $atts;
}
// trim
$extra = array_map( 'trim', $extra );
$extra = array_filter( $extra );
// merge in new atts
foreach ( $extra as $k => $v ) {
// append
if ( $k == 'class' || $k == 'style' ) {
$atts[ $k ] .= ' ' . $v;
// merge
} else {
$atts[ $k ] = $v;
}
}
return $atts;
}