Treweler Map Builder 1.03.2 has 43 actions and 89 filters, read directly from its source code on Nov 18, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Treweler Map Builder fires an action
add_action( 'twer_after_main_content', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Treweler Map Builder is about to use
add_filter( 'treweler_has_block_template', function( $has_template, $template_name ) {
// Change $has_template here.
return $has_template;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Filters the value of the result of the block template check. */ apply_filters( 'treweler_has_block_template', $has_template, $template_name ); -
/** * Filter to adjust the base templates path. */ apply_filters( 'treweler_template_path', 'treweler/' ); -
/** * Allows you to modify the normalized specification FOR A SPECIFIC type. */ apply_filters( 'twer_admin_ui_cleanup_normalized_spec', $out, $spec, $post_type ); -
/** * twer_after_main_content hook. */ do_action( 'twer_after_main_content' ); -
/** * twer_before_main_content hook. */ do_action( 'twer_before_main_content' ); -
/** * Allow plugins to enable nocache headers. Enabled for Google weblight. */ apply_filters( 'twer_enable_nocache_headers', false ); -
/** * twer_extended_store_locator_body hook. */ do_action( 'twer_extended_store_locator_body' ); -
/** * twer_extended_store_locator_filter_panel hook. */ do_action( 'twer_extended_store_locator_filter_panel' ); -
/** * twer_before_map hook. */ do_action( 'twer_left_sidebar_map' ); -
/** * twer_map_elements_templates hook. */ do_action( 'twer_map_elements_templates' ); -
do_action( 'twer_extended_store_locator_card_header' ); -
do_action( 'treweler_flush_rewrite_rules' ); -
apply_filters( 'twer_admin_edit_ui_cleanup_registry', $registry, $screen ); -
apply_filters( 'twerSetOutputCategories', $categories_ids, $mapId, $args ); -
do_action( 'wp_head' ); -
apply_filters_deprecated( "{$handle}_params", array( $params ), '1.13', 'twer_get_script_data' ); -
apply_filters( "{$shortcode}_shortcode_tag", $shortcode ); -
apply_filters( "{$this->metabox}_assign_fields", $this->fields, $this->metabox ); -
apply_filters( "{$this->metabox}_assign_nestedFields", $this->nestedFields, $this->metabox ); -
apply_filters( "{$this->metabox}_assign_nestedTabs", $this->nestedTabs, $this->metabox ); -
apply_filters( "{$this->metabox}_assign_settings", $this->meta_box_settings, $this->metabox ); -
apply_filters( "{$this->metabox}_assign_tabs", $this->tabs, $this->metabox ); -
do_action( 'before_treweler_init' ); -
do_action( 'deprecated_argument_run', $argument, $message, $version ); -
do_action( 'doing_it_wrong_run', $function, $message, $version ); -
apply_filters( 'plugin_locale', $locale, 'treweler' ); -
apply_filters( 'the_content', $custom_field_html ); -
do_action( 'treweler_addons_page_init' ); -
apply_filters( 'treweler_admin_views_path', $this->plugin_path() . '/includes/admin/views/' ); -
do_action( 'treweler_after_register_post_type' ); -
do_action( 'treweler_after_register_taxonomy' ); -
do_action( 'treweler_after_template_part', $action_args['template_name'], $action_args['template_path'], $action_args['located'], $action_args['args'] ); -
do_action( 'treweler_before_template_part', $action_args['template_name'], $action_args['template_path'], $action_args['located'], $action_args['args'] ); -
apply_filters( 'treweler_check_permissions_folders', [ $views_foldes . 'templates_c', $views_foldes . 'templates', $views_foldes . 'cache', ] ); -
apply_filters( 'treweler_enqueue_scripts', self::$scripts ); -
apply_filters( 'treweler_enqueue_styles', self::$styles ); -
apply_filters( 'treweler_free_screen_ids', $screen_ids ); -
apply_filters( "treweler_get_{$page}_page_id", get_option( 'treweler_' . $page . '_page_id' ) ); -
apply_filters( "treweler_get_{$page}_page_permalink", $permalink ); -
apply_filters( 'treweler_get_all_published_maps', [ 'post_type' => 'map', 'post_status' => 'publish', 'posts_per_page' => - 1, 'orderby' => 'title', 'order' => 'ASC', 'fields' => 'ids' ] ); -
apply_filters( 'treweler_get_all_published_markers_ids', [ 'post_type' => 'marker', 'post_status' => 'publish', 'posts_per_page' => - 1, 'fields' => 'ids' ] ); -
apply_filters( 'treweler_get_asset_url', plugins_url( $path, TWER_PLUGIN_FILE ), $path ); -
apply_filters( 'treweler_get_path_define_tokens', $path_tokens ); -
do_action( 'treweler_init' ); -
do_action( 'treweler_installed' ); -
apply_filters( 'treweler_is_rest_api_request', $is_rest_api_request ); -
do_action( 'treweler_loaded' ); -
apply_filters( 'treweler_locate_template', $template, $template_name, $template_path ); -
do_action( 'treweler_register_post_type' ); -
apply_filters( 'treweler_register_post_type_map', [ 'labels' => [ 'name' => esc_html_x( 'Maps', 'Post type general name', 'treweler' ), 'singular_name' => esc_html_x( 'Map', 'Post type singular name', 'treweler' ), 'add_new' => esc_html__( 'Add New', 'treweler' ), 'add_new_item' => esc_html__( 'Add New Map', 'treweler' ), 'edit_item' => esc_html__( 'Edit Map', 'treweler' ), 'new_item' => esc_html__( 'New Map', 'treweler' ), 'view_item' => esc_... ); -
apply_filters( 'treweler_register_post_type_marker', [ 'labels' => [ 'name' => esc_html_x( 'Markers', 'Post type general name', 'treweler' ), 'singular_name' => esc_html_x( 'Marker', 'Post type singular name', 'treweler' ), 'add_new' => esc_html__( 'Add New', 'treweler' ), 'add_new_item' => esc_html__( 'Add New Marker', 'treweler' ), 'edit_item' => esc_html__( 'Edit Marker', 'treweler' ), 'new_item' => esc_html__( 'New Marker', 'treweler' ), 'vie... ); -
apply_filters( 'treweler_register_post_type_route', [ 'labels' => [ 'name' => esc_html_x( 'Routes', 'Post type general name', 'treweler' ), 'singular_name' => esc_html_x( 'Route', 'Post type singular name', 'treweler' ), 'add_new' => esc_html__( 'Add New', 'treweler' ), 'add_new_item' => esc_html__( 'Add New Route', 'treweler' ), 'edit_item' => esc_html__( 'Edit Route', 'treweler' ), 'new_item' => esc_html__( 'New Route', 'treweler' ), 'view_ite... ); -
do_action( 'treweler_register_settings_done' ); -
do_action( 'treweler_register_taxonomy' ); -
apply_filters( 'treweler_screen_ids', $screen_ids ); -
do_action( 'treweler_settings_page_init' ); -
apply_filters( 'treweler_smarty_debug', false ); -
apply_filters( 'treweler_smarty_right_permissions', [ '0700', '0770', '0777', '0740', '0755' ] ); -
apply_filters( 'treweler_template_loader_files', array(), $default_file ); -
apply_filters( 'treweler_term_messages', $messages ); -
do_action( 'treweler_updated' ); -
do_action( 'twer_admin_ui_cleanup_after_print', $registry, $screen ); -
apply_filters( 'twer_admin_ui_cleanup_allowed_keys', ['title','slug','date','password','categories','order','status'], $post_type ); -
do_action( 'twer_admin_ui_cleanup_before_print', $registry, $screen ); -
apply_filters( 'twer_admin_ui_cleanup_child_spec', $raw, $this->list_table_type, $this ); -
apply_filters( 'twer_admin_ui_cleanup_enable', true, $screen ); -
do_action( 'twer_after_head' ); -
do_action( "twer_ajax_{$action}" ); -
apply_filters( 'twer_ajax_get_endpoint', add_query_arg( 'twer-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', 'relative' ) ) ), $request ); -
apply_filters( 'twer_card_image_size', 'large' ); -
apply_filters( 'twer_data_loader_url', self::get_asset_url( 'assets/scripts/front/treweler-data-loader.js' ) ); -
apply_filters( 'twer_default_permalink_query_categories', 'all', $map_id ); -
apply_filters( 'twer_delete_version_transients_limit', 1000 ); -
do_action( 'twer_extended_store_locator_card_header_end' ); -
do_action( 'twer_extended_store_locator_card_header_left_col_end' ); -
do_action( 'twer_extended_store_locator_card_header_left_col_start' ); -
do_action( 'twer_extended_store_locator_card_header_right_col_end' ); -
do_action( 'twer_extended_store_locator_card_header_right_col_start' ); -
do_action( 'twer_extended_store_locator_card_header_start' ); -
apply_filters( 'twer_features', twer_get_features( $map_id, $markers_ids, $args ), $map_id, $args ); -
apply_filters( 'twer_fonts_weight', [ '100' => esc_html__( 'Thin 100', 'treweler' ), '200' => esc_html__( 'Extra Light 200', 'treweler' ), '300' => esc_html__( 'Light 300', 'treweler' ), '400' => esc_html__( 'Regular 400', 'treweler' ), '500' => esc_html__( 'Medium 500', 'treweler' ), '600' => esc_html__( 'Semi Bold 600', 'treweler' ), '700' => esc_html__( 'Bold 700', 'treweler' ), '800' => esc_html__( 'Extra Bold 800', 'treweler... ); -
apply_filters( 'twer_force_include_shortcode_styles', false ); -
apply_filters( 'twer_get_custom_field_default_data', $data, $fieldId ); -
apply_filters( 'twer_get_custom_fields_data', $markerCustomFields, $markerId, $destination, $post_meta ); -
apply_filters( 'twer_get_html_categories_ddl', $crawler->filter( 'select' )->outerHtml(), $categoriesIds, $selection_method, $params ); -
apply_filters( 'twer_get_marker_raw_feature', $feature_result, $marker_id ); -
apply_filters( 'twer_get_marker_raw_finish_feature', $feature, $marker_id ); -
apply_filters( 'twer_get_script_data', $params, $handle ); -
apply_filters( 'twer_get_template', $template, $template_name, $args, $template_path, $default_path ); -
apply_filters( 'twer_get_template_args', [ 'enable_copy_link' => twer_is_map_fullscreen() && twer_is_enable_copy_marker_link_id(), 'copy_message' => __( 'Copy Link', 'treweler' ), 'copy_message_success' => __( 'Copied', 'treweler' ), 'copy_message_error' => __('Unable to copy to clipboard', 'treweler'), 'icon' => '<svg width="19" height="9"><use xlink:href="#link-icon"></use></svg>' ], 'card-header' ); -
apply_filters( 'twer_popup_image_size', 'large' ); -
apply_filters( 'twer_positions', [ 'left' => esc_html__( 'Left', 'treweler' ), 'right' => esc_html__( 'Right', 'treweler' ), 'top' => esc_html__( 'Top', 'treweler' ), 'top_left' => esc_html__( 'Top Left', 'treweler' ), 'top_right' => esc_html__( 'Top Right', 'treweler' ), 'bottom' => esc_html__( 'Bottom', 'treweler' ), 'bottom_left' => esc_html__( 'Bottom Left', 'treweler' ), 'bottom_right' => esc_html__( 'Bottom Right', 'trew... ); -
do_action( 'twer_pre_head' ); -
apply_filters( 'twer_registered_custom_fields_slugs', [ 'line', 'link-universal', 'multiselect', 'rating', 'number', 'separator', 'text', 'true-false', 'html', 'category', 'badge' ] ); -
apply_filters( 'twer_route_fields', [ 'styles' => $this->get_dummy_fields(), 'import' => TWER_IS_FREE ? $this->get_import_pro_notice_fields() : $this->get_import_fields(), 'actions' => TWER_IS_FREE ? $this->get_actions_pro_notice_fields() : $this->get_actions_fields(), ] ); -
apply_filters( 'twer_route_nested_fields', [ 'route-default-styles' => $this->get_route_default_styles(), 'route-hover-styles' => $this->get_route_hover_styles(), ] ); -
apply_filters( 'twer_route_nested_tabs', [ 'rootTab' => 'styles', 'tabs' => [ 'route-default-styles' => [ 'title' => esc_html__( 'Default', 'treweler' ), 'class' => '' ], 'route-hover-styles' => [ 'title' => esc_html__( 'Hover', 'treweler' ), 'class' => '' ] ] ] ); -
apply_filters( 'twer_route_tabs', [ 'styles' => esc_html__( 'Styles', 'treweler' ), 'import' => $import_tab, 'actions' => $actions_tab, ] ); -
apply_filters( 'twer_routes_data_output', $route_features, $map_id ); -
apply_filters( 'twer_set_markers_args_query_ids_for_map', wp_parse_args( $args, [ 'post_type' => 'marker', 'post_status' => 'publish', 'fields' => 'ids', 'posts_per_page' => - 1, 'meta_query' => [ 'relation' => 'OR', [ 'key' => TWER_META_PREFIX . 'marker_map_id', 'value' => $map_id, 'compare' => '=' ], [ 'key' => TWER_META_PREFIX . 'marker_map_id', 'value' => serialize( strval( $map_id ) ), 'compare' => 'LIKE' ] ] ] ) ); -
apply_filters( 'twer_set_markers_ids_for_map', $markers_ids, $map_id, $args ); -
do_action( 'twer_settings_before_render', $tabs, $options ); -
apply_filters( 'twer_settings_default_tabs', $tabs, $options ); -
apply_filters( 'twer_settings_plain_editor_html', $html, $page_slug, $options ); -
do_action( 'twer_settings_rendered', $tabs, $options ); -
do_action( "twer_settings_tab_content_{$tab['id']}", $tab, $options ); -
apply_filters( 'twer_settings_tabs', $tabs, $options ); -
apply_filters( 'twer_settings_validation', $input, $old ); -
apply_filters( 'twer_simple_taxonomy_ordering_front_end_order_terms', true ); -
do_action( 'twer_sto_taxonomy_order_updated', $taxonomy_ordering_data, $base_index ); -
apply_filters( 'twer_store_locator_placeholder', 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=', $map_id ); -
apply_filters( 'twerAllowedHeadSelectors', [ '[id^="treweler"]', '[id^="basement"]', '[rel^="dns-"]', '[rel^="preconnect"]', '[id^="dashicons-"]', '[id^="admin-bar-css"]', '[id^="jquery-core"]', '[id^="jquery-migrate"]', 'title', '[id^="lodash-"]', 'meta:not([name="viewport"])', 'link[rel*="icon"]', 'style[media="print"]', '[id*="mediaelement"]', 'script' ], $html, $crawler ); -
do_action( 'twerBodyOpen' ); -
apply_filters( 'twerDisabledGutenbergPostTypes', [ 'marker', 'route', 'map' ], $can_edit, $post_type ); -
apply_filters( 'twerGetRoutesOfMapArgs', [ 'post_type' => 'route', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => [ 'relation' => 'OR', [ 'key' => $prefix . 'route_map_id', 'value' => $mapId, 'compare' => '=' ], [ 'key' => $prefix . 'route_map_id', 'value' => serialize( strval( $mapId ) ), 'compare' => 'LIKE' ] ] ], $mapId ); -
apply_filters( 'twerHasDirectionsFeature', false ); -
apply_filters( 'twerHasImportFeature', true ); -
apply_filters( 'twerOutputRoutesForMap', $routes, $args, $mapId ); -
apply_filters( 'twerResultMapSettings', [ 'uploadsBaseUrl' => $upload_baseurl, 'mapPageId' => (int) $map_id, 'accessToken' => esc_js( $api_key ), 'container' => 'twer-map', 'style' => $map_style, 'customStyle' => trim( $customStyle ), 'mapLightPreset' => $map_light_preset, 'uncat_id' => (int) get_option( 'default_map_category', 0 ), 'categories' => [ 'selection_method' => $selection_method ], 'center' => [ esc_js( $ll1 ), esc_js( $ll... ); -
apply_filters( 'twerSetCustomFieldEntry', wp_parse_args( $fieldDataBasedOfType, $defaultData ), $fieldId, $fieldData, $fieldType ); -
apply_filters( 'twerSetDefaultCustomFieldNameWidth', 35 ); -
apply_filters( 'twerSetDefaultMapStyle', 'mapbox://styles/mapbox/standard-beta' ); -
apply_filters( 'twerSetDefaultRadiusSize', $defaultRadiusSize, $mapId ); -
apply_filters( 'twerSetGoToProMessage', esc_html__('This feature is only available with a Treweler Pro license. Upgrade to Pro version to get access to all plugin features and premium support.', 'treweler') ); -
apply_filters( 'twerSetScreenIdsUsedMapbox', [ 'route', 'marker', 'map' ] ); -
apply_filters( 'twerSetScreenIdsUsedMaterialIcons', [ 'marker' ] ); -
apply_filters( 'twerStoreLocatorSetSidebarClass', $classes, $cssClass );
Generated from Treweler Map Builder's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: