WP_Connector_Registry::get_registered
Retrieves a registered connector.
Do not use this method directly. Instead, use the wp_get_connector()
Triggers a _doing_it_wrong() notice if the connector is not registered. Use is_registered() to check first when the connector may not exist.
Метод класса: WP_Connector_Registry{}
Хуков нет.
Возвращает
Массив|null. The registered connector data, or null if it is not registered.
Использование
$WP_Connector_Registry = new WP_Connector_Registry(); $WP_Connector_Registry->get_registered( $id ): ?array;
- $id(строка) (обязательный)
- The connector identifier.
Заметки
- Смотрите: wp_get_connector()
Список изменений
| С версии 7.0.0 | Введена. |
Код WP_Connector_Registry::get_registered() WP Connector Registry::get registered WP 7.0.3
public function get_registered( string $id ): ?array {
if ( ! $this->is_registered( $id ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Connector ID. */
sprintf( __( 'Connector "%s" not found.' ), esc_html( $id ) ),
'7.0.0'
);
return null;
}
return $this->registered_connectors[ $id ];
}