acf_maybe_get() ACF 5.1.5
This function will return a var if it exists in an array
Хуков нет.
Возвращает
$post_id. (int)
Использование
acf_maybe_get( $array, $key, $default );
- (array)($массив) (обязательный)
- the array to look within
- (key)($key) (обязательный)
- the array key to look for. Nested values may be found using '/'
- (mixed)($default) (обязательный)
- the value returned if not found
Список изменений
С версии 5.1.5 | Введена. |
Код acf_maybe_get() acf maybe get ACF 5.9.1
function acf_maybe_get( $array = array(), $key = 0, $default = null ) {
return isset( $array[$key] ) ? $array[$key] : $default;
}