WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

acf_register_location_type() ACF 5.9.0

Registers a location type.

Хуки из функции
Возвращает

(ACF_Location|false).

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

acf_register_location_type( $class_name );
$class_name(строка) (обязательный)
The location class name.

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

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

Код acf_register_location_type() ACF 5.9.1

<?php
function acf_register_location_type( $class_name ) {
	$store = acf_get_store( 'location-types' );
	
	// Check class exists.
	if( !class_exists($class_name) ) {
		$message = sprintf( __( 'Class "%s" does not exist.', 'acf' ), $class_name );
		_doing_it_wrong( __FUNCTION__, $message, '5.9.0' );
		return false;
	}
	
	// Create instance.
	$location_type = new $class_name();
	$name = $location_type->name;
	
	// Check location type is unique.
	if( $store->has( $name ) ) {
		$message = sprintf( __( 'Location type "%s" is already registered.' ), $name );
		_doing_it_wrong( __FUNCTION__, $message, '5.9.0' );
		return false;
	}
	
	// Add to store.
	$store->set( $name, $location_type );
	
	/**
	 * Fires after a location type is registered.
	 *
	 * @date	8/4/20
	 * @since	5.9.0
	 *
	 * @param	string $name The location type name.
	 * @param	ACF_Location $location_type The location type instance.
	 */
	do_action( 'acf/registered_location_type', $name, $location_type );
	
	// Return location type instance.
	return $location_type;
}