ACF_Internal_Post_Type::validate_post
Validates an ACF internal post type.
Метод класса: ACF_Internal_Post_Type{}
Хуки из метода
Возвращает
Массив.
Использование
$ACF_Internal_Post_Type = new ACF_Internal_Post_Type(); $ACF_Internal_Post_Type->validate_post( $post );
- $post(массив)
- The main post array.
По умолчанию:array()
Список изменений
| С версии 6.1 | Введена. |
Код ACF_Internal_Post_Type::validate_post() ACF Internal Post Type::validate post ACF 6.4.2
public function validate_post( $post = array() ) {
// Bail early if already valid.
if ( is_array( $post ) && ! empty( $post['_valid'] ) ) {
return $post;
}
$post = wp_parse_args(
$post,
$this->get_settings_array()
);
// Convert types.
$post['ID'] = (int) $post['ID'];
$post['menu_order'] = (int) $post['menu_order'];
$post['active'] = (bool) $post['active'];
// Post is now valid.
$post['_valid'] = true;
/**
* Filters the ACF post array to validate settings.
*
* @date 12/02/2014
* @since 5.0.0
*
* @param array $post The post array.
*/
return apply_filters( "acf/validate_{$this->hook_name}", $post );
}