wp_get_connectors()
Gets all registered connectors. Connector identifiers are used as array keys.
Call this function after the init action, for example on wp_loaded. Before the registry is initialized, it returns an empty array.
No Hooks.
Returns
Array.
array- connector data in the formidentifier => data, with fieldsname,description,type, optionallogo_url,authentication, and optionalplugin.[]- if the registry is not initialized or there are no connectors.
Usage
wp_get_connectors(): array;
Examples
#1 Getting the names of all connectors
$connector_names = wp_list_pluck( wp_get_connectors(), 'name' );
Notes
Changelog
| Since 7.0.0 | Introduced. |
wp_get_connectors() wp get connectors code WP 7.0.4
function wp_get_connectors(): array {
$registry = WP_Connector_Registry::get_instance();
if ( null === $registry ) {
return array();
}
return $registry->get_all_registered();
}