Hooks and REST API
The developer surface: filters and actions for extending Range Trust, the REST namespace, the capability, and template overrides.
Filters
| Filter | Signature | Purpose |
|---|---|---|
range_trust_platforms |
( Platform[] $platforms ) |
Register custom platform connectors (implement RangeTrust\Platforms\Platform) |
range_trust_default_options |
( array $defaults ) |
Change plugin-wide option defaults |
range_trust_widget_defaults |
( array $defaults ) |
Change default widget settings |
range_trust_widget_html |
( string $html, array $settings, int $widget_id ) |
Filter final widget markup |
range_trust_schema_node |
( array $node, array $settings, array $aggregate ) |
Adjust the schema.org node |
range_trust_schema_handled |
( bool $handled ) |
Force/disable SEO-plugin graph routing |
range_trust_admin_notices |
( array $notices ) |
Add/remove persistent admin notices |
range_trust_capability |
( string $capability ) |
Map range_trust_manage to a different cap |
range_trust_send_invite |
( bool $sent, array $invite ) |
Observe/override invitation sending |
range_trust_template |
( string $file, string $relative ) |
Redirect template resolution |
range_trust_update_manifest |
( string $url ) |
Point the updater elsewhere |
range_trust_ai_model |
( string $model ) |
Override the AI model id |
Actions
| Action | Signature | Fires |
|---|---|---|
range_trust_loaded |
( Plugin $plugin ) |
After the plugin boots |
range_trust_synced |
( int $source_id, int $stored, int[] $fresh_ids ) |
After a source syncs |
range_trust_sync_failed |
( int $source_id, Throwable $e ) |
When a sync errors |
range_trust_funnel_submission |
( int $review_id, int $rating, bool $private ) |
After a funnel submission |
range_trust_daily_maintenance |
(none) | Daily, from cron |
range_trust_admin_tab_{tab} / range_trust_admin_action_{action} |
(none) | Custom admin tabs/actions |
Registering a platform
add_filter( 'range_trust_platforms', function ( $platforms ) {
$platforms[] = new My_Platform(); // implements RangeTrust\Platforms\Platform
return $platforms;
} );
REST API
Namespace range-trust/v1. Admin routes require the range_trust_manage capability and a REST nonce:
| Route | Method | Purpose |
|---|---|---|
/preview |
POST | Render settings to HTML (widget editor) |
/sync/{id} |
POST | Sync one source |
/reviews/{id} |
POST | Moderate: status, tags, reply |
/ai/reply/{id} |
POST | Draft a reply |
/ai/summary |
POST | Generate a summary for settings |
/funnel |
POST | Public funnel submission (throttled, honeypotted) |
Capability
Everything in wp-admin checks range_trust_manage, which maps to manage_options unless filtered via range_trust_capability; hand it to editors with a role plugin if an agency manages reviews.
Constants
RANGE_TRUST_LICENSE_OVERRIDE (bool) forces the licence verdict; RANGE_TRUST_UPDATE_URL overrides the update manifest URL.