1. Home
  2. Knowledge Base
  3. Developer Documentation
  4. Thrive Themes Action Hooks & Custom Functions

Thrive Themes Action Hooks & Custom Functions

Thrive Themes products come with a set of helpful hooks that allow developers to extend functionality, modify data, and trigger custom logic during specific events. This reference covers all developer-facing hooks across the Thrive product suite.

How to Use Hooks

Action hooks let you run custom code when a specific event occurs. Use add_action() to attach your function:

add_action( 'hook_name', 'your_function_name', 10, 2 );

Filter hooks let you intercept and modify data before it is processed or displayed. Use add_filter() and return the modified value:

add_filter( 'filter_name', 'your_function_name', 10, 2 );

Add your custom hooks in a child theme’s functions.php or in a site-specific plugin. Always prefix your function names (e.g., mycompany_) to avoid conflicts.

Quick Reference

ProductActionsFiltersSection
Thrive Apprentice395Course lifecycle, enrollment, assessments, certificates, drip, payments
Thrive Architect1535Forms, events, content rendering, editor, styling, landing pages
Thrive Theme Builder1228Templates, sections, skins, breadcrumbs, content types
Thrive Dashboard1015Authentication, autoresponder, products, cache
Thrive Leads214Form display, lazy loading, targeting
Thrive Quiz Builder30Quiz lifecycle events
Thrive Ultimatum28Campaign events, display control
Thrive Ovation30Testimonial lifecycle
Thrive Automator14Initialization, data objects

Thrive Apprentice

Course and Lesson Lifecycle

HookTypeParametersDescription
thrive_apprentice_course_startaction$course_details, $user_detailsStudent starts their first lesson in a course
thrive_apprentice_course_finishaction$course_details, $user_detailsStudent completes all lessons and assessments in a course
thrive_apprentice_course_progressaction$course, $user_detailsFires each time a lesson is completed (progress update)
thrive_apprentice_lesson_startaction$lesson_details, $user_detailsStudent begins viewing a lesson
thrive_apprentice_lesson_completeaction$lesson_details, $user_detailsStudent finishes a lesson
thrive_apprentice_free_lesson_completedaction$lesson_details, $user_detailsStudent completes a lesson marked as free for all
thrive_apprentice_all_free_lessons_completedaction$user_details, $course_idStudent completes all free lessons in a course
thrive_apprentice_module_startaction$module_details, $user_detailsStudent starts their first lesson in a module
thrive_apprentice_module_finishaction$module_details, $user_detailsStudent completes all lessons in a module
thrive_apprentice_restricted_courseaction$course, $user_detailsUser without access tries to view a restricted course

Example — Track course completions:

add_action( 'thrive_apprentice_course_finish', function( $course_details, $user_details ) {
    $course_id    = $course_details['course_id'];
    $course_title = $course_details['course_title'];
    $user_id      = $user_details['ID'];
    // Send to external system, log, or trigger email
}, 10, 2 );

Enrollment and Purchase

HookTypeParametersDescription
tva_user_receives_product_accessaction$user (WP_User), $product (TVA\Product)Primary enrollment hook — fires for purchases, role changes, and manual grants
tva_purchaseaction$user (WP_User), $order_item (TVA_Order_Item), $order (TVA_Order)Purchase completed (fires per order item)
tva_grant_course_accessaction$user_id, $product_id, $payment_resultAccess granted after Square payment
tva_user_course_purchaseaction$user, $order, $initiatorDeprecated — use tva_purchase instead

Example — React to new enrollments:

add_action( 'tva_user_receives_product_access', function( $user, $product ) {
    $user_email   = $user->user_email;
    $product_name = $product->get_name();
    // Sync to CRM, send welcome message, etc.
}, 10, 2 );

Assessments and Grading

HookTypeParametersDescription
tva_assessment_submittedaction$assessment (TVA_User_Assessment)Student submits an assessment
tva_assessment_passedaction$assessment (TVA_User_Assessment)Assessment graded — student passed
tva_assessment_failedaction$assessment (TVA_User_Assessment)Assessment graded — student failed

Certificates

HookTypeParametersDescription
tva_certificate_verifiedaction$certificate_data, $user_data, $course_dataCertificate is verified or viewed
tva_certificate_downloadedaction$certificate_data, $user_data, $course_dataStudent downloads their certificate

Drip Content

