Skip to content

Hooks overview ​

Link Manager Pro has 7 action hooks and 37 filter hooks that let your code react to link events and change plugin behavior. This page lists them all by area.

Use them to run your code on link events or to change how the plugin behaves, without editing the plugin. Every hook links to its full entry on the actions or filters page.

All hooks start with link_manager_pro_. Two filters use a slash instead: link_manager_pro/bot_patterns and link_manager_pro/menu_items.

Use a hook ​

An action runs your function at a set moment, such as when a short link is created. A filter passes you a value, and your function returns the value the plugin should use. Add either with add_action() or add_filter().

php
add_action( 'link_manager_pro_link_created', 'myprefix_on_link_created' );
function myprefix_on_link_created( array $payload ): void {
	error_log( 'New short link: ' . $payload['slug'] );
}

add_filter( 'link_manager_pro_picker_per_page', 'myprefix_picker_per_page', 10, 2 );
function myprefix_picker_per_page( int $per_page, string $context ): int {
	return 8;
}
  • Where the code goes: your own plugin or a must-use plugin in wp-content/mu-plugins. Do not edit Link Manager Pro files, because an update removes your change.
  • Priority: the third argument of add_action() and add_filter(). The default is 10. Lower numbers run first.
  • Accepted arguments: the fourth argument is how many values your function receives. It defaults to 1, so pass 2 or 3 when the entry lists more parameters.
  • Return the same type: a filter must return a value of the type it received. Return a string for a string, an array for an array and a bool for a bool.
  • Load early when needed: link_manager_pro_booted, link_manager_pro_providers, link_manager_pro_migration_self_heal and link_manager_pro_settings_schema can run while the plugin loads, before most plugins. Put their code in a must-use plugin.

Every hook by area ​

Each hook links to its entry with its parameters, default and an example. Action entries are on Action hooks and filter entries on Filter hooks.

Events ​

HookTypeWhat it does
link_manager_pro_link_clickedActionA visitor click on a short link is counted.
link_manager_pro_link_createdActionA new short link is created.
link_manager_pro_broken_link_foundActionThe link checker finds a broken link for the first time.
link_manager_pro_broken_link_fixedActionA broken link is marked fixed or gets a redirect.

Lifecycle ​

HookTypeWhat it does
link_manager_pro_bootedActionThe plugin has finished loading.
link_manager_pro_providersFilterAdd or replace the plugin providers.
link_manager_pro_migration_self_healFilterTurn off the automatic database update.

Settings ​

HookTypeWhat it does
link_manager_pro_settings_updatedActionA settings group is saved.
link_manager_pro_settings_schemaFilterAdd or change settings groups and keys.

Caching ​

HookTypeWhat it does
link_manager_pro_cache_should_purgeActionLink content changed and page caches should clear.
link_manager_pro_report_cache_ttlFilterSet how long reports stay cached.

Redirects and clicks ​

HookTypeWhat it does
link_manager_pro_cookie_consentFilterSay whether the tracking cookie is allowed.
link_manager_pro_skip_filtered_click_countFilterLeave a click out of the click count.
link_manager_pro/bot_patternsFilterChange the built-in bot list.
link_manager_pro_trusted_proxiesFilterSet the trusted proxy addresses.
link_manager_pro_trust_proxy_headersFilterTrust forwarded headers without a proxy list.
link_manager_pro_post_credit_hostsFilterList sites that can credit a click to a post.
link_manager_pro_disable_auto_maskFilterSkip auto masking on a post save.
link_manager_pro_mask_urlFilterLeave one link in post content unmasked.
HookTypeWhat it does
link_manager_pro_picker_enabledFilterTurn the picker on or off.
link_manager_pro_picker_capabilityFilterSet the capability the picker needs.
link_manager_pro_picker_create_capabilityFilterSet the capability needed to create a short link in the picker.
link_manager_pro_picker_per_pageFilterSet results per search (1 to 20).
link_manager_pro_picker_excluded_statusesFilterHide links by access status.
link_manager_pro_picker_include_affiliatesFilterShow or hide affiliates.
link_manager_pro_picker_itemFilterChange one result.
link_manager_pro_picker_toolbar_defaultsFilterSet the link options ticked by default.
link_manager_pro_picker_debounce_msFilterSet the typing delay.
HookTypeWhat it does
link_manager_pro_link_equity_budgetFilterSet the budget per post.
link_manager_pro_link_equity_position_penaltyFilterSet the penalty for later links.
link_manager_pro_link_equity_post_budgetFilterSet the budget for one post.

GeoIP ​

HookTypeWhat it does
link_manager_pro_geoip_dirFilterMove the country database folder.
link_manager_pro_geoip_download_urlFilterChange the database download address.

AI ​

HookTypeWhat it does
link_manager_pro_ai_default_modelsFilterSet each provider default model.
link_manager_pro_ai_modelsFilterChange the model lists.
link_manager_pro_ai_models_{provider}FilterChange one provider list.
link_manager_pro_ai_gemini_thinking_budgetFilterSet the Gemini thinking budget.
link_manager_pro_ai_rate_maxFilterSet the AI request limit.
link_manager_pro_ai_rate_windowFilterSet the AI limit window.

Admin and logging ​

HookTypeWhat it does
link_manager_pro/menu_itemsFilterChange the admin submenu.
link_manager_pro_docs_urlFilterChange the Docs link.
link_manager_pro_support_urlFilterChange the Support link.
link_manager_pro_social_share_platformsFilterChange the share buttons.
link_manager_pro_logger_suppressFilterSilence log lines.

Areas without hooks ​

Disclosure and Migration have no hooks. The plugin does not run its own action or filter in the code for affiliate disclosures or for the imports from other plugins. To change these, use the settings or the WP-CLI commands.