_acf_untrash_field_post_status()ACF 5.9.5

Filter callback which returns the previous post_status instead of "draft" for the "acf-field" post type.

Prior to WordPress 5.6.0, this filter was not needed as restored posts were always assigned their original status.

Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.

Хуков нет.

Возвращает

Строку..

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

_acf_untrash_field_post_status( $new_status, $post_id, $previous_status );
$new_status(строка) (обязательный)
The new status of the post being restored.
$post_id(int) (обязательный)
The ID of the post being restored.
$previous_status(строка) (обязательный)
The status of the post at the point where it was trashed.

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

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

Код _acf_untrash_field_post_status() ACF 6.0.4

function _acf_untrash_field_post_status( $new_status, $post_id, $previous_status ) {
	return ( get_post_type( $post_id ) === 'acf-field' ) ? $previous_status : $new_status;
}