ACF_Form_User::filter_pre_load_value
filter_pre_load_value
Checks if a $_POST value exists for this field to allow persistent values.
Метод класса: ACF_Form_User{}
Хуков нет.
Возвращает
Разное.
Использование
$ACF_Form_User = new ACF_Form_User(); $ACF_Form_User->filter_pre_load_value( $null, $post_id, $field );
- $null(null) (обязательный)
- A null placeholder.
- $post_id((int|string)) (обязательный)
- The post id.
- $field(массив) (обязательный)
- The field array.
Список изменений
| С версии 5.8.2 | Введена. |
Код ACF_Form_User::filter_pre_load_value() ACF Form User::filter pre load value ACF 6.4.2
function filter_pre_load_value( $null, $post_id, $field ) {
$field_key = $field['key'];
// phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified in save_user().
if ( isset( $_POST['acf'][ $field_key ] ) ) {
return $_POST['acf'][ $field_key ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized elsewhere.
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
return $null;
}