PrettyLinks 4.0.18 has 43 actions and 80 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when PrettyLinks fires an action
add_action( 'prli_delete_link', function( $id, $arg2 ) {
// Your code runs here.
}, 10, 2 );
// Change a value PrettyLinks is about to use
add_filter( 'prli_pretty_link_base', function( $url ) {
// Change $url here.
return $url;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filter: prli_pretty_link_base */ apply_filters( 'prli_pretty_link_base', home_url() ); -
/** * Filters whether prerelease versions are included when checking for updates. */ apply_filters( "{$this->pluginId}_allow_prerelease_versions", false ); -
/** * Filters the automatic update level for Pretty Links. */ apply_filters( "{$this->pluginId}_automatic_updates", self::AUTOMATIC_UPDATE_NONE ); -
/** * Filter: pl_get_current_client_ip */ apply_filters( 'pl_get_current_client_ip', $ip ); -
/** * Column list, including any Pro columns appended via the filter. */ apply_filters( 'prli_csv_export_columns', CsvExporter::COLUMNS ); -
/** * Action: prli_delete_link */ do_action( 'prli_delete_link', $id, ['soft' => true] ); -
/** * Resolve the per-source prefix via the shared link-prefix filter. */ apply_filters( 'prli_link_prefix_for_source', '', $source ); -
/** * Filter: prli_links_index_args */ apply_filters( 'prli_links_index_args', $args, $request ); -
/** * Action: prli_plugin_edition_changed */ do_action( 'prli_plugin_edition_changed', LicenseManager::normalizeEdition($licensedSlug !== '' ? $licensedSlug : $running), LicenseManager::normalizeEdition($running) ); -
/** * Filter: prli_pre_link_trash */ apply_filters( 'prli_pre_link_trash', '', $id ); -
/** * Fires after the job is completed. */ do_action( "{$hookPrefix}_job_complete", $completedJob ); -
/** * Fires after the job has failed. */ do_action( "{$hookPrefix}_job_failed", $failedJob ); -
/** * Fires after the job has been retried. */ do_action( "{$hookPrefix}_job_retried", $job ); -
/** * Filters the HTML for the root element where the inbox will be rendered. */ apply_filters( "{$prefix}_root_element_html", $html, $id ); -
/** * Filters the plugin information returned for `plugins_api` requests. */ apply_filters( "{$slug}_plugin_information", (object) $pluginInfo, $product, $version ); -
/** * Filters the theme information returned for `themes_api` requests. */ apply_filters( "{$slug}_theme_information", (object) $themeInfo, $product, $version ); -
/** * Fires when an active license is detected as expired during a status check. */ do_action( "{$this->plugin->pluginId}_active_license_expired", $activation ); -
/** * Fires when an active license is detected as invalid during a status check. */ do_action( "{$this->plugin->pluginId}_active_license_invalidated", $activation ); -
/** * Filters the list of hostnames allowed as package download sources. */ apply_filters( "{$this->plugin->pluginId}_allowed_download_hosts", $defaults ); -
/** * Fires when the currently installed edition is changed. */ do_action( "{$this->plugin->pluginId}_edition_changed", $editions ); -
/** * Fires after a license is successfully activated. */ do_action( "{$this->plugin->pluginId}_license_activated", $activation, $licenseKey, $domain ); -
/** * Fires after a license is deactivated. */ do_action( "{$this->plugin->pluginId}_license_deactivated", $response, $licenseKey, $domain, $freed ); -
/** * Allows add-ons to register their own products for updates. */ do_action( "{$this->plugin->pluginId}_register_addons", $this ); -
/** * Allows plugins/themes to provide a list of additional override directories * where view files can be located. */ apply_filters( "{$this->prefix}_view_override_directories", [], $view ); -
/** * Filters the rendered view output (all views). */ apply_filters( "{$this->prefix}_view_render", $output, $view, $vars ); -
/** * Filters the rendered view output for a specific view. */ apply_filters( "{$this->prefix}_view_render_{$slug}", $output, $view, $vars ); -
/** * Fires after the add-on catalog has been re-fetched from the licensing * server. */ do_action( 'prli_addons_refreshed', $products ); -
/** * Filter: prli_admin_bootstrap */ apply_filters( 'prli_admin_bootstrap', $payload, $bundle ); -
/** * Filter: prli_admin_prefill */ apply_filters( 'prli_admin_prefill', $prefill, $bundle ); -
/** * Action: prli_before_redirect */ do_action_ref_array( 'prli_before_redirect', [&$target, &$paramString, $_GET] ); -
/** * Bot-matching regex. */ apply_filters( 'prli_bot_regex', self::DEFAULT_PATTERN ); -
/** * Filter: prli_category_create */ apply_filters( 'prli_category_create', null, ['name' => $name] ); -
/** * Fires after every click row and counter is cleared on a tracking-mode * transition across the Simple boundary. For large clears handled by the * background worker this fires once the scope is fully drained — never * before — so extensions don't purge their own click-derived tables while * core data is still being deleted. */ do_action( 'prli_click_data_wiped' ); -
/** * Filters whether the clicks table may be emptied with TRUNCATE. */ apply_filters( 'prli_clicks_use_truncate', true ); -
/** * The filtered country list. */ apply_filters( 'prli_countries', self::rawCountries() ); -
/** * Filter: prli_csv_export_rows Pro hooks this to bulk-populate extra columns. * Receives one chunk of rows at a time when called from the chunked path, * which means Pro's bulk lookups run once per chunk — same total work as the * single-shot path, just spread. */ apply_filters( 'prli_csv_export_rows', $rows, $columns ); -
/** * Filter: prli_csv_sample_columns Lets extensions drop export-only columns * from the sample header. */ apply_filters( 'prli_csv_sample_columns', $columns ); -
/** * Filter: prli_csv_sample_rows Allows Pro/extensions to append rows * demonstrating extra columns. */ apply_filters( 'prli_csv_sample_rows', $rows, $columns ); -
/** * The filtered currency list. */ apply_filters( 'prli_currencies', $currencies ); -
/** * Filtered gateway notify URL. */ apply_filters( 'prli_gateway_notify_url', $url, self::METHOD_ID, $action, $methodId ); -
/** * Filter: prli_handle_redirect_type */ apply_filters( 'prli_handle_redirect_type', false, $link, $target, $status, $type ); -
/** * Filter: prli_handle_special_route */ apply_filters( 'prli_handle_special_route', false, $specialSlug['route'], $link, $requestUri ); -
/** * Action: prli_issue_cloaked_redirect */ do_action( 'prli_issue_cloaked_redirect', $type, $link, $target, $paramString, $status ); -
/** * Action: prli_link_after_save */ do_action( 'prli_link_after_save', $linkId, $original, $context ); -
/** * Filter: prli_link_bulk_action */ apply_filters( 'prli_link_bulk_action', $result, $action, $ids, $termIds ); -
/** * Filter: prli_link_duplicate_skip_meta_keys */ apply_filters( 'prli_link_duplicate_skip_meta_keys', ['static-clicks', 'static-uniques'], $fromId ); -
/** * Action: prli_link_duplicated */ do_action( 'prli_link_duplicated', (int) $new['id'], $id ); -
/** * Filter: prli_link_payload_pre_save */ apply_filters( 'prli_link_payload_pre_save', $payload, $context, $id ); -
/** * Filter: prli_link_response_attach */ apply_filters( 'prli_link_response_attach', $link, $linkId ); -
/** * Filter: prli_link_response_attach_bulk */ apply_filters( 'prli_link_response_attach_bulk', $items ); -
/** * Filter: prli_links_query_clauses */ apply_filters( 'prli_links_query_clauses', [$where, $params], $args ); -
/** * Filter: prli_links_search_clauses */ apply_filters( 'prli_links_search_clauses', [$parts, $partParams], $search, $like ); -
/** * Action: prli_loaded */ do_action( 'prli_loaded', $container ); -
/** * Filter: prli_migration_states */ apply_filters( 'prli_migration_states', $migrators ); -
/** * Fires when a migration step fails, so the real database error is captured * instead of silently swallowed. */ do_action( 'prli_migration_step_failed', $name, $error ); -
/** * Fires when a migration step is skipped because a step it depends on hasn't * completed. Nothing failed here — the step simply didn't run — but a * support trace needs to say why it is still pending. */ do_action( 'prli_migration_step_skipped', $name, $missing ); -
/** * Filter the notices delivered to the current screen. Use this to inject * ephemeral / virtual notices that shouldn't be persisted to the * `prli_notices` option (e.g. "resume onboarding"). Listeners should respect * the existing shape: each item is a { id, type, message, created } array. */ apply_filters( 'prli_notices_active', $out, $screenId ); -
/** * Filter: prli_onboarding_drain_feature */ apply_filters( 'prli_onboarding_drain_feature', false, $featureId ); -
/** * Filter: prli_onboarding_feature_labels */ apply_filters( 'prli_onboarding_feature_labels', [], (array) $_POST ); -
/** * Filter: prli_onboarding_feature_save_record */ apply_filters( 'prli_onboarding_feature_save_record', $record, (array) $_POST ); -
/** * Action: prli_onboarding_features_status */ do_action( 'prli_onboarding_features_status', $last ); -
/** * Filters the PrettyPay™ fee notice shown during onboarding. Extensions * (e.g. Pretty Links Pro) may replace it to reflect their licensing state. */ apply_filters( 'prli_onboarding_paylinks_fee_notice', $defaultNotice ); -
/** * Action: prli_onboarding_render_addon_rows */ do_action( 'prli_onboarding_render_addon_rows', $state ); -
/** * Action: prli_onboarding_render_feature_rows */ do_action( 'prli_onboarding_render_feature_rows', $state ); -
/** * Filtered options response payload. */ apply_filters( 'prli_options_response', $payload ); -
/** * Action: prli_options_update */ do_action( 'prli_options_update', $body ); -
/** * Fires during plugin deactivation so extensions can clean up artifacts they * dropped outside the plugin directory (e.g. Pro's must-use redirect * dispatcher). */ do_action( 'prli_plugin_deactivating' ); -
/** * The filtered invoice HTML. */ apply_filters( 'prli_prettypay_invoice_html', $html, $session ); -
/** * Fires after a Stripe Checkout session is created for a pay link. */ do_action( 'prli_prettypay_link_stripe_redirect', $link, $session ); -
/** * Filter: prli_redirect_params */ apply_filters( 'prli_redirect_params', $paramString, $link, $incomingQuery ); -
/** * Merged reserved-slug patterns. */ apply_filters( 'prli_reserved_slugs', self::DEFAULTS ); -
/** * Filter: prli_resolved_redirect_type */ apply_filters( 'prli_resolved_redirect_type', $type, $link ); -
/** * Filter: prli_resque_run_budget */ apply_filters( 'prli_resque_run_budget', 30 ); -
/** * Filters the extra REST namespaces that get Pretty Links' cache opt-outs, on * top of `pretty-links/v1`. */ apply_filters( 'prli_rest_nocache_namespaces', [] ); -
/** * Fires after a trashed link is restored (its deleted_at stamp cleared). * Counterpart to `prli_delete_link` with soft => true; lets caches that drop * trashed links pick the link back up. */ do_action( 'prli_restore_link', $id ); -
/** * Filter: prli_stripe_checkout_session_args */ apply_filters( 'prli_stripe_checkout_session_args', $args, $link ); -
/** * Filtered WordPress HTTP request arguments. */ apply_filters( 'prli_stripe_request', $requestArgs ); -
/** * Filtered Stripe request body arguments. */ apply_filters( 'prli_stripe_request_args', $args ); -
/** * Filtered Stripe request headers. */ apply_filters( 'prli_stripe_request_headers', $defaults ); -
/** * The filtered shipping-country list. */ apply_filters( 'prli_stripe_shipping_countries', $countries ); -
/** * Filter: prli_stripe_unsupported_fee_countries */ apply_filters( 'prli_stripe_unsupported_fee_countries', self::UNSUPPORTED_FEE_COUNTRIES ); -
/** * The filtered list of zero-decimal currency codes. */ apply_filters( 'prli_stripe_zero_decimal_currencies', self::ZERO_DECIMAL_CURRENCIES ); -
/** * Filter: prli_support_url */ apply_filters( 'prli_support_url', 'https://wordpress.org/support/plugin/pretty-link/' ); -
/** * Filter: prli_validate_link */ apply_filters( 'prli_validate_link', [], $data, $context, $id ); -
/** * Filter: prli-auto-generated-slug */ apply_filters( 'prli-auto-generated-slug', $slug, [], $length ); -
do_action( 'prli_event_recorded', Event::init([ 'event' => 'link-added', 'obj_id' => $id, 'obj_type' => 'PrliLink', 'args' => wp_json_encode($row), ])->save() ); -
do_action( 'cky_after_update_cookie' ); -
apply_filters( 'prli_categories_all', [] ); -
do_action( 'prli_csv_import_link_saved', (int) $existing['id'], $row ); -
apply_filters( 'prli_disable_prettypay_invoice', false ); -
do_action( 'prli_license_activated', $payload ); -
do_action_deprecated( "{$this->plugin->pluginId}_license_status_changed", [false, $activation], '4.0.0', 'Use the {$pluginId}_active_license_invalidated or {$pluginId}_active_license_expired ' . 'actions instead.' ); -
do_action( 'litespeed_control_set_nocache', $reason ); -
apply_filters( 'pl_customer_portal_page_name', 'pl-customer-portal' ); -
apply_filters( 'plp_locate_by_ip', (object) ['country' => $country], $lockey, null ); -
apply_filters( 'prli_admin_capability', self::CAPABILITY ); -
apply_filters( 'prli_bot_cdn_check', true ); -
apply_filters( 'prli_bot_honeypot_check', true ); -
apply_filters( 'prli_bot_method_check', true ); -
apply_filters( 'prli_bot_platform_check', true ); -
apply_filters( 'prli_bot_unidentified_check', true ); -
do_action( 'prli_click_written', $linkId, $clickId, $url ); -
apply_filters( 'prli_clicks_max_rows_per_file', self::DEFAULT_MAX_ROWS, $args ); -
apply_filters( 'prli_deprecated_redirect_types', $defaults ); -
apply_filters( 'prli_display_invoice_portal_link', true ); -
apply_filters( "prli_gateway_{self::METHOD_ID}_{$action}_notify_url", $url, $methodId ); -
apply_filters( 'prli_gateway_notify_url_structure', '/prettylinks/notify/%gatewayid%/%action%' ); -
apply_filters( 'prli_is_valid_url', $valid, $url ); -
apply_filters( 'prli_legacy_redirect_type_labels', $defaults ); -
do_action( 'prli_license_activated_before_queue_update', $payload ); -
do_action( 'prli_license_deactivated', $payload ); -
do_action( 'prli_license_deactivated_before_queue_update', $payload ); -
do_action( 'prli_license_edge_updates_changed', $edge ); -
do_action( 'prli_notice_dismissed', $id ); -
apply_filters( 'prli_onboarding_drain_addon', null, $slug ); -
do_action( 'prli_onboarding_render_category_empty' ); -
do_action( 'prli_record_click', [ 'link_id' => $linkId, 'click_id' => $clickId, 'url' => $url, ] ); -
apply_filters( 'prli_redirect_types', $defaults ); -
apply_filters( 'prli_target_url', $filterData ); -
apply_filters( 'prli_track_link', $link['track_me'] ?? 0, $linkId ); -
do_action( 'prli_update_link', $id, $patch ); -
do_action( 'prli-create-link', $id, $row );
Generated from PrettyLinks's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: