_acf_untrash_field_group_post_status()ACF 5.9.5

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

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

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Returns

String..

Usage

_acf_untrash_field_group_post_status( $new_status, $post_id, $previous_status );
$new_status(string) (required)
The new status of the post being restored.
$post_id(int) (required)
The ID of the post being restored.
$previous_status(string) (required)
The status of the post at the point where it was trashed.

Changelog

Since 5.9.5 Introduced.

_acf_untrash_field_group_post_status() code ACF 6.0.4

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