Every event, as a WordPress action.
PHP functions to make links, clients, keys, domains and webhooks, actions for every event, and filters to change or refuse data before it’s saved. No HTTP involved.

Your Bunny edge script does the work in the moment of the click, from the location nearest the visitor.
Links, clicks and settings live in your own Bunny database. WordPress is only the dashboard.
Links answer even when WordPress is slow, updating or down.
How it works
Another plugin on the same site.
Another plugin on the same WordPress site can make links and clients, listen to every event and change data before it’s saved. The functions work only while Nahnu Links is active, so check with function_exists() first. They return a WP_Error instead of throwing, and run as the site, so check current_user_can() yourself before acting for a user.
At a glance
- Functions
- Links, clients, keys, domains, webhooks, events, stats
- Every event
nahnu_links_event- Per type
nahnu_links_link_createdand more- Edge events
- Fire at the next five-minute upkeep
Functions
Make a client and a link.
- Links:
nahnu_links_create_link(),get_link(),get_links(),update_link(),delete_link(),short_url(),get_stats(). - Clients and keys:
nahnu_links_create_client(),get_client(),update_client(),create_api_key(),revoke_api_key(). - Domains and webhooks:
nahnu_links_add_domain(),add_webhook(),emit_event(),verify_webhook().
if ( function_exists( 'nahnu_links_ready' ) && nahnu_links_ready() ) {
$client = nahnu_links_get_client( 'ext:' . $user_id )
?: nahnu_links_create_client( [ 'name' => $company, 'email' => $email, 'external_id' => (string) $user_id ] );
$link = nahnu_links_create_link( [ 'destination_url' => $url, 'slug' => 'spring' ], $client['id'] );
} Actions
React to anything.
nahnu_links_event fires for every event, with the type, the data and who it belongs to. Per-type actions use underscores, like nahnu_links_link_created, nahnu_links_domain_live, nahnu_links_invoice_paid and nahnu_links_click_created. There are also actions when a webhook is saved, deleted or fails, and when partner keys change.
Events that happen in WordPress fire their actions straight away. Events from the edge script (API changes, clicks, conversions) fire during the next five-minute upkeep.
add_action( 'nahnu_links_domain_live', function ( $domain, $event ) {
my_app_notify( $event['external_id'], sprintf( '%s is ready', $domain['domain'] ) );
}, 10, 2 ); Filters
Change or refuse data.
nahnu_links_link_data and nahnu_links_client_data run before a link or client is made or changed in WordPress; return changed data, or a WP_Error to refuse. Other filters shape events, webhook payloads, retries, timeouts, how long events are kept, and the short URL shown.
add_filter( 'nahnu_links_link_data', function ( $data, $client_id, $link_id ) {
if ( str_contains( $data['destination_url'] ?? '', 'competitor.com' ) ) {
return new WP_Error( 'not_allowed', 'Links to that site are not allowed.' );
}
return $data;
}, 10, 3 ); The edge script on Bunny can’t run PHP, so filters don’t change how redirects work. They apply to changes made in WordPress; changes made through the API on Bunny reach you as events.
Pricing
Get PHP hooks, and everything else.
One license unlocks every feature on this site. No link, click, domain or client limits. Your links run on your own Bunny.net account, which bills you for usage directly: under $1 a month for most setups.
Annual
$49.99/ year
Pay yearly. Upgrade to Lifetime any time and this year’s payment is credited.
- Every feature, PHP hooks included
- 1 main site, unlimited client sites
- Unlimited links, clicks, domains and clients
- 1 year of updates and support
Best value
Lifetime
$249.99once
Pay once, keep it for good. Costs less than five years of Annual.
- Every feature, PHP hooks included
- 1 main site, unlimited client sites
- Unlimited links, clicks, domains and clients
- Lifetime updates, 3 years of support
Questions
Questions about PHP hooks
Do hooks slow down clicks?
No. Clicks are answered at the edge. Their actions fire later, during upkeep.
Can I send my own events to webhooks?
Yes, with nahnu_links_emit_event( 'custom.name', $data, $client_id ). Add your types with the nahnu_links_event_types filter so they show on the Developers page.
Are there hooks in the client plugin?
Yes. nlc_site and nlc_site_api let analytics plugins on a client’s site use the connection.
Works well with
Related features
Run it on your own edge.
PHP hooks comes with every license, with every other feature. Unlimited links, clicks, domains and clients.