HookTypeParametersDescription
tva_drip_content_unlocked_for_specific_useraction$user (WP_User), $post (WP_Post), $product (WP_Term)Drip-scheduled content released for a specific user
tva_drip_content_unlocked_sitewideaction$post (WP_Post), $product (WP_Term)Drip-scheduled content released for all students

Refunds and Subscriptions

HookTypeParametersDescription
tva_order_refundedaction$user (WP_User), $order_item (TVA_Order_Item), $order (TVA_Order)Order refunded (any payment gateway)
tva_subscription_cancelledaction$user (WP_User), $order_item, $orderStripe subscription cancelled
tva_stripe_order_refundedaction$order_item (TVA_Order_Item)Stripe-specific refund processed
tva_sendowl_order_refundedaction$order (TVA_Order)SendOwl-specific refund processed

Files and Video

HookTypeParametersDescription
tva_protected_file_downloadaction$file (WP_Post), $user_detailsStudent downloads a protected file
thrive_video_completedaction$video_data (array with item_id, user_id)Student completes watching a video

Course Management

HookTypeParametersDescription
tva_course_publishedaction$course (TVA_Course_V2)Course is published
tva_after_save_courseaction$return (array), $request (WP_REST_Request)Course saved or updated
tva_course_after_deleteaction$term_id (int)Course deleted

Email Templates

HookTypeParametersDescription
tva_prepare_new_user_email_templateactionemail template objectCustomize new user registration emails
tva_prepare_new_course_welcome_email_templateactionemail template objectCustomize course welcome emails
tva_prepare_certificate_email_templateactionemail template objectCustomize certificate emails
tva_prepare_assessment_marked_email_templateactionemail template objectCustomize assessment grading notification emails
tva_prepare_product_expiry_email_templateactionemail template objectCustomize product access expiry emails

Stripe and Payment Webhooks

HookTypeParametersDescription
tva_stripe_webhookaction$stripe_event (Stripe Event)Generic Stripe webhook handler
tva_stripe_webhook_{event_type}action$stripe_event (Stripe Event)Specific Stripe event (e.g., tva_stripe_webhook_charge.succeeded)
tva_stripe_event_{type}actionevent data arrayInternal Stripe event routing
tva_settings_saved_{key}action$value (mixed)Setting saved (e.g., tva_settings_saved_general)

Apprentice Filters

HookTypeParametersDescription
tva_can_be_marked_as_completedfilter$can_complete (bool), $condition, $object_idCustomize lesson completion logic
tva_access_manager_allow_accessfilter$allowed (bool)Override access decisions
tva_access_restrict_contentfilter$content (string), $productModify restricted content message
tva_should_trigger_access_on_role_changefilter$should_trigger (bool), $user_id, $roleControl which role changes trigger course access

Example — Custom completion requirements:

add_filter( 'tva_can_be_marked_as_completed', function( $can_complete, $condition, $object_id ) {
    // Add custom criteria before allowing lesson completion
    return $can_complete;
}, 10, 3 );

Thrive Architect

Form and Lead Generation

HookTypeParametersDescription
thrive_core_lead_signupaction$form_data, $user_detailsFires on every lead form submission
tcb_api_form_submitaction(none)Fires before API form submission
tcb_contact_form_user_mail_after_sendaction(none)Fires after contact form email is sent
tcb_before_api_subscribe_datafilter$data (array)Modify form data before subscription processing
tcb_api_subscribe_datafilter$data (array)Modify subscription data before sending to CRM
tcb_api_subscribe_data_instancefilter$data (array)Modify data for a specific CRM connection instance
tcb_api_subscribe_connectionsfilter$connections (array)Filter available CRM connections for a form
tcb_parse_lead_gen_form_datafilter$data (array)Customize lead generation form data structure
tcb_lead_generation_apis_with_tag_supportfilter$apis (array)Filter CRM APIs that support tags
tcb_spam_prevention_toolsfilter$tools (array)Register custom spam prevention tools
tcb_post_login_actionsfilter$actions (array)Customize available post-login actions
tcb_post_register_actionsfilter$actions (array)Customize available post-registration actions

Example — Process lead submissions:

add_action( 'thrive_core_lead_signup', function( $form_data, $user_details ) {
    // $form_data contains email, name, and custom fields
    // Send to your webhook, CRM, or custom service
    wp_remote_post( 'https://your-webhook.com', [
        'body' => json_encode( $form_data ),
    ] );
}, 10, 2 );

Event Manager and Triggers

