Developer Guide

Action Hooks (Extend Functionality with Hooks)

Estimated reading: 5 minutes 52 views

Action hooks allow you to inject custom HTML, logic, or scripts into specific parts of the Movie Engine frontend β€” without modifying plugin core files.

Use them in your theme’s functions.php or a custom plugin.


πŸš€ How to Use Hooks

1. Add Custom Content

add_action('hook_name', 'your_callback', 10, $num_args);

2. Replace Default Output

remove_action('hook_name', 'default_callback', 10);
add_action('hook_name', 'your_callback', 10);

3. Combine with Template Overrides

  • Copy template β†’ your-theme/movie-engine/
  • Modify structure or remove do_action() calls

Why Use Hooks?

  • βœ… No core edits (safe updates)
  • βœ… Full theme customization
  • βœ… Add ads, banners, tracking
  • βœ… Extend layouts easily
  • βœ… Developer-friendly ecosystem

Single Movie Hooks

These hooks control the single movie page layout, including hero section, video player, content blocks, and ads. Use them to fully customize the viewing experience or inject monetization elements.

HookWhenUsage
movie_engine_before_single_movie_wrapperBefore full pageBanner, tracking
movie_engine_single_movie_heroHero sectionReplace layout
movie_engine_single_movie_contentMain contentAdd sections
movie_engine_after_single_movie_wrapperAfter pageCTA, newsletter
movie_engine_before_playerBefore playerAds, notices
movie_engine_after_playerAfter playerRelated content
movie_engine_ad_player_topAbove playerAds
movie_engine_ad_player_bottomBelow playerAds
movie_engine_ad_before_contentBefore contentAds
movie_engine_ad_after_contentAfter contentAds

Example

add_action('movie_engine_before_single_movie_wrapper', function() {
echo '<div class="promo-banner">New movies every Friday!</div>';
});

Single Series Hooks

These hooks are used on the series detail page, where you can customize the hero section, episode list, and additional content areas.

HookWhen
movie_engine_before_single_series_wrapperBefore page
movie_engine_single_series_heroHero section
movie_engine_single_series_contentMain content
movie_engine_after_single_series_wrapperAfter page

Single Episode Hooks

These hooks apply to the episode playback page, allowing you to control episode-specific layouts, navigation, and engagement elements.

HookWhen
movie_engine_before_single_episode_wrapperBefore page
movie_engine_single_episode_sectionsContent sections
movie_engine_after_single_episode_wrapperAfter page

Archive Hooks (Movies / Series)

These hooks control the archive listing pages (movie library, series listing), including headers, filters, grids, and pagination areas.

HookWhen
movie_engine_archive_headerArchive header
movie_engine_archive_before_gridBefore grid
movie_engine_archive_contentGrid content
movie_engine_archive_after_gridAfter grid

Example

add_action('movie_engine_archive_before_grid', function() {
echo '<p class="archive-intro">Browse all content below</p>';
});

Taxonomy Archive Hooks

These hooks are used for taxonomy pages (genre, country, year, etc.), enabling dynamic content based on the selected term.

HookParamsWhen
movie_engine_before_taxonomy_archive$term, $taxonomyBefore page
movie_engine_before_archive_header$term, $taxonomyBefore header
movie_engine_after_archive_header$term, $taxonomyAfter header
movie_engine_after_taxonomy_archive$term, $taxonomyAfter page

Library Shortcode Hooks

These hooks apply when using the [movie_engine_library] shortcode, allowing you to extend or modify the output inside any page or builder.

HookParamsWhen
movie_engine_before_library_grid$attsBefore grid
movie_engine_after_library_grid$attsAfter grid

Content Card Hooks

These hooks control individual content cards inside loops (movie/series grids), useful for adding badges, overlays, or custom actions.

HookParamsWhen
movie_engine_card_poster_end$post_idPoster overlay
movie_engine_card_content_end$post_idCard content end

Auth Hooks

These hooks are used in login and registration forms, allowing you to enhance user experience or add compliance elements.

HookWhen
movie_engine_after_login_form_buttonsAfter login buttons

User Dashboard Hooks

These hooks allow you to extend the user dashboard, including purchases, memberships, referrals, and transactions.

HookParams
movie_engine_dashboard_purchases$view, $user
movie_engine_dashboard_referrals$user
movie_engine_dashboard_transactions$user
movie_engine_dashboard_membership$user, $active_plan, $plan_name, $pricing_url

Ad Hooks

These hooks are dedicated to ad placement and monetization, allowing flexible ad injection across the platform.

HookWhen
movie_engine_ad_headerHeader
movie_engine_ad_footerFooter
movie_engine_ad_before_contentBefore content
movie_engine_ad_after_contentAfter content
movie_engine_ad_player_topAbove player
movie_engine_ad_player_bottomBelow player

Replace Default Section Example

remove_action(
'movie_engine_single_movie_hero',
[\MovieEngine\Frontend\TemplateHooks::class, 'render_hero_section'],
10
);
add_action('movie_engine_single_movie_hero', function() {
get_template_part('template-parts/custom-hero');
});

Related Filters

FilterPurpose
movie_engine_library_argsModify query
movie_engine_get_template_partOverride template
movie_engine_the_contentFilter content
movie_engine_share_linkChange share URL

Full Hook Index (Quick Reference)

🎬 Single Movie

  • movie_engine_before_single_movie_wrapper
  • movie_engine_single_movie_hero
  • movie_engine_single_movie_content
  • movie_engine_after_single_movie_wrapper
  • movie_engine_before_player
  • movie_engine_after_player
  • movie_engine_ad_player_top
  • movie_engine_ad_player_bottom
  • movie_engine_ad_before_content
  • movie_engine_ad_after_content

πŸ“Ί Series

  • movie_engine_before_single_series_wrapper
  • movie_engine_single_series_hero
  • movie_engine_single_series_content
  • movie_engine_after_single_series_wrapper

🎞 Episode

  • movie_engine_before_single_episode_wrapper
  • movie_engine_single_episode_sections
  • movie_engine_after_single_episode_wrapper

πŸ“š Archive

  • movie_engine_archive_header
  • movie_engine_archive_before_grid
  • movie_engine_archive_content
  • movie_engine_archive_after_grid

🏷 Taxonomy

  • movie_engine_before_taxonomy_archive
  • movie_engine_before_archive_header
  • movie_engine_after_archive_header
  • movie_engine_after_taxonomy_archive

πŸ”Ž Library

  • movie_engine_before_library_grid
  • movie_engine_after_library_grid

🎴 Cards

  • movie_engine_card_poster_end
  • movie_engine_card_content_end

πŸ” Auth

  • movie_engine_after_login_form_buttons

πŸ‘€ Dashboard

  • movie_engine_dashboard_purchases
  • movie_engine_dashboard_referrals
  • movie_engine_dashboard_transactions
  • movie_engine_dashboard_membership

πŸ’° Ads

  • movie_engine_ad_header
  • movie_engine_ad_footer
  • movie_engine_ad_before_content
  • movie_engine_ad_after_content
  • movie_engine_ad_player_top
  • movie_engine_ad_player_bottom
Share this Doc

Action Hooks (Extend Functionality with Hooks)

Or copy link

CONTENTS