acf_duplicate_internal_post_type()ACF 6.1

Duplicates an ACF post.

Хуков нет.

Возвращает

Массив|true|false. The new ACF post, or false on failure.

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

acf_duplicate_internal_post_type( $id, $new_post_id, $post_type );
$id(int|строка)
The field_group ID, key or name.
$new_post_id(int)
Optional ID to override.
$post_type(строка)
The post type of the post being duplicated.
По умолчанию: 'acf-field-group'

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

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

Код acf_duplicate_internal_post_type() ACF 6.4.2

function acf_duplicate_internal_post_type( $id = 0, $new_post_id = 0, $post_type = 'acf-field-group' ) {
	$instance = acf_get_internal_post_type_instance( $post_type );

	if ( $instance ) {
		return $instance->duplicate_post( $id, $new_post_id );
	}

	return false;
}