HookTypeParametersDescription
tcb_event_triggersfilter$triggers (array), $context (array)Register custom page event triggers
tcb_event_actionsfilter$actions (array)Customize available event actions
tcb_event_action_classesfilter$classes (array)Register custom event action handler classes
tcb_event_manager_action_tabsfilter$tabs (array)Customize action configuration UI tabs
tcb_can_use_page_eventsfilter$can_use (bool)Control page events availability per post type
tcb_overwrite_event_scripts_enqueuefilter$overwrite (bool)Override event system script loading
tcb_animationsfilter$animations (array)Customize CSS animation configuration

Content Rendering and Templates

HookTypeParametersDescription
tcb_get_post_contentfilter$content (string)Filter post content before display
tcb_save_post_contentfilter$content (string)Modify content before saving to database
tcb_alter_template_datafilter$data (array)Modify template metadata before rendering
tcb_cloud_templatesfilter$templates (array)Filter cloud templates list
tcb_symbol_contentfilter$content (string)Customize symbol (global element) content
tcb_content_allowed_shortcodesfilter$shortcodes (array)Control which shortcodes are allowed in content
tcb_post_list_query_argsfilter$args (array)Modify post list WP_Query arguments
tcb_post_list_excluded_post_idsfilter$ids (array)Exclude specific posts from post list
tcb_render_shortcode_{tag}filter$output (string)Render custom shortcode (dynamic suffix)
tve_landing_page_contentfilter$content (string)Modify landing page content output

Editor Customization

HookTypeParametersDescription
tcb_editor_enqueue_scriptsaction(none)Enqueue custom scripts in the Architect editor
tcb_hook_editor_headaction(none)Add content to the editor head section
tcb_hook_editor_footeraction(none)Add content to the editor footer
tcb_output_extra_editor_svgaction(none)Inject custom SVG icons into editor
tcb_editor_javascript_paramsfilter$params (array)Customize editor JavaScript localization data
tcb_elementsfilter$elements (array)Filter available elements list
tcb_element_instancesfilter$instances (array)Register custom element instances
tcb_is_editor_pagefilter$is_editor (bool)Detect if current page is the editor
tcb_backbone_templatesfilter$templates (array)Customize Backbone.js UI templates
tcb_display_button_in_admin_barfilter$display (bool)Show or hide edit button in admin bar

Styling and Colors

HookTypeParametersDescription
tcb_action_global_colorsaction(none)Fires when global colors are updated
tcb_action_global_gradientsaction(none)Fires when global gradients are updated
tcb_global_stylesfilter$styles (array)Filter all global styles before use
tcb_global_colors_listfilter$colors (array)Filter the global colors list
tcb_default_stylesfilter$styles (array)Filter default element styles
tcb_extra_fonts_cssaction(none)Inject custom fonts CSS
tve_should_minify_cssfilter$minify (bool)Enable or disable CSS minification

Access Control

HookTypeParametersDescription
tcb_user_can_editfilter$can_edit (bool)Control whether user can edit with Architect
tcb_user_has_plugin_edit_capfilter$has_cap (bool)Control plugin editing capability
tcb_post_editablefilter$editable (bool)Control whether a post can be edited
tcb_post_typesfilter$types (array)Filter supported post types
tcb_skip_license_checkfilter$skip (bool)Bypass license requirement
tcb_can_use_landing_pagesfilter$can_use (bool)Control landing page access

Thrive Theme Builder

Template System

HookTypeParametersDescription
theme_template_before_renderaction$template (Thrive_Template)Fires before template rendering begins
before_theme_builder_template_renderaction$post_id (int)Fires before theme builder template renders
after_theme_builder_template_renderaction$post_id (int)Fires after theme builder template renders
theme_after_body_openaction(none)Fires immediately after opening body tag
theme_before_body_closeaction(none)Fires before closing body tag
thrive_theme_template_contentfilter$html (string), $templateFilter complete template HTML output
thrive_template_structurefilter$structure (array), $templateModify template HTML structure before rendering
thrive_template_{type}_contentfilter$content (string)Modify template section content (header, footer, content)
thrive_template_{type}_beforefilter$content (string)Add content before template section
thrive_template_{type}_afterfilter$content (string)Add content after template section
thrive_template_render_{type}filter$render (bool)Control rendering of specific template section
thrive_theme_default_templatesfilter$templates (array), $argsModify default templates list
thrive_template_default_valuesfilter$args (array)Filter default template configuration values
thrive_theme_template_urlfilter$url, $template, $primary, $secondary, $variableModify template edit or preview URLs
thrive_theme_do_the_postfilter$do_post (bool)Control whether wp_post hook is called for singular pages
HookTypeParametersDescription
thrive_theme_section_htmlfilter$html (string), $sectionModify section HTML output
thrive_theme_section_default_contentfilter$content, $section, $typeProvide default content for new sections
thrive_theme_rest_section_before_insertfilter$section (array)Filter section data before database insert
thrive_hf_sectionfilter$data (array), $type (string)Modify header or footer section data
thrive_hf_classfilter$class (string), $type (string)Filter CSS classes for header or footer
thrive_theme_header_pathfilter$path (string), $templateOverride header file path
thrive_theme_footer_pathfilter$path (string), $templateOverride footer file path

