acf_maybe_get()
acf_maybe_get
This function will return a var if it exists in an array
Хуков нет.
Возвращает
$post_id. (int)
Использование
acf_maybe_get( $array, $key, $default );
- $array
- .
По умолчанию: array() - $key
- .
- $default
- .
По умолчанию: null
Список изменений
| С версии 5.1.5 | Введена. |
Код acf_maybe_get() acf maybe get ACF 6.4.2
function acf_maybe_get( $array = array(), $key = 0, $default = null ) {
return isset( $array[ $key ] ) ? $array[ $key ] : $default;
}