{"id":114141266,"date":"2026-01-22T03:11:06","date_gmt":"2026-01-22T08:11:06","guid":{"rendered":"https:\/\/thrivethemes.com\/?post_type=ht_kb&#038;p=114141266"},"modified":"2026-01-22T06:03:35","modified_gmt":"2026-01-22T11:03:35","slug":"thrive-themes-action-hooks-custom-functions","status":"publish","type":"ht_kb","link":"https:\/\/thrivethemes.com\/docs\/thrive-themes-action-hooks-custom-functions\/","title":{"rendered":"Thrive Themes Action Hooks &amp; Custom Functions"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1. Action Hooks<\/h2>\n\n\n\n<p>Actions provide a way to run a function at a specific point in the execution of WordPress Core, plugins, and themes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Implementation Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>function custom_logic_after_campaign_start($data) {\n    \/\/ Add your custom logic here\n}\nadd_action('thrive_ultimatum_evergreen_campaign_start', 'custom_logic_after_campaign_start');<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Supported Products &amp; Key Hooks<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Product<\/th><th>Hook ID<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><strong>Thrive Dashboard<\/strong><\/td><td><code>thrive_core_user_login<\/code><\/td><td>Fired when a user logs in.<\/td><\/tr><tr><td><strong>Thrive Architect<\/strong><\/td><td><code>thrive_core_lead_signup<\/code><\/td><td>Fired when a lead is captured via a Lead Generation form.<\/td><\/tr><tr><td><strong>Thrive Apprentice<\/strong><\/td><td><code>thrive_apprentice_lesson_completed<\/code><\/td><td>Fired when a student completes a lesson.<\/td><\/tr><tr><td><strong>Thrive Ultimatum<\/strong><\/td><td><code>thrive_ultimatum_campaign_start<\/code><\/td><td>Fired when a campaign starts for a user.<\/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\">2. Filter Hooks<\/h2>\n\n\n\n<p>Filters allow you to intercept and modify data before it is processed or displayed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Featured Example: Social Meta Data Filter<\/h3>\n\n\n\n<p>The <code>tha_social_meta<\/code> filter allows you to modify the Open Graph and Twitter metadata generated by your theme.<\/p>\n\n\n\n<p><strong>Filter Definition:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$meta = apply_filters('tha_social_meta', $meta);<\/code><\/pre>\n\n\n\n<p><strong>Usage Example:<\/strong><br>Add this to your child theme&#8217;s <code>functions.php<\/code> to override the <code>og:url<\/code> data:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter(\"tha_social_meta\", \"modify_og_url\");\n\nfunction modify_og_url($meta) {\n    $url = 'https:\/\/yourcustomurl.com';\n    $meta&#91;'og:url']&#91;'content'] = $url;\n    return $meta;\n}<\/code><\/pre>\n\n\n\n<p><strong>Metadata Structure:<\/strong><br>The <code>$meta<\/code> array contains unique IDs for each tag, allowing for precise overrides of <code>og:type<\/code>, <code>og:url<\/code>, <code>twitter:card<\/code>, and more.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. Parameter Reference<\/h2>\n\n\n\n<p>When hooking into Thrive events, the following data objects are commonly passed to your functions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>User Data<\/strong>: Includes <code>WP_User<\/code> object, Username, and Email.<\/li>\n\n\n\n<li><strong>Form Data<\/strong>: Raw data submitted through Lead Generation or Contact Forms.<\/li>\n\n\n\n<li><strong>Apprentice Data<\/strong>: Lesson IDs, Course IDs, and Module structures.<\/li>\n\n\n\n<li><strong>Campaign Data<\/strong>: Thrive Ultimatum campaign IDs and settings.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use Child Themes<\/strong>: Always add custom hooks to a child theme&#8217;s <code>functions.php<\/code> or a site-specific plugin to prevent changes from being lost during updates.<\/li>\n\n\n\n<li><strong>Prefix Functions<\/strong>: Prefix your function names (e.g., <code>tt_<\/code> or <code>yourprefix_<\/code>) to avoid conflicts with WordPress core or other plugins.<\/li>\n\n\n\n<li><strong>Reference GitHub<\/strong>: For more advanced hook examples, visit our <a href=\"https:\/\/github.com\/ThriveThemes\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">Developer GitHub Repository<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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. 1. Action Hooks Actions provide a way to run a function at a specific point in the execution of WordPress Core, plugins, and themes. Implementation Example Supported Products &amp; Key [&hellip;]<\/p>\n","protected":false},"author":242721,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"ht-kb-category":[34151],"ht-kb-tag":[34315,34317,34316,34308,34318,34322,34320,34319,34321],"class_list":["post-114141266","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-developer-documentation","ht_kb_tag-action-hooks","ht_kb_tag-api","ht_kb_tag-custom-functions","ht_kb_tag-filter-hooks","ht_kb_tag-php","ht_kb_tag-social-meta-data","ht_kb_tag-thrive-architect","ht_kb_tag-thrive-dashboard","ht_kb_tag-thrive-ultimatum","post-wrapper","thrv_wrapper"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/ht-kb\/114141266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/users\/242721"}],"replies":[{"embeddable":true,"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/comments?post=114141266"}],"version-history":[{"count":0,"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/ht-kb\/114141266\/revisions"}],"wp:attachment":[{"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/media?parent=114141266"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/ht-kb-category?post=114141266"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/thrivethemes.com\/wp-json\/wp\/v2\/ht-kb-tag?post=114141266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}