Skins and Styling

HookTypeParametersDescription
theme_after_skin_insertaction$skin_id (int), $source_skin_id (int)Fires after new skin is created
theme_default_skin_createdaction$skin_id (int)Fires after default skin is created for theme
theme_update_master_hslaction$master_variables (array)Fires when master color palette HSL values are updated
thrive_theme_override_skinfilter$skin (Thrive_Skin)Replace or override a skin object
thrive_css_file_contentfilter$style, $filename, $skinModify CSS file content for skins
thrive_theme_deny_create_default_skinfilter$deny (bool)Control whether default skin auto-creation is allowed
HookTypeParametersDescription
thrive_theme_breadcrumbs_root_itemsfilter$items (array), $index, $in_editorModify root breadcrumb items
thrive_theme_allowed_taxonomies_in_breadcrumbsfilter$taxonomies (array), $post_typeControl which taxonomies appear in breadcrumbs
thrive_breadcrumb_post_linkfilter$link (string), $ancestor_idModify ancestor post links in breadcrumbs
thrive_theme_breadcrumbs_archive_titlefilter$title (string or null)Custom archive title in breadcrumbs
thrive_theme_breadcrumbs_labelsfilter$labels (array)Filter breadcrumb label strings

Content Types and Queries

HookTypeParametersDescription
thrive_theme_content_typesfilter$types (array), $context (string)Filter content types available in context
thrive_ignored_post_typesfilter$types (array)Filter post types excluded from theme
thrive_ignore_taxonomiesfilter$taxonomies (array)Filter taxonomies excluded from theme
thrive_theme_query_varsfilter$query_vars (array)Filter custom query variables
thrive_theme_should_filter_pre_get_postsfilter$filter (bool), $query (WP_Query)Control post list query filtering
thrive_theme_visibility_configfilter$config (array)Filter template visibility rules configuration
thrive_theme_scripts_post_typesfilter$post_types (array)Filter post types that enqueue theme scripts

Post Formats and Media

HookTypeParametersDescription
thrive_theme_post_thumbnailfilter$image (string), $post_id, $post_typeModify post thumbnail output
thrive_theme_post_thumbnail_urlfilter$url (string), $post_id, $post_typeModify post thumbnail URL
thrive_theme_dynamic_videofilter$html (string)Filter dynamic video output
thrive_theme_dynamic_audiofilter$content (string)Filter dynamic audio output
thrive_theme_video_post_typefilter$type (string), $post_idModify video post format type

Configuration

HookTypeParametersDescription
thrive_theme_display_cssfilter$display (bool)Control whether theme CSS is displayed
thrive_theme_use_inline_cssfilter$use_inline (bool)Control whether CSS is inlined vs external
thrive_html_classfilter$classes (array)Filter root HTML element classes
thrive_body_classfilter$class (string), $postFilter body CSS classes for post
ttb_brandingfilter$html (string)Customize TTB branding icon
thrive_theme_allow_architect_switchfilter$allow (bool)Control whether architect editor link appears

Thrive Dashboard

User Authentication

HookTypeParametersDescription
thrive_core_user_loginaction$user_id, $user_login, $user (WP_User)Fires when user logs in via Thrive Dashboard
thrive_register_form_through_wordpress_useraction$user_id (int), $data (array)Fires when user registers via WordPress form integration
tve_get_current_user_idfilter$user_id (int)Filter current user ID retrieval
thrive_dashboard_extra_user_datafilter$user_details (array)Add extra user data fields

Product Management

