Action hooks reference
Simple WishlistsUpdated
These actions let your code run when something happens to a wishlist. Each is listed with its parameters. Hooks marked PRO only fire when the PRO version is active. For template actions, see the template overrides article.
Items
swlp_item_added( int $item_id, array $list, array $valid, array $args ): after a product is added to a list.swlp_item_removed( array $item ): after an item is removed.swlp_item_updated( int $item_id, array $update, array $item ): after an item is updated.swlp_item_moved( int $new_id, array $item, int $to_list_id, bool $copy ): after an item is moved or copied to another list.swlp_item_added_to_cart( array $item, array $list, string $key, int $quantity ): after a wishlist item is added to the cart.swlp_item_purchased( array|null $item, int $list_id, WC_Order $order, WC_Order_Item_Product $line, string $type ): PRO. For each order line credited to a wishlist when the order is paid.
Lists
swlp_list_created( int $list_id, array $owner, array $args )swlp_list_updated( int $list_id, array $update, array $list )swlp_before_delete_list( array $list ) andswlp_list_deleted( array $list )swlp_list_shared( int $list_id ): when a private list is made shareable.swlp_list_share_clicked( array $list, string $network ): when a customer clicks a share button.swlp_list_emailed( array $list, string $email ): PRO. After a customer emails a list to a friend.swlp_guest_merged( int $user_id, int $moved ): after a guest wishlist is merged into a customer account.
Automation (PRO)
Stable hooks for automation tools. They only fire for logged-in customers when the automation integration is on.
swlp_automation_item_added( array $item, array $list, int $user_id )swlp_automation_price_dropped( array $item, array $list, float $from, float $to, int $user_id )swlp_automation_back_in_stock( array $item, array $list, int $user_id )
Alerts, emails and campaigns (PRO)
swlp_price_dropped( array $item, float $from, float $to ) andswlp_back_in_stock( array $item )swlp_alert_queued( int $user_id, array $item, string $type, array $data ) andswlp_alert_digest_sent( int $user_id, array $items )swlp_reminder_sent( int $user_id, array $items, WC_Coupon|null $coupon )swlp_email_sent( string $email_id, array $to, bool $sent, array $context )swlp_email_unsubscribed( int $user_id, string $type )swlp_personal_coupon_created( WC_Coupon $coupon, array $args )swlp_campaign_created( array $campaign ) andswlp_campaign_complete( array $campaign )
Other PRO features
swlp_registry_gift_purchased( array $list, array $items, WC_Order $order )swlp_estimate_requested( array $list, array $request, array $items )swlp_saved_for_later( int $item_id, array $list, array $cart_item )swlp_share_points_awarded( int $user_id, int $amount, array $list )
Housekeeping and admin
swlp_event_logged( string $event, array $args ): after an analytics event is recorded.swlp_daily_maintenance_run: during the daily maintenance task.swlp_privacy_erased( int $user_id ): after a customer’s wishlist data is erased.swlp_prevent_page_cache: when a personal wishlist page asks page caches to skip it.swlp_settings_saved: after the settings are saved.swlp_migration_batch_imported( string $source, array $result )swlp_tools_page_cards,swlp_dashboard_sections,swlp_admin_wishlist_detail_after: add your own sections to admin pages.
Example
<?php
// PHP: log every product a customer saves.
add_action( 'swlp_item_added', function ( $item_id, $list, $valid, $args ) {
error_log( sprintf( 'Product %d saved to list %d', $valid['product_id'], $list['id'] ) );
}, 10, 4 );


