ACF_Internal_Post_Type::import_post
Imports an ACF post into the database.
Метод класса: ACF_Internal_Post_Type{}
Хуки из метода
Возвращает
Массив.
Использование
$ACF_Internal_Post_Type = new ACF_Internal_Post_Type(); $ACF_Internal_Post_Type->import_post( $post );
- $post(массив) (обязательный)
- The ACF post array.
Список изменений
| С версии 6.1 | Введена. |
Код ACF_Internal_Post_Type::import_post() ACF Internal Post Type::import post ACF 6.4.2
public function import_post( $post ) {
// Disable filters to ensure data is not modified by local, clone, etc.
$filters = acf_disable_filters();
// Validate the post (ensures all settings exist).
$post = $this->get_valid_post( $post );
// Prepare post for import (modifies settings).
$post = $this->prepare_post_for_import( $post );
// Save field group.
$post = $this->update_post( $post );
// Enable filters again.
acf_enable_filters( $filters );
/**
* Fires immediately after an ACF post has been imported.
*
* @date 12/02/2014
* @since 5.0.0
*
* @param array $post The ACF post array.
*/
do_action( "acf/import_{$this->hook_name}", $post );
return $post;
}