HookTypeParametersDescription
thrive_dashboard_loadedaction(none)Fires after Dashboard is loaded, before products initialize
tve_dash_installed_productsfilter$products (array)Filter list of installed Thrive products
thrive_has_access_{product}filter$has_access (bool)Filter product access capability checks (dynamic suffix)
tve_dash_featuresfilter$features (array)Filter which features are enabled
tve_dash_admin_product_menufilter$menus (array)Filter product admin menu items

Autoresponder and Forms

HookTypeParametersDescription
tve_filter_api_typesfilter$api_types (array)Filter available autoresponder API types
tve_filter_available_connectionfilter$available (array)Filter available autoresponder connections
thrive_api_email_messagefilter$message (string), $args (array)Modify complete email message before sending
thrive_email_message_fieldfilter$value (string), $field, $argsModify email message field values
tve_dash_email_datafilter$data (array), $arguments (array)Filter email connection data

Cache and Performance

HookTypeParametersDescription
tve_dash_cache_known_pluginsfilter$plugins (array)Filter known cache plugin list
tve_dash_cache_clear_callbackfilter$callback, $cache_pluginFilter cache clearing function for plugin
thrive_transient_expiration_{transient}filter$expiration (int)Filter specific transient expiration time

Webhooks and REST API

HookTypeParametersDescription
tve_dash_webhook_triggerfilter$id, $code, $data (array)Filter webhook trigger execution
tve_dash_main_ajax_{key}filter$response (array), $data (array)Filter AJAX response data per action key
tve_dash_frontend_ajax_responsefilter$response (array)Filter complete frontend AJAX response

Indexing and SEO

HookTypeParametersDescription
tve_dash_should_index_pagefilter$should_index (bool)Control whether current page should be indexed
tve_dash_exclude_post_types_from_indexfilter$post_types (array)Filter post types excluded from search indexing
tve_dash_yoast_sitemap_exclude_post_typesfilter$post_types (array)Filter post types excluded from Yoast sitemap

WooCommerce Integration

HookTypeParametersDescription
thrive_woo_product_purchase_completedaction$product, $user, $billing_emailWooCommerce purchase completes
thrive_woo_product_purchase_processingaction$product, $user, $billing_emailWooCommerce purchase begins processing
thrive_woo_product_refundaction$product, $user, $billing_emailWooCommerce product is refunded

Thrive Leads

Form Display and Targeting

HookTypeParametersDescription
tve_leads_delete_postaction$post_id (int)Lead form or post is deleted
tve_leads_ajax_load_prepare_variationaction$variation (array), $form_type (WP_Post)Prepare scripts when lazy-loading form variations
tve_leads_allow_shortcodesfilter$allow (bool)Control whether Thrive Leads shortcodes are registered
thrive_leads_skip_requestfilter$skip (bool)Short-circuit Thrive Leads display checks for current request
thrive_leads_post_types_blacklistfilter$blacklist (array)Define post types where Thrive Leads should not display
thrive_leads_is_pagefilter$is_page (bool)Filter page detection logic
thrive_leads_current_postfilter$post (WP_Post)Filter current post for lead group targeting
tve_leads_do_not_show_two_stepfilter$hide (bool), $form_idConditionally hide two-step lightbox forms

Lazy Loading and AJAX

HookTypeParametersDescription
tve_leads_lazy_load_formsfilter$lazy_load (bool)Enable or disable AJAX lazy-loading of forms
tve_leads_ajax_loadfilter$ajax_load (bool)Determine if forms load via AJAX on DOM ready
tve_leads_ajax_load_formsfilter$response (array)Filter complete AJAX response for lazy-loaded forms
tve_leads_append_states_ajaxfilter$variations (array)Filter AJAX-loaded variations before response

Variation States

HookTypeParametersDescription
tve_leads_variation_append_statesfilter$html (string), $variation (array)Append custom HTML or states to form variations
tve_frontend_options_datafilter$frontend_options (array)Filter frontend JavaScript options (shared across products)

Thrive Quiz Builder

Quiz Lifecycle

HookTypeParametersDescription
thrive_quizbuilder_quiz_completedaction$quiz_details, $user_data, $form_data, $post_idQuiz completion finalized — integrate with CRM, email, analytics
thrive_quizbuilder_quiz_restartedaction$quiz_details, $user_detailsUser restarts a quiz
thrive_quizbuilder_answer_submittedaction$quiz_details, $answer_data, $user_detailsIndividual question answer submitted

Example — Send quiz results to external service:

