acf_upgrade_500_field_groups()ACF 5.7.4

acf_upgrade_500_field_groups

Upgrades all ACF4 field groups to ACF5

Хуков нет.

Возвращает

null. Ничего.

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

acf_upgrade_500_field_groups();

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

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

Код acf_upgrade_500_field_groups() ACF 5.10.2

function acf_upgrade_500_field_groups() {

	// log
	acf_dev_log( 'ACF Upgrade 5.0.0 Field Groups.' );

	// get old field groups
	$ofgs = get_posts(
		array(
			'numberposts'      => -1,
			'post_type'        => 'acf',
			'orderby'          => 'menu_order title',
			'order'            => 'asc',
			'suppress_filters' => true,
		)
	);

	// loop
	if ( $ofgs ) {
		foreach ( $ofgs as $ofg ) {
			acf_upgrade_500_field_group( $ofg );
		}
	}
}