Define entity names that custom data sources are not allowed to register. Reserved names are skipped when the registry processes sources from wpd_alpha_insights_register_data_sources.
The registry protects built-in entity names by optionally maintaining a reserved list. If a custom source returns an entity name in this list, that mapping is not registered. The default is an empty array (no names reserved). You can add entity names (e.g. orders, products) to prevent third-party sources from overriding core entities.
File: includes/classes/WPDAI_Custom_Data_Source_Registry.php
Method: get_reserved_entity_names()
| Parameter | Type | Description |
|---|---|---|
| $default | array | Default reserved names (empty array by default) |
Type: array
List of entity name strings that custom sources cannot register.
add_filter( 'wpd_alpha_insights_reserved_entity_names', 'reserve_core_entities' );
function reserve_core_entities( $default ) {
return array(
'orders',
'products',
'customers',
'expenses',
'store_profit',
'analytics',
);
}