ACF_Admin_UI_Options_Page::save_postpublicACF 1.0.0

Saves post type data.

Метод класса: ACF_Admin_UI_Options_Page{}

Хуков нет.

Возвращает

integer. $post_id

Использование

$ACF_Admin_UI_Options_Page = new ACF_Admin_UI_Options_Page();
$ACF_Admin_UI_Options_Page->save_post( $post_id, $post );
$post_id(int) (обязательный)
The post ID.
$post(WP_Post) (обязательный)
The post object.

Список изменений

С версии 1.0.0 Введена.

Код ACF_Admin_UI_Options_Page::save_post() ACF 6.8.8

public function save_post( $post_id, $post ) {
	if ( ! $this->verify_save_post( $post_id, $post ) ) {
		return $post_id;
	}

	// Disable filters to ensure ACF loads raw data from DB.
	acf_disable_filters();

	// phpcs:disable WordPress.Security.NonceVerification.Missing -- Validated in $this->verify_save_post() above.
	// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when saved.
	$_POST['acf_ui_options_page']['ID']    = $post_id;
	$_POST['acf_ui_options_page']['title'] = isset( $_POST['acf_ui_options_page']['page_title'] ) ? $_POST['acf_ui_options_page']['page_title'] : '';

	// Save the post type.
	acf_update_internal_post_type( $_POST['acf_ui_options_page'], $this->post_type ); // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Validated in verify_save_post
	// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
	// phpcs:enable WordPress.Security.NonceVerification.Missing

	return $post_id;
}