Action Hooks (Extend Functionality with Hooks)
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.
| Hook | When | Usage |
|---|---|---|
movie_engine_before_single_movie_wrapper | Before full page | Banner, tracking |
movie_engine_single_movie_hero | Hero section | Replace layout |
movie_engine_single_movie_content | Main content | Add sections |
movie_engine_after_single_movie_wrapper | After page | CTA, newsletter |
movie_engine_before_player | Before player | Ads, notices |
movie_engine_after_player | After player | Related content |
movie_engine_ad_player_top | Above player | Ads |
movie_engine_ad_player_bottom | Below player | Ads |
movie_engine_ad_before_content | Before content | Ads |
movie_engine_ad_after_content | After content | Ads |
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.
| Hook | When |
|---|---|
movie_engine_before_single_series_wrapper | Before page |
movie_engine_single_series_hero | Hero section |
movie_engine_single_series_content | Main content |
movie_engine_after_single_series_wrapper | After page |
Single Episode Hooks
These hooks apply to the episode playback page, allowing you to control episode-specific layouts, navigation, and engagement elements.
| Hook | When |
|---|---|
movie_engine_before_single_episode_wrapper | Before page |
movie_engine_single_episode_sections | Content sections |
movie_engine_after_single_episode_wrapper | After page |
Archive Hooks (Movies / Series)
These hooks control the archive listing pages (movie library, series listing), including headers, filters, grids, and pagination areas.
| Hook | When |
|---|---|
movie_engine_archive_header | Archive header |
movie_engine_archive_before_grid | Before grid |
movie_engine_archive_content | Grid content |
movie_engine_archive_after_grid | After 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.
| Hook | Params | When |
|---|---|---|
movie_engine_before_taxonomy_archive | $term, $taxonomy | Before page |
movie_engine_before_archive_header | $term, $taxonomy | Before header |
movie_engine_after_archive_header | $term, $taxonomy | After header |
movie_engine_after_taxonomy_archive | $term, $taxonomy | After 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.
| Hook | Params | When |
|---|---|---|
movie_engine_before_library_grid | $atts | Before grid |
movie_engine_after_library_grid | $atts | After grid |
Content Card Hooks
These hooks control individual content cards inside loops (movie/series grids), useful for adding badges, overlays, or custom actions.
| Hook | Params | When |
|---|---|---|
movie_engine_card_poster_end | $post_id | Poster overlay |
movie_engine_card_content_end | $post_id | Card content end |
Auth Hooks
These hooks are used in login and registration forms, allowing you to enhance user experience or add compliance elements.
| Hook | When |
|---|---|
movie_engine_after_login_form_buttons | After login buttons |
User Dashboard Hooks
These hooks allow you to extend the user dashboard, including purchases, memberships, referrals, and transactions.
| Hook | Params |
|---|---|
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.
| Hook | When |
|---|---|
movie_engine_ad_header | Header |
movie_engine_ad_footer | Footer |
movie_engine_ad_before_content | Before content |
movie_engine_ad_after_content | After content |
movie_engine_ad_player_top | Above player |
movie_engine_ad_player_bottom | Below 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
| Filter | Purpose |
|---|---|
movie_engine_library_args | Modify query |
movie_engine_get_template_part | Override template |
movie_engine_the_content | Filter content |
movie_engine_share_link | Change 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