add_action( 'thrive_quizbuilder_quiz_completed', function( $quiz, $user, $form, $post_id ) {
    // $quiz contains quiz_id, quiz_title, result
    // $user contains user details
    // $form contains form submission data
    wp_remote_post( 'https://your-api.com/quiz-results', [
        'body' => json_encode( [
            'quiz_id' => $quiz['quiz_id'],
            'result'  => $quiz['result'],
            'email'   => $user['email'] ?? '',
        ] ),
    ] );
}, 10, 4 );

Thrive Ultimatum

Campaign Events

HookTypeParametersDescription
thrive_ultimatum_evergreen_campaign_startaction$campaign_data, $user_dataEvergreen countdown campaign starts for a user
tve_ult_action_impressionaction$campaign (WP_Post)Campaign impression recorded (non-crawler traffic)
thrive_ult_can_display_campaignfilter$can_display (bool)Control whether campaigns should display
thrive_ult_js_localizefilter$frontend_data (array)Filter frontend JavaScript localization data

Example — Sync campaign start with external system:

add_action( 'thrive_ultimatum_evergreen_campaign_start', function( $campaign, $user ) {
    // $campaign contains campaign ID, end time, etc.
    // Sync countdown with your email platform
}, 10, 2 );

Display Control

HookTypeParametersDescription
tve_ult_body_end_htmlfilter$html (string)Append custom HTML before closing body tag
tve_ultimatum_ajax_load_formsfilter$response (array)Filter AJAX response for lazy-loaded campaigns
tve_ult_shortcode_render_exceptionfilter$exception (bool)Bypass shortcode render exception handling
tve_ult_settings_post_types_blacklistfilter$blacklist (array)Blacklist post types from campaign targeting
tve_ult_accepted_admin_pagesfilter$pages (array)Define which admin pages display Ultimatum UI

Thrive Ovation

Testimonial Lifecycle

HookTypeParametersDescription
thrive_ovation_testimonial_submitaction$testimonial_details, $userTestimonial submitted by user
thrive_ovation_testimonial_readyaction$testimonial_details, $user_detailsTestimonial approved and ready for display
thrive_ovation_testimonial_rejectedaction$testimonial_details, $user_detailsTestimonial rejected by admin

Example — Notify on testimonial approval:

add_action( 'thrive_ovation_testimonial_ready', function( $testimonial, $user ) {
    // Send thank-you email or publish to social media
    wp_mail( $user['email'], 'Your testimonial is live!', 'Thank you for your feedback.' );
}, 10, 2 );

Thrive Automator

Initialization and Data Objects

HookTypeParametersDescription
thrive_automator_initaction(none)Fires after Thrive Automator initializes — register custom triggers here
thrive_automator_process_data_object_{id}filter$data_object, $raw_data, $data_object_idModify specific data object types before automation triggers
thrive_automator_data_object_{id}_fieldsfilter$fields (array)Modify available fields on a data object type
thrive_automator_filter_duplicate_metafilter$meta, $new_id, $old_idFilter post meta when duplicating an automation

Parameter Reference

Common Parameter Shapes

$user_details (array) — Used across Apprentice lifecycle hooks:

  • ID — WordPress user ID
  • user_login — Username
  • user_email — Email address
  • display_name — Display name

$course_details (array) — Course lifecycle hooks:

  • course_id — Course term ID
  • course_title — Course name

$lesson_details (array) — Lesson lifecycle hooks:

  • lesson_id — Lesson post ID
  • lesson_title — Lesson name
  • course_id — Parent course ID

$module_details (array) — Module lifecycle hooks:

  • module_id — Module ID
  • module_title — Module name
  • course_id — Parent course ID

$form_data (array) — Lead generation hooks:

  • email — Submitted email address
  • name — Submitted name
  • Additional custom fields as key-value pairs

Best Practices

  • Use a child theme or custom plugin. Add your custom hooks to a child theme’s functions.php or create a site-specific plugin. Never edit core plugin files directly.
  • Prefix your functions. Use prefixes like mycompany_ or client_ to avoid naming conflicts with other plugins.
  • Set priority and parameter count. Always specify the priority (default 10) and the number of accepted parameters when hooking into actions and filters. For example: add_action( 'hook_name', 'my_function', 10, 2 ).
  • Return filtered values. When using add_filter(), always return a value. Forgetting to return will result in null data.
  • Test in staging first. Always test your custom hooks on a staging site before deploying to production.
Was this article helpful?

Related Articles

>