Hooks
SleekMotion fires these hooks for site code. Each is documented by the @api docblock on the apply_filters or do_action call that fires it; a hook without one is internal and may change without notice.
sleekMotion/init
Action, fired in product/includes/classes/Plugin.php.
Fires once after Motion has booted: its WP-CLI commands, front-end script and settings operations are registered.
| Parameter | Type | Description |
|---|---|---|
$plugin |
\SleekMotion\Plugin |
The booted Motion instance, also returned by sleekMotion(). |
sleekMotion/load
Filter, fired in product/includes/classes/Setup.php.
Whether a front-end page loads Motion’s script. Motion looks for its class prefix and attribute in the markup the page printed before its footer scripts; return true for a page whose animated elements are added later by JavaScript, or false to keep the script off a page. The block editor and the builder previews Motion loads into are not filtered.
| Parameter | Type | Description |
|---|---|---|
$animated |
bool |
Whether the page’s markup holds an animated element, or true when Motion could not read it. |
Returns bool Whether the page loads the script.
sleekMotion/settings
Filter, fired in product/includes/classes/Setup.php.
Filters the settings Motion prints for its front-end script, on the site and in the editor previews it loads into. The settings screen, the REST operations and WP-CLI keep reading the stored option. Breakpoints and presets stay lists of name/value pairs; the editor setting has already been read at this point, so changing it here has no effect.
| Parameter | Type | Description |
|---|---|---|
$settings |
array |
The stored sleek-motion_settings document. |
Returns array The settings the script receives.