{"id":368669,"date":"2025-10-24T10:04:35","date_gmt":"2025-10-24T04:04:35","guid":{"rendered":"https:\/\/directorist.com\/?post_type=docs&#038;p=368669"},"modified":"2025-10-24T10:04:39","modified_gmt":"2025-10-24T04:04:39","password":"","slug":"action-hooks","status":"publish","type":"docs","link":"https:\/\/directorist.com\/docs\/action-hooks\/","title":{"rendered":"Action Hooks"},"content":{"rendered":"\n<p>Directorist provides a rich set of&nbsp;<strong>action hooks<\/strong>&nbsp;that allow developers to extend or modify its functionality without editing the core files.<br>Each hook fires at a specific point in the plugin lifecycle, enabling you to inject custom code for listings, payments, notifications, directories, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Core Plugin Actions<\/h2>\n\n\n\n<p>These hooks help you run code during key lifecycle events such as installation, update, or load completion.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_loaded<\/code><\/td><td>Fires when the Directorist plugin is fully loaded.<\/td><\/tr><tr><td><code>directorist_installed<\/code><\/td><td>Fires when Directorist is installed.<\/td><\/tr><tr><td><code>directorist_updated<\/code><\/td><td>Fires when Directorist is updated.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Template and Display Actions<\/h2>\n\n\n\n<p>These hooks let you modify or inject elements in front-end templates such as listings, dashboards, search forms, and checkout pages.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Context<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_before_settings_panel_header<\/code><\/td><td>Before rendering the settings panel header.<\/td><\/tr><tr><td><code>directorist_before_directory_type_edited<\/code><\/td><td>Before editing a directory type.<\/td><\/tr><tr><td><code>directorist_before_all_directory_types<\/code><\/td><td>Before displaying all directory types.<\/td><\/tr><tr><td><code>directorist_before_contact_form_submit_button<\/code><\/td><td>Before the contact form submit button.<\/td><\/tr><tr><td><code>directorist_single_listing_after_title<\/code><\/td><td>After the single listing title.<\/td><\/tr><tr><td><code>directorist_before_add_listing_from_frontend<\/code><\/td><td>Before rendering the Add Listing form.<\/td><\/tr><tr><td><code>directorist_before_submit_listing_frontend<\/code><\/td><td>Before submitting a listing from frontend.<\/td><\/tr><tr><td><code>directorist_after_submit_listing_frontend<\/code><\/td><td>After submitting a listing from frontend.<\/td><\/tr><tr><td><code>directorist_after_file_upload_form_field<\/code><\/td><td>After rendering file upload fields.<\/td><\/tr><tr><td><code>atbdp_before_terms_and_conditions_font<\/code><\/td><td>Before the terms and conditions section.<\/td><\/tr><tr><td><code>directorist_search_listing_before_title<\/code><\/td><td>Before displaying search listing title.<\/td><\/tr><tr><td><code>directorist_search_listing_after_search_bar<\/code><\/td><td>After the search bar in search listings.<\/td><\/tr><tr><td><code>atbdp_before_all_categories_loop<\/code>&nbsp;\/&nbsp;<code>atbdp_after_all_categories_loop<\/code><\/td><td>Before \/ after categories loop.<\/td><\/tr><tr><td><code>atbdp_before_all_locations_loop<\/code>&nbsp;\/&nbsp;<code>atbdp_after_all_locations_loop<\/code><\/td><td>Before \/ after locations loop.<\/td><\/tr><tr><td><code>directorist_before_reset_password_form<\/code>&nbsp;\/&nbsp;<code>directorist_after_reset_password_form<\/code><\/td><td>Before \/ after reset password form.<\/td><\/tr><tr><td><code>atbdp_before_login_form_end<\/code><\/td><td>Before the login form ends.<\/td><\/tr><tr><td><code>atbdp_before_user_registration_submit<\/code><\/td><td>Before registration submit button.<\/td><\/tr><tr><td><code>directorist_author_listings_before_loop<\/code><\/td><td>Before author listings loop.<\/td><\/tr><tr><td><code>directorist_before_author_profile_section<\/code><\/td><td>Before author profile section.<\/td><\/tr><tr><td><code>directorist_before_author_about_section<\/code><\/td><td>Before author about section.<\/td><\/tr><tr><td><code>directorist_author_listing_after_about_section<\/code><\/td><td>After author about section.<\/td><\/tr><tr><td><code>directorist_before_list_listings_loop<\/code><\/td><td>Before list view loop.<\/td><\/tr><tr><td><code>directorist_before_listings_pagination<\/code>&nbsp;\/&nbsp;<code>directorist_after_listings_pagination<\/code><\/td><td>Before \/ after pagination.<\/td><\/tr><tr><td><code>directorist_before_grid_listings_loop<\/code>&nbsp;\/&nbsp;<code>directorist_after_grid_listings_loop<\/code><\/td><td>Before \/ after grid listings loop.<\/td><\/tr><tr><td><code>directorist_before_map_listings_loop<\/code>&nbsp;\/&nbsp;<code>directorist_after_map_listings_loop<\/code><\/td><td>Before \/ after map listings loop.<\/td><\/tr><tr><td><code>directorist_before_listing_types<\/code><\/td><td>Before listing types render.<\/td><\/tr><tr><td><code>atbdp_payment_receipt_after_total_price<\/code><\/td><td>After total price in payment receipt.<\/td><\/tr><tr><td><code>directorist_dashboard_navigation<\/code>&nbsp;\/&nbsp;<code>directorist_after_dashboard_navigation<\/code><\/td><td>Before \/ after dashboard navigation.<\/td><\/tr><tr><td><code>directorist_dashboard_contents<\/code>&nbsp;\/&nbsp;<code>directorist_after_dashboard_contents<\/code><\/td><td>Dashboard content area.<\/td><\/tr><tr><td><code>directorist_dashboard_listing_th_*<\/code>&nbsp;\/&nbsp;<code>directorist_dashboard_listing_td_*<\/code><\/td><td>Customize table header and cell content in dashboard listings.<\/td><\/tr><tr><td><code>directorist_dashboard_before_pagination<\/code>&nbsp;\/&nbsp;<code>directorist_dashboard_after_pagination<\/code><\/td><td>Pagination hooks in dashboard.<\/td><\/tr><tr><td><code>atbdp_before_checkout_form_start<\/code>&nbsp;\/&nbsp;<code>atbdp_after_checkout_form_end<\/code><\/td><td>Surround checkout form.<\/td><\/tr><tr><td><code>atbdp_before_cc_form<\/code>&nbsp;\/&nbsp;<code>atbdp_after_cc_form<\/code><\/td><td>Surround credit card form.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Email and Notification Actions<\/h2>\n\n\n\n<p>Used to trigger custom email or notification behavior when listings or orders are created, updated, or completed.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Fires When<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_email_on_notify_owner_order_created<\/code><\/td><td>Owner receives order created email.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_order_completed<\/code><\/td><td>Owner receives order completed email.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_submitted<\/code><\/td><td>Owner receives listing submission email.<\/td><\/tr><tr><td><code>directorist_email_on_notify_admin_listing_published<\/code><\/td><td>Admin notified when listing is published.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_published<\/code><\/td><td>Owner notified when listing is published.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_edited<\/code><\/td><td>Owner notified when listing is edited.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_to_expire<\/code><\/td><td>Owner notified before listing expires.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_expired<\/code><\/td><td>Owner notified after expiration.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_to_renew<\/code><\/td><td>Owner notified for renewal.<\/td><\/tr><tr><td><code>directorist_email_on_notify_owner_listing_deleted<\/code><\/td><td>Owner notified after deletion.<\/td><\/tr><tr><td><code>directorist_email_on_notify_admin_become_author<\/code><\/td><td>Admin notified on author request.<\/td><\/tr><tr><td><code>directorist_email_on_notify_admin_order_created<\/code>&nbsp;\/&nbsp;<code>directorist_email_on_notify_admin_order_completed<\/code><\/td><td>Admin notified about orders.<\/td><\/tr><tr><td><code>directorist_email_on_notify_admin_listing_submitted<\/code>&nbsp;\/&nbsp;<code>directorist_email_on_notify_admin_listing_edited<\/code><\/td><td>Admin notified about listings.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Listing Management Actions<\/h2>\n\n\n\n<p>These actions run during the listing creation, update, or deletion process.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_ajax_before_request_handling<\/code>&nbsp;\/&nbsp;<code>directorist_ajax_after_request_handling<\/code><\/td><td>Around AJAX request handling.<\/td><\/tr><tr><td><code>atbdp_before_processing_submitted_listing_frontend<\/code><\/td><td>Before processing frontend listing submission.<\/td><\/tr><tr><td><code>atbdp_before_processing_to_update_listing<\/code><\/td><td>Before updating listing.<\/td><\/tr><tr><td><code>atbdp_listing_updated<\/code>&nbsp;\/&nbsp;<code>atbdp_listing_inserted<\/code><\/td><td>After listing update or insert.<\/td><\/tr><tr><td><code>atbdp_listing_published<\/code><\/td><td>After listing published.<\/td><\/tr><tr><td><code>atbdp_after_created_listing<\/code><\/td><td>After listing created.<\/td><\/tr><tr><td><code>atbdp_before_renewal<\/code>&nbsp;\/&nbsp;<code>atbdp_after_renewal<\/code><\/td><td>Around listing renewal process.<\/td><\/tr><tr><td><code>directorist_listing_deleted<\/code><\/td><td>After listing deleted.<\/td><\/tr><tr><td><code>atbdp_all_listings_badge_template<\/code><\/td><td>Customize badge template on listings.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Payment and Order Actions<\/h2>\n\n\n\n<p>Hooks for handling custom gateways, order status changes, and payment flows.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>atbdp_order_created<\/code><\/td><td>After an order is created.<\/td><\/tr><tr><td><code>atbdp_offline_payment_created<\/code><\/td><td>After offline payment is created.<\/td><\/tr><tr><td><code>atbdp_process_{gateway}_payment<\/code><\/td><td>Process payment for a specific gateway. Replace&nbsp;<code>{gateway}<\/code>&nbsp;with your gateway slug.<\/td><\/tr><tr><td><code>atbdp_online_order_processed<\/code><\/td><td>After online order processed.<\/td><\/tr><tr><td><code>atbdp_order_completed<\/code><\/td><td>After order marked completed.<\/td><\/tr><tr><td><code>atbdp_custom_order_column_content<\/code><\/td><td>Output custom content in the order list table.<\/td><\/tr><tr><td><code>atbdp_order_status_changed<\/code><\/td><td>When order status changes.<\/td><\/tr><tr><td><code>atbdp_email_receipt_after_total_price<\/code><\/td><td>After total price in email receipt.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Directory and Taxonomy Actions<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_before_create_directory_type<\/code>&nbsp;\/&nbsp;<code>directorist_after_create_directory_type<\/code><\/td><td>Around creation of a directory type.<\/td><\/tr><tr><td><code>directorist_before_update_directory_type<\/code>&nbsp;\/&nbsp;<code>directorist_after_update_directory_type<\/code><\/td><td>Around update of a directory type.<\/td><\/tr><tr><td><code>directorist_before_directory_type_updated<\/code><\/td><td>Before directory type updated.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Review and Comment Actions<\/h2>\n\n\n\n<p>Use these to customize or track user reviews and comments.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_review_validate_data<\/code><\/td><td>Validate review data before saving.<\/td><\/tr><tr><td><code>directorist_review_updated<\/code><\/td><td>After review updated.<\/td><\/tr><tr><td><code>directorist_review_clear_cache<\/code><\/td><td>Clear review cache.<\/td><\/tr><tr><td><code>directorist_review_rating_updated<\/code><\/td><td>After review rating updated.<\/td><\/tr><tr><td><code>directorist_review_content_before<\/code>&nbsp;\/&nbsp;<code>directorist_review_content_after<\/code><\/td><td>Wrap review content.<\/td><\/tr><tr><td><code>directorist_after_comment_textarea<\/code><\/td><td>After comment textarea.<\/td><\/tr><tr><td><code>directorist_comment_form_before_fields<\/code>&nbsp;\/&nbsp;<code>directorist_comment_form_after_fields<\/code><\/td><td>Around comment form fields.<\/td><\/tr><tr><td><code>directorist_comment_form<\/code>&nbsp;\/&nbsp;<code>directorist_comment_form_after<\/code><\/td><td>During comment form render.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Import and Migration Actions<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>directorist_listing_imported<\/code><\/td><td>After a listing is imported.<\/td><\/tr><tr><td><code>directorist_before_directory_type_updated<\/code><\/td><td>Before directory type updated during import.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Background Process Actions<\/h2>\n\n\n\n<p>Used for updater, licensing, and tracking integrations.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>include_style_settings<\/code><\/td><td>Include style settings.<\/td><\/tr><tr><td><code>post_edd_sl_plugin_updater_setup<\/code><\/td><td>After EDD Software Licensing updater setup.<\/td><\/tr><tr><td><code>in_plugin_update_message-{file}<\/code><\/td><td>Displays plugin update message.<\/td><\/tr><tr><td><code>before_appsero_license_section<\/code>&nbsp;\/&nbsp;<code>after_appsero_license_section<\/code><\/td><td>Around Appsero license section.<\/td><\/tr><tr><td><code>{slug}_tracker_optin<\/code>&nbsp;\/&nbsp;<code>{slug}_tracker_optout<\/code><\/td><td>User tracking opt-in\/out.<\/td><\/tr><tr><td><code>{slug}_uninstall_reason_submitted<\/code><\/td><td>After uninstall feedback submitted.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Database Actions<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Hook<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>atbdp_pre_insert_{type}<\/code><\/td><td>Before inserting data of a specific type.<\/td><\/tr><tr><td><code>atbdp_post_insert_{type}<\/code><\/td><td>After inserting data of a specific type.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Directorist provides a rich set of&nbsp;action hooks&nbsp;that allow developers to extend or modify its functionality without editing the core files.Each hook fires at a specific point in the plugin lifecycle, enabling you to inject custom code for listings, payments, notifications, directories, and more. Core Plugin Actions These hooks help you run code during key lifecycle [&hellip;]<\/p>\n","protected":false},"author":24585,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[699],"doc_tag":[],"class_list":["post-368669","docs","type-docs","status-publish","hentry","doc_category-developers-doc"],"year_month":"2026-03","word_count":1091,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"yousuf.sovware","author_nicename":"yousuf-sovware","author_url":"https:\/\/directorist.com\/author\/yousuf-sovware\/"},"doc_category_info":[{"term_name":"Developers Doc","term_url":"https:\/\/directorist.com\/docs-category\/developers-doc\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs\/368669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/users\/24585"}],"replies":[{"embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/comments?post=368669"}],"version-history":[{"count":0,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs\/368669\/revisions"}],"wp:attachment":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/media?parent=368669"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/doc_category?post=368669"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/doc_tag?post=368669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}