← Developer Reference

Action Hooks

This reference targets APD v1.0.x. Last updated: 2026-02-25.

Complete reference of all action hooks in DamDir Directory — 100+ hooks organized by subsystem. Use these hooks to extend, customize, and integrate with the plugin.

Security notes for integrations

  • Any hook callback that performs write operations should verify a nonce using wp_verify_nonce() or, in REST API contexts, wp_verify_nonce( $value, 'wp_rest' ).
  • Always check user capabilities with current_user_can() before modifying data.
  • Sanitize all input values received through hook parameters before persisting them.

Hook stability: All hooks listed on this page are part of the public API and follow semantic versioning. Hooks will not be removed or have their signatures changed in minor or patch releases. Deprecated hooks will be announced at least one minor version before removal.

Core

Core Lifecycle

apd_activated
Action
Fires after the plugin is activated.
apd_deactivated
Action
Fires after the plugin is deactivated.
apd_init
Action
Fires after the plugin initializes. Use for registering custom field types, filters, views.
apd_loaded
Action
Fires when all plugin components are loaded. Safe to use all plugin functions.
apd_textdomain_loaded
Action
Fires after text domain is loaded. Use for translation-related setup.

Listing Lifecycle

apd_before_listing_save
Action
Before a listing is saved in admin. @param int $post_id Post ID. @param array $values Raw POST values.
apd_after_listing_save
Action
After a listing is saved in admin. @param int $post_id Post ID. @param array $sanitized_values Processed field values.
apd_listing_status_changed
Action
When a listing status changes. @param int $post_id Post ID. @param string $new_status New status. @param string $old_status Previous status.
apd_listing_viewed
Action
When a listing is viewed (single page). @param int $listing_id Listing ID. @param int $views Updated view count.
apd_listing_type_registered
Action
Fired when a listing type taxonomy term is registered.

Submission Lifecycle

apd_before_submission
Action
Before frontend submission is processed. @param array $data Submitted form data. @param int $listing_id Listing ID (0 for new).
apd_after_submission
Action
After successful frontend submission. @param int $listing_id Created listing ID. @param array $data Submitted data. @param bool $is_new Whether this is a new listing (not an update).
apd_validate_submission
Action
During submission validation. @param WP_Error $errors Validation errors object. @param array $data Submitted data.
apd_before_listing_update
Action
Before a listing update via frontend submission. @param int $listing_id Listing ID. @param array $post_data Post data array.
apd_listing_saved
Action
After a listing is saved (created or updated) via frontend submission. @param int $listing_id Listing ID. @param array $data Submitted data. @param bool $is_update Whether this was an update.
apd_listing_fields_saved
Action
After listing field values are saved via frontend submission. @param int $listing_id Listing ID. @param array $values Saved field values.
apd_listing_taxonomies_assigned
Action
After taxonomies are assigned to a listing via frontend submission. @param int $listing_id Listing ID. @param array $categories Category IDs. @param array $tags Tag names.
apd_listing_processed
Action
Fired after a listing submission is fully processed.

UI & Display

Field System

apd_field_registered
Action
After a field is registered. @param string $name Field name. @param array $config Field configuration.
apd_field_unregistered
Action
After a field is unregistered. @param string $name Field name. @param array $config Field configuration.
apd_field_type_registered
Action
After a field type handler is registered. @param string $type Field type. @param FieldTypeInterface $field_type Field type instance.
apd_after_admin_fields
Action
After admin fields are rendered. @param int $listing_id Listing ID. @param array $values Field values.
apd_after_frontend_fields
Action
After frontend fields are rendered. @param int $listing_id Listing ID (0 for new). @param array $values Field values.
apd_after_validate_fields
Action
After field validation completes. @param WP_Error $errors Validation errors. @param array $values Field values. @param array $args Validation arguments. @param string $context Validation context.

Search & Filters

