WP_Connector_Registry::set_instancepublic staticWP 7.0.0

Sets the main instance of the registry class.

Called by _wp_connectors_init() during the init action. Must not be called outside of that context.

Метод класса: WP_Connector_Registry{}

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WP_Connector_Registry::set_instance( $registry ): void;
$registry(WP_Connector_Registry) (обязательный)
The registry instance.

Заметки

Смотрите: _wp_connectors_init()

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

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

Код WP_Connector_Registry::set_instance() WP 7.1

public static function set_instance( WP_Connector_Registry $registry ): void {
	if ( ! doing_action( 'init' ) ) {
		_doing_it_wrong(
			__METHOD__,
			__( 'The connector registry instance must be set during the <code>init</code> action.' ),
			'7.0.0'
		);
		return;
	}

	self::$instance = $registry;
}