_acf_render_field_list()
Outputs the hidden input listing the top-level field keys a render call output.
The list is signed for the current user and the render ID (the object the fields were rendered for), so save handlers can tell which submitted keys were rendered without reconstructing the form. It is output outside the field wrappers so conditional logic doesn't disable it. Postboxes hidden by the location rule check disable it with their fields.
The signature is a nonce, valid for the same 12–24 hours as _acf_nonce. If ACF ever refreshes _acf_nonce on long-lived screens, these lists must be refreshed with it.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
void. Ничего (null).
Использование
_acf_render_field_list( $keys, $render_id, $list_name );
- $keys(массив) (обязательный)
- The top-level keys.
- $render_id(строка) (обязательный)
- The render ID.
- $list_name(строка) (обязательный)
- The root name of the input, such as
_acf_fields.
Список изменений
| С версии 6.8.11 | Введена. |
Код _acf_render_field_list() acf render field list ACF 6.8.11
function _acf_render_field_list( $keys, $render_id, $list_name ) {
// Commas and pipes delimit the list.
$keys = array_filter(
array_unique( array_map( 'strval', $keys ) ),
function ( $key ) {
return '' !== $key && strpbrk( $key, ',|' ) === false;
}
);
if ( ! $keys || ! is_string( $render_id ) || '' === $render_id || ! is_string( $list_name ) || '' === $list_name ) {
return;
}
sort( $keys );
$csv = implode( ',', $keys );
acf_hidden_input(
array(
'name' => $list_name . '[' . $render_id . '][]',
'value' => $csv . '|' . wp_create_nonce( _acf_get_field_list_nonce_action( $render_id, $csv ) ),
)
);
}