Override EA4V widgets templates
You can use filters to override the templates of EA4V widgets.
apply_filters(‘/ea4v/widgets/templates/{{widget-name}}’, $default_template_path, $instance)
{{widget-name}} can be:
-
change_post_field
-
compare_button
-
compare_popup
-
create_post
-
login
-
messages
-
notification_settings
-
popup
-
post_feed
-
saved_search
-
search_form
-
timeline
-
Example:
add_filter(‘/ea4v/widgets/templates/create_post’, function ($default_template_path, $instance) {
// Define your custom template path
$custom_path = get_stylesheet_directory() . ‘/custom-templates/create-post.php’;// Check if the custom template file exists
if (file_exists($custom_path)) {
return $custom_path;
}
// Return the default path if the custom path does not exist
return $default_template_path;
}, 10, 2);