ProviderInterface
ProviderInterface. This interface defines the core functionality required for any search provider.
Returns the publicly readable, translatable name for the provider. This is
used in the settings page and UI.
Returns a unique identifier for the provider. This is used for persisting
settings and provider identification.
Returns whether the provider is properly configured and ready to be used.
Creates a new item in the provider’s data storage.
Updates an existing item in the provider’s data storage.
Removes an item from the provider’s data storage.
HasSettings
HasSettings trait can be used by providers that need to expose configuration options in the settings page.
Returns an array of settings fields to be displayed in the settings page. See
Fields section below for structure.
Indicates if the provider has configurable settings. Defaults to
true.Returns the saved settings values for the provider. Uses the WordPress option name
merchant_buddy_{provider_slug}_settings.Returns the provider’s description for the settings page. Can return either: -
A string: Simple description text - An array: Structured description with
optional external link
Example
Example
Fields
Settings fields are defined as arrays with the following structure:The human-readable label for the field.
The field type. Can be one of:
text, password, checkbox, or select.The unique identifier for the field. Used to store and retrieve the value.
Help text explaining the purpose of the field.
Whether the field’s value should be exposed to the frontend. If true, the
value will be available at
window.searchBuddy[providerSlug][fieldName].Required for
select type fields. An array of options in the format:Batchable
Batchable interface. This enables efficient bulk operations for creating, updating, and deleting multiple items at once.
Adds multiple items to the provider’s storage in a single operation.
Updates multiple items in the provider’s storage in a single operation.
Deletes multiple items from the provider’s storage in a single operation.
Provider (TypeScript)
On the frontend, providers need to implement the Provider interface:
The provider’s unique identifier, matching the PHP provider’s slug.
Searches for items within a specific entity
Searches across all entities