apd_filter_registered
Action
After a filter is registered. @param string $name Filter name. @param array $config Filter configuration.
apd_filter_unregistered
Action
After a filter is unregistered. @param string $name Filter name. @param array $config Filter configuration.
apd_before_search_form
Action
Before search form renders. @param array $args Form arguments.
apd_after_search_form
Action
After search form renders. @param array $args Form arguments.
apd_before_filters
Action
Before filter list within search form.
apd_after_filters
Action
After filter list within search form.
apd_search_query_modified
Action
After search query is modified. @param WP_Query $query Query object. @param array $active_filters Active filter parameters.
apd_register_filters
Action
Fires to allow registration of custom search filters.

Display & Templates

Archive Page

apd_before_archive
Action
Before the archive page template (templates/archive-listing.php).
apd_archive_wrapper_start
Action
After the archive wrapper opens.
apd_before_archive_search_form
Action
Before the search form in the archive page.
apd_after_archive_search_form
Action
After the search form in the archive page.
apd_before_archive_loop
Action
Before the listing loop in the archive page.
apd_after_archive_loop
Action
After the listing loop in the archive page.
apd_archive_wrapper_end
Action
Before the archive wrapper closes.
apd_after_archive
Action
After the archive page template.

Single Listing Page

apd_before_single_listing
Action
Before the single listing page template (templates/single-listing.php).
apd_single_wrapper_start
Action
After the single listing wrapper opens.
apd_single_listing_start
Action
Start of the single listing content. @param int $listing_id Listing ID.
apd_single_listing_meta
Action
Single listing meta section. @param int $listing_id Listing ID.
apd_single_listing_header
Action
Single listing header section. @param int $listing_id Listing ID.
apd_single_listing_image
Action
Single listing featured image area. @param int $listing_id Listing ID.
apd_single_listing_before_content
Action
Before the listing content area. @param int $listing_id Listing ID.
apd_single_listing_after_content
Action
After the listing content area. @param int $listing_id Listing ID.
apd_single_listing_after_fields
Action
After listing fields are displayed. @param int $listing_id Listing ID.
apd_single_listing_reviews
Action
Reviews section in single listing. @param int $listing_id Listing ID.
apd_single_listing_sidebar_start
Action
Start of single listing sidebar. @param int $listing_id Listing ID.
apd_single_listing_contact_form
Action
Contact form in single listing sidebar. @param int $listing_id Listing ID.
apd_single_listing_sidebar_end
Action
End of single listing sidebar. @param int $listing_id Listing ID.
apd_single_listing_end
Action
End of the single listing content. @param int $listing_id Listing ID.
apd_single_listing_author
Action
Author section in single listing. @param int $author_id Author user ID. @param int $listing_id Listing ID.
apd_before_related_listings
Action
Before related listings section. @param int $listing_id Listing ID.
apd_after_related_listings
Action
After related listings section. @param int $listing_id Listing ID.
apd_single_wrapper_end
Action
Before the single listing wrapper closes.
apd_after_single_listing
Action
After the single listing page template.

Listing Card

apd_listing_card_start
Action
Start of the listing card template (templates/listing-card.php, listing-card-list.php). @param int $listing_id Listing ID.
apd_listing_card_image
Action
Listing card image area. @param int $listing_id Listing ID.
apd_listing_card_body
Action
Listing card body area. @param int $listing_id Listing ID.
apd_listing_card_footer
Action
Listing card footer area. @param int $listing_id Listing ID.
apd_listing_card_end
Action
End of the listing card template. @param int $listing_id Listing ID.

Views

apd_view_registered
Action
After a view is registered. @param ViewInterface $view View instance.
apd_view_unregistered
Action
After a view is unregistered. @param string $type View type name. @param ViewInterface $view View instance.
apd_views_init
Action
Views initialization (register custom views here). @param ViewRegistry $registry View registry instance.

Submission Form

apd_submission_form_start
Action
Start of the submission form template (templates/submission/submission-form.php). @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_after_basic_fields
Action
After basic fields in the submission form. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_after_custom_fields
Action
After custom fields in the submission form. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_after_taxonomies
Action
After taxonomy fields in the submission form. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_after_image
Action
After image upload in the submission form. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_before_submit
Action
Before the submit button in the submission form. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_submission_form_end
Action
End of the submission form template. @param array $config Form configuration. @param int $listing_id Listing ID (0 for new).
apd_before_submission_form
Action
Before submission form renders (PHP class hook). @param array $args Form arguments.
apd_after_submission_form
Action
After submission form renders (PHP class hook). @param string $output Form HTML output. @param array $args Form arguments.
apd_after_submission_success
Action
After successful submission (template hook). @param int $listing_id Listing ID. @param string $status Listing status. @param bool $is_update Whether this was an update.
apd_after_edit_not_allowed
Action
Fires after the “edit not allowed” message.

User Features

Dashboard

apd_before_dashboard
Action
Before dashboard output. @param array $args Dashboard template arguments.
apd_dashboard_start
Action
Start of dashboard content. @param array $args Dashboard template arguments.
apd_dashboard_end
Action
End of dashboard content. @param array $args Dashboard template arguments.
apd_after_dashboard
Action
After dashboard output is generated. @param string $output Dashboard HTML output. @param array $args Dashboard template arguments.
apd_dashboard_before_content
Action
Before dashboard tab content. @param string $tab Current tab slug.
apd_dashboard_after_content
Action
After dashboard tab content. @param string $tab Current tab slug. @param string $output Tab HTML output.
apd_my_listings_start
Action
Start of My Listings tab content. @param array $args My Listings template arguments.
apd_my_listings_end
Action
End of My Listings tab content. @param array $args My Listings template arguments.
apd_favorites_start
Action
Start of Favorites tab content. @param array $args Favorites template arguments.
apd_favorites_end
Action
End of Favorites tab content. @param array $args Favorites template arguments.
apd_dashboard_{$tab}_content
Action
Renders content for a specific dashboard tab. Dynamic hook — {$tab} is the tab slug.

Profile

apd_profile_start
Action
Start of profile template. @param array $args Profile template arguments.
apd_profile_end
Action
End of profile template. @param array $args Profile template arguments.
apd_before_save_profile
Action
Before profile data is saved. @param array $data Submitted profile data. @param int $user_id User ID.
apd_after_save_profile
Action
After profile data is saved. @param array $data Submitted profile data. @param int $user_id User ID.
apd_profile_saved
Action
After profile is saved successfully. @param int $user_id User ID. @param array $data Submitted profile data.
apd_avatar_uploaded
Action
When a custom avatar is uploaded. @param int $attachment_id Attachment ID. @param int $user_id User ID.

My Listings

apd_before_delete_listing
Action
Before a listing is deleted from dashboard. @param int $listing_id Listing ID. @param int $user_id User ID.
apd_after_delete_listing
Action
After a listing is deleted from dashboard. @param int $listing_id Listing ID. @param int $user_id User ID.
apd_before_trash_listing
Action
Before a listing is trashed from dashboard. @param int $listing_id Listing ID. @param int $user_id User ID.
apd_after_trash_listing
Action
After a listing is trashed from dashboard. @param int $listing_id Listing ID. @param int $user_id User ID.
apd_before_change_listing_status
Action
Before a listing status is changed from dashboard. @param int $listing_id Listing ID. @param string $status New status. @param string $old_status Previous status. @param int $user_id User ID.
apd_after_change_listing_status
Action
After a listing status is changed from dashboard. @param int $listing_id Listing ID. @param string $status New status. @param string $old_status Previous status. @param int $user_id User ID.

Favorites

apd_favorites_init
Action
Favorites initialization. @param Favorites $favorites Favorites instance.
apd_favorite_added
Action
When a favorite is added. @param int $listing_id Listing ID. @param int $user_id User ID (0 for guest).
apd_favorite_removed
Action
When a favorite is removed. @param int $listing_id Listing ID. @param int $user_id User ID (0 for guest).
apd_favorites_cleared
Action
When all favorites are cleared. @param int $user_id User ID.

Reviews

apd_reviews_init
Action
Reviews initialization. @param ReviewManager $manager ReviewManager instance.
apd_before_review_create
Action
Before a review is created. @param array $comment_data Comment data for wp_insert_comment. @param int $listing_id Listing ID.
apd_review_created
Action
After a review is created. @param int $comment_id Comment ID. @param int $listing_id Listing ID. @param array $data Original review data.
apd_before_review_update
Action
Before a review is updated. @param int $review_id Review ID. @param array $data Updated data.
apd_review_updated
Action
After a review is updated. @param int $review_id Review ID. @param array $data Updated data.
apd_before_review_delete
Action
Before a review is deleted. @param int $review_id Review ID. @param bool $force_delete Whether to permanently delete.
apd_review_deleted
Action
After a review is deleted. @param int $review_id Review ID. @param bool $force_delete Whether it was permanently deleted.
apd_review_approved
Action
When a review is approved. @param int $review_id Review ID.
apd_review_rejected
Action
When a review is rejected. @param int $review_id Review ID.

Review Templates

apd_before_reviews_section
Action
Before the reviews section (templates/review/). @param int $listing_id Listing ID.
apd_after_reviews_section
Action
After the reviews section. @param int $listing_id Listing ID.
apd_reviews_section_start
Action
Start of the reviews section content. @param int $listing_id Listing ID.
apd_reviews_section_after_header
Action
After the reviews section header. @param int $listing_id Listing ID.
apd_reviews_section_before_form
Action
Before the review form in the reviews section. @param int $listing_id Listing ID.
apd_reviews_section_after_form
Action
After the review form in the reviews section. @param int $listing_id Listing ID.
apd_reviews_section_end
Action
End of the reviews section content. @param int $listing_id Listing ID.
apd_before_review_form
Action
Before the review form renders. @param int $listing_id Listing ID.
apd_after_review_form
Action
After the review form renders. @param int $listing_id Listing ID.
apd_review_form_start
Action
Start of the review form content. @param int $listing_id Listing ID. @param bool $is_edit_mode Whether editing an existing review.
apd_review_form_before_submit
Action
Before the submit button in the review form. @param int $listing_id Listing ID. @param bool $is_edit_mode Whether editing an existing review.
apd_review_form_end
Action
End of the review form content. @param int $listing_id Listing ID. @param bool $is_edit_mode Whether editing an existing review.
apd_review_item_footer
Action
Footer of an individual review item. @param WP_Comment $review Review comment object.
apd_all_ratings_recalculated
Action
Fired after all listing ratings are recalculated.
apd_before_review_process
Action
Fires before a review submission is processed.
apd_rating_calculated
Action
Fired after a single listing’s rating is calculated.
apd_rating_calculator_init
Action
Fires when the rating calculator initializes.
apd_rating_invalidated
Action
Fired when a listing’s rating cache is invalidated.
apd_render_review_form
Action
Fires to render the review submission form.
apd_review_display_init
Action
Fires when the review display component initializes.
apd_review_form_created
Action
Fired after a new review is created via the frontend form.
apd_review_form_init
Action
Fires when the review form component initializes.
apd_review_form_updated
Action
Fired after a review is updated via the frontend form.
apd_review_handler_init
Action
Fires when the review handler initializes.
apd_validate_review
Action
Fires to validate review data before saving.

Contact & Inquiries

apd_contact_form_init
Action
Contact form initialization.
apd_contact_handler_init
Action
Contact handler initialization.
apd_contact_form_after_fields
Action
After contact form fields in template. @param int $listing_id Listing ID. @param object $form ContactForm instance.
apd_before_send_contact
Action
Before contact form email is sent. @param array $data Contact form data. @param WP_Post $listing Listing post object. @param WP_User $owner Listing owner user object.
apd_contact_sent
Action
After contact form is successfully sent. @param array $data Contact form data. @param WP_Post $listing Listing post object. @param WP_User $owner Listing owner user object.
apd_inquiry_logged
Action
When an inquiry is logged. @param int $inquiry_id Inquiry post ID. @param array $data Inquiry data. @param WP_Post $listing Listing post object.
apd_inquiry_tracker_init
Action
Inquiry tracking initialization.
apd_inquiry_marked_read
Action
When an inquiry is marked as read. @param int $inquiry_id Inquiry post ID.
apd_inquiry_marked_unread
Action
When an inquiry is marked as unread. @param int $inquiry_id Inquiry post ID.
apd_before_inquiry_delete
Action
Before an inquiry is deleted. @param int $inquiry_id Inquiry post ID. @param bool $force_delete Whether to permanently delete.

System

Email

apd_email_manager_init
Action
Email manager initialization.
apd_before_send_email
Action
Before any email is sent. @param string $to Recipient. @param string $subject Subject. @param string $message Message body. @param array $headers Headers. @param array $context Email context (type, listing_id, etc.).
apd_after_send_email
Action
After an email is sent. @param bool $sent Whether email was sent. @param string $to Recipient. @param string $subject Subject. @param array $context Email context.

REST API

apd_rest_api_init
Action
After REST API controller is initialized. @param RestController $controller Controller instance.
apd_register_rest_routes
Action
Before routes are registered (add custom endpoints here). @param RestController $controller Controller instance.
apd_rest_routes_registered
Action
After all routes are registered. @param RestController $controller Controller instance.
apd_rest_endpoint_registered
Action
After an endpoint controller is registered. @param string $name Endpoint name. @param object $endpoint Endpoint controller instance.
apd_rest_endpoint_unregistered
Action
After an endpoint controller is unregistered. @param string $name Endpoint name.
apd_rest_before_create_listing
Action
Before a listing is created via REST API. @param array $post_data Post data array. @param WP_REST_Request $request REST request.
apd_rest_after_create_listing
Action
After a listing is created via REST API. @param int $listing_id Listing ID. @param WP_REST_Request $request REST request.
apd_rest_before_update_listing
Action
Before a listing is updated via REST API. @param array $post_data Post data array. @param WP_Post $listing Listing post object. @param WP_REST_Request $request REST request.
apd_rest_after_update_listing
Action
After a listing is updated via REST API. @param int $listing_id Listing ID. @param WP_REST_Request $request REST request.
apd_rest_before_delete_listing
Action
Before a listing is deleted via REST API. @param WP_Post $listing Listing post object. @param bool $force Whether to force delete. @param WP_REST_Request $request REST request.
apd_rest_after_delete_listing
Action
After a listing is deleted via REST API. @param int $listing_id Listing ID. @param bool $force Whether it was force deleted. @param WP_REST_Request $request REST request.

Settings

apd_settings_init
Action
After settings are initialized. @param Settings $settings Settings instance.
apd_register_settings
Action
After settings are registered (add custom sections/fields). @param Settings $settings Settings instance.
apd_before_settings_page
Action
Before settings page renders. @param string $current_tab Current settings tab.
apd_after_settings_page
Action
After settings page renders. @param string $current_tab Current settings tab.
apd_before_settings_tab
Action
Before settings tab content. @param string $tab_id Tab identifier.
apd_after_settings_tab
Action
After settings tab content. @param string $tab_id Tab identifier.

Blocks

apd_blocks_init
Action
Block system initialization (register custom blocks here). @param BlockManager $manager Block manager instance.
apd_block_registered
Action
After a block is registered. @param AbstractBlock $block Block instance. @param string $name Block name.
apd_block_unregistered
Action
Fired after a Gutenberg block is unregistered.
apd_before_block_{$name}
Action
Fires before a specific block renders. Dynamic hook — {$name} is the block name.
apd_after_block_{$name}
Action
Fires after a specific block renders. Dynamic hook — {$name} is the block name.

Shortcodes

apd_shortcodes_init
Action
Shortcode system initialization (register custom shortcodes here). @param ShortcodeManager $manager Shortcode manager instance.
apd_shortcode_registered
Action
After a shortcode is registered. @param AbstractShortcode $shortcode Shortcode instance. @param string $tag Shortcode tag.
apd_user_registered
Action
User registration hook. @param int $user_id Created user ID. @param string $username Username. @param string $email Email address.
apd_after_categories_shortcode
Action
Fires after categories shortcode renders.
apd_after_listings_shortcode
Action
Fires after listings shortcode renders.
apd_after_login_form_shortcode
Action
Fires after login form shortcode renders.
apd_after_register_form_shortcode
Action
Fires after register form shortcode renders.
apd_after_search_form_shortcode
Action
Fires after search form shortcode renders.
apd_after_submission_form_shortcode
Action
Fires after submission form shortcode renders.
apd_before_categories_shortcode
Action
Fires before categories shortcode renders.
apd_before_listings_shortcode
Action
Fires before listings shortcode renders.
apd_before_login_form_shortcode
Action
Fires before login form shortcode renders.
apd_before_register_form_shortcode
Action
Fires before register form shortcode renders.
apd_before_search_form_shortcode
Action
Fires before search form shortcode renders.
apd_before_submission_form_shortcode
Action
Fires before submission form shortcode renders.
apd_register_form_fields
Action
Fires to add custom fields to the registration form.
apd_shortcode_unregistered
Action
Fired after a shortcode is unregistered.
apd_before_shortcode_{$tag}
Action
Fires before a specific shortcode renders. Dynamic hook — {$tag} is the shortcode tag.
apd_after_shortcode_{$tag}
Action
Fires after a specific shortcode renders. Dynamic hook — {$tag} is the shortcode tag.

Modules

apd_modules_init
Action
Fires when modules can register (fires at init priority 1). @param ModuleRegistry $registry Module registry instance.
apd_modules_loaded
Action
After all modules are loaded. @param ModuleRegistry $registry Module registry instance.
apd_module_registered
Action
After a module is registered. @param string $slug Module slug. @param array $config Module configuration.
apd_module_unregistered
Action
After a module is unregistered. @param string $slug Module slug. @param array $config Module configuration.
apd_modules_admin_init
Action
Fires when the Modules admin page initializes.

Demo Data

apd_demo_data_init
Action
Demo data page initialization. @param DemoDataPage $page Page instance.
apd_before_generate_demo_data
Action
Before demo data generation.
apd_after_generate_demo_data
Action
After demo data generation. @param array $results Generation results with counts.
apd_before_delete_demo_data
Action
Before demo data deletion.
apd_after_delete_demo_data
Action
After demo data deletion. @param array $counts Deleted item counts by type.
apd_demo_provider_registered
Action
Fired after a demo data provider is registered.
apd_demo_provider_unregistered
Action
Fired after a demo data provider is unregistered.
apd_demo_providers_init
Action
Fires when the demo data provider registry initializes.

Performance

apd_category_cache_invalidated
Action
When category cache is invalidated.
apd_listing_cache_invalidated
Action
When listing caches are invalidated. @param int $post_id Post ID. @param WP_Post $post Post object.
apd_cache_cleared
Action
When all plugin caches are cleared. @param int $deleted Number of deleted transients.

Templates

apd_before_get_template
Action
Before a template is loaded. @param string $template_name Template name. @param string $template Located template path. @param array $args Template arguments.
apd_after_get_template
Action
After a template is loaded. @param string $template_name Template name. @param string $template Located template path. @param array $args Template arguments.

AJAX

apd_before_ajax_filter
Action
Before AJAX filter request is processed.
apd_after_ajax_filter
Action
After AJAX filter request is processed.