- Filter Reference
- Table of Contents
- stellarwp/telemetry/{hook-prefix}/should_show_optin
- stellarwp/telemetry/{hook-prefix}/option_name
- stellarwp/telemetry/{hook-prefix}/optin_status
- stellarwp/telemetry/{hook-prefix}/optin_status_label
- stellarwp/telemetry/optin_args
- stellarwp/telemetry/{stellar_slug}/optin_args
- stellarwp/telemetry/{hook-prefix}/show_optin_option_name
- stellarwp/telemetry/{hook-prefix}/register_site_url
- stellarwp/telemetry/{hook-prefix}/register_site_data
- stellarwp/telemetry/{hook-prefix}/register_site_user_details
- stellarwp/telemetry/{hook-prefix}/send_data_args
- stellarwp/telemetry/{hook-prefix}/send_data_url
- stellarwp/telemetry/{hook-prefix}/last_send_expire_seconds
- stellarwp/telemetry/exit_interview_args
- stellarwp/telemetry/{stellar_slug}/exit_interview_args
- stellarwp/telemetry/{hook-prefix}/event_data
- stellarwp/telemetry/{hook-prefix}/events_url
- Action Reference
- Table of Contents
If you configured this library to use a hook prefix, note that all hooks will now use this prefix. For example:
add_filter( 'stellarwp/telemetry/my-custom-prefix/should_show_optin', 'my-custom-filter', 10, 1 );
Filters whether the user should be shown the opt-in modal.
Parameters: bool $should_show
Default: true
Filter the option name used to store current users' optin status.
Parameters: string $option_name
Default: stellarwp_telemetry
Filter the optin status of the current site.
Parameters: integer $status
Default: 1
Each status corresponds with an integer:
1 = 'Active',
2 = 'Inactive',
3 = 'Mixed',
Filter the label used to show the current opt-in status of the site.
Parameters: string $optin_label
Default: see: stellarwp/telemetry/optin_status
Filter the arguments passed to the opt-in modal.
Parameters: array $args
, string $stellar_slug
Default:
$args = [
'plugin_logo' => Resources::get_asset_path() . 'resources/images/stellar-logo.svg',
'plugin_logo_width' => 151,
'plugin_logo_height' => 32,
'plugin_logo_alt' => 'StellarWP Logo',
'plugin_name' => 'The Events Calendar',
'plugin_slug' => $stellar_slug,
'user_name' => wp_get_current_user()->display_name,
'permissions_url' => '#',
'tos_url' => '#',
'privacy_url' => '#',
'opted_in_plugins_text' => __( 'See which plugins you have opted in to tracking for', 'stellarwp-telemetry' ),
'heading' => __( 'We hope you love {plugin_name}.', 'stellarwp-telemetry' ),
'intro' => __( 'Hi, {user_name}.! This is an invitation to help our StellarWP community. If you opt-in, some data about your usage of {plugin_name} and future StellarWP Products will be shared with our teams (so they can work their butts off to improve). We will also share some helpful info on WordPress, and our products from time to time. And if you skip this, that’s okay! Our products still work just fine.', 'stellarwp-telemetry' ),
];
This filter will be deprecated in future versions. Use stellarwp/telemetry/optin_args instead.
Filters the string used for the option that determines whether the opt-in modal should be shown.
Parameters: string $option_name
Default: stellarwp_telemetry_{plugin_slug}_show_optin
Filters the url of the telemetry server that will store the site data when registering a new site.
Parameters: string $url
Default: https://telemetry.example.com/api/v1/register-site
Filters the data that is sent to the telemetry server when registering a new site.
Parameters: array $site_data
Default:
$site_data = [
'telemetry' => json_encode( $this->provider->get_data() ),
];
Filters the user details that is sent to the telemetry server when registering a new site.
Parameters: array $user_details
Default:
$user_details = [
'name' => $user->display_name,
'email' => $user->user_email,
'plugin_slug' => Config::get_container()->get( Core::PLUGIN_SLUG ),
];
Parameters: array $data_args
Default:
$data_args = [
'token' => $this->get_token(),
'telemetry' => json_encode( $this->provider->get_data() ),
];
Filters the full url to use when sending data to the telemetry server.
Parameters: string $url
Default: https://telemetry.example.com/api/v1/telemetry
Filters how often the library should send site health data to the telemetry server.
Parameters: integer $seconds
Default: 7 * DAY_IN_SECONDS
Filters the arguments used in the plugin deactivation "exit interview" form.
Parameters: array $args
, string $stellar_slug
Default:
$args = [
'plugin_slug' => $stellar_slug,
'plugin_logo' => plugin_dir_url( __DIR__ ) . 'public/logo.png',
'plugin_logo_width' => 151,
'plugin_logo_height' => 32,
'plugin_logo_alt' => 'StellarWP Logo',
'heading' => __( 'We’re sorry to see you go.', 'stellarwp-telemetry' ),
'intro' => __( 'We’d love to know why you’re leaving so we can improve our plugin.', 'stellarwp-telemetry' ),
'questions' => [
[
'question' => __( 'I couldn’t understand how to make it work.', 'stellarwp-telemetry' ),
'show_field' => true
],
[
'question' => __( 'I found a better plugin.', 'stellarwp-telemetry' ),
'show_field' => true
],
[
'question' => __( 'I need a specific feature it doesn’t provide.', 'stellarwp-telemetry' ),
'show_field' => true
],
[
'question' => __( 'The plugin doesn’t work.', 'stellarwp-telemetry' ),
'show_field' => true
],
[
'question' => __( 'It’s not what I was looking for.', 'stellarwp-telemetry' ),
'show_field' => true
]
],
];
This filter will be deprecated in future versions. Use stellarwp/telemetry/exit_interview_args instead.
Filters the array of data sent along with the event.
Parameters: array $data
Default:
$data = [
'token' => $this->telemetry->get_token(),
'stellar_slug' => Config::get_stellar_slug(),
'event' => $name,
'event_data' => wp_json_encode( $data ),
];
Filters the event URL used when sending events to the Telemetry server.
Parameters: string $url
Default: https://telemetry.stellarwp.com/api/v1/events
Parameters: string $stellar_slug
The stellar slug of the plugin for which the modal should be shown.
This filter will be deprecated in future versions. Use stellarwp/telemetry/optin instead.
Sends a site event to the Telemetry server.
Parameters:
- string
$event
The name of the event. - array
$data
A set of data that should be passed along with the event.