Developer Guide

Filter Hooks (Modify Output & Data)

Estimated reading: 3 minutes 47 views

Filters allow you to modify data before it is used or displayed in Movie Engine.
They are essential for customizing behavior, output, and logic — without editing plugin core files.

Movie Engine provides powerful filter hooks to fully control data, logic, and frontend behavior — without modifying core files.

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

🚀 How to Use Filters

1. Modify Data

add_filter('filter_name', 'your_callback', 10, $num_args);

2. Return Modified Value

function your_callback($value) {
return $value;
}

3. Merge or Override

  • Modify arrays (e.g., query args, JS data)
  • Override default logic (permissions, duration, etc.)

💡 Why Use Filters?

  • ✅ No core edits (safe updates)
  • ✅ Full control over output and logic
  • ✅ Easy integration with third-party tools
  • ✅ Modify queries, templates, and restrictions
  • ✅ Developer-friendly customization layer

🧩 Template & Content Filters

These filters control template loading and frontend content output, allowing you to override templates, modify content, or customize share links.

FilterParamsDefaultUsage
movie_engine_get_template_part$template, $slug, $namePlugin templateOverride template file
movie_engine_the_content$contentPost contentModify content output
movie_engine_share_link$url, $post_idPermalinkCustomize share URL

Example – Override Template

add_filter('movie_engine_get_template_part', function($template, $slug, $name) {
$custom = get_stylesheet_directory() . '/movie-engine/' . $slug . ($name ? '-' . $name : '') . '.php';
return file_exists($custom) ? $custom : $template;
}, 10, 3);

Library Shortcode Filters

These filters modify the query and behavior of the library shortcode, giving you full control over displayed content.

FilterParamsDefaultUsage
movie_engine_library_args$query_args, $attsWP_Query argsModify query

Example – Custom Query

add_filter('movie_engine_library_args', function($args, $atts) {
$args['meta_query'][] = [
'key' => '_movie_engine_rating',
'value' => 7,
'compare' => '>=',
'type' => 'NUMERIC',
];
return $args;
}, 10, 2);

Review Filters

These filters control review permissions and behavior, allowing custom rules for editing or managing reviews.

FilterParamsDefaultUsage
movie_engine_can_edit_review$can_edit, $commentPlugin logicControl edit permission

Example – Limit Edit Time

add_filter('movie_engine_can_edit_review', function($can_edit, $comment) {
$hours = (time() - strtotime($comment->comment_date)) / 3600;
return $hours < 24;
}, 10, 2);

User Dashboard Filters

These filters allow you to extend the user dashboard and frontend data layer, including custom fields and JavaScript variables.

FilterParamsDefaultUsage
movie_engine_render_custom_password_fields$rendered, $user_id, $userfalseAdd custom fields
movie_engine_dashboard_data$dataDefault arrayExtend dashboard JS
movie_engine_frontend_data$dataDefault arrayExtend frontend JS

Example – Add Frontend Data

add_filter('movie_engine_frontend_data', function($data) {
$data['my_api_key'] = 'xxx';
return $data;
});

🔐 Profile Filters

These filters control user profile and validation logic, such as password rules.

FilterParamsDefaultUsage
movie_engine_validate_password_change$valid, $user_id, $current, $newfalseCustom validation

📌 Full Filter Index (Quick Reference)

🧩 Template & Content

  • movie_engine_get_template_part
  • movie_engine_the_content
  • movie_engine_share_link

🔎 Library

  • movie_engine_library_args

⭐ Reviews

  • movie_engine_can_edit_review

👤 Dashboard

  • movie_engine_render_custom_password_fields
  • movie_engine_dashboard_data
  • movie_engine_frontend_data

💎 Membership

  • movie_engine_is_premium
  • movie_engine_is_restricted
  • movie_engine_partial_paywall_duration
  • movie_engine_preview_duration

🔐 Profile

  • movie_engine_validate_password_change
Share this Doc

Filter Hooks (Modify Output & Data)

Or copy link

CONTENTS