Skip to content

Filters and actions

Every extension point the plugin exposes, all prefixed wcmp_. Filters change a value the plugin computes; return the (possibly modified) first argument. Actions inject or replace markup in the front-end menu.

Filter Passed What it does
wcmp_is_my_account_page bool $is_myaccount Override whether the current request is treated as the My Account page.
wcmp_get_current_endpoint string $current Override which endpoint slug is treated as the active tab.
wcmp_my_account_have_menu bool $have_menu Override whether the custom menu renders in place of WooCommerce’s default navigation.
wcmp_default_endpoint string $default_endpoint Override the endpoint a visitor lands on by default.
wcmp_no_redirect_to_default bool $no_redirect (default false) Return true to switch off the default-endpoint redirect entirely.
Filter Passed What it does
wcmp_get_endpoint_by_accepted_key array $keys (default ['key','slug']) Change which option keys wcmp_get_endpoint_by() is allowed to match against.
wcmp_get_endpoint_by_result array $find Filter the matched endpoint before it is returned.
Filter Passed What it does
wcmp_default_endpoints_settings array $endpoints Amend the endpoint set seeded from the WooCommerce account menu.
wcmp_default_general_settings array $settings Amend the default General settings (avatar toggle, menu layout, sidebar position, default endpoint).
wcmp_default_style_settings array $settings Amend the default Style colour values.
wcmp_get_default_endpoint_options array $options Amend the option shape for a newly added endpoint.
wcmp_get_default_group_options array $options Amend the option shape for a newly added group.
wcmp_get_default_link_options array $options Amend the option shape for a newly added link.
Filter Passed What it does
wcmp_endpoint_anchor_tag_class string $class (default wcmp-{endpoint}) Filter the CSS class on a menu item’s anchor tag.
wcmp_endpoint_menu_class array $classes, string $endpoint, array $options Filter the CSS classes on a single endpoint’s list item.
wcmp_endpoints_group_class array $classes, string $endpoint, array $options Filter the CSS classes on a group’s list item.
wcmp_filter_avatar_size int $size (default 120) Change the avatar size in pixels shown in the menu header.
wcmp_filter_display_name string $display_name Change the member name shown in the menu header.
wcmp_myaccount_menu_template_args array $args Filter the args passed to the menu wrapper template (endpoints, my_account_url, avatar).
wcmp_print_single_endpoint_args array $args Filter the args passed to a single menu-item template (url, endpoint, options, classes).
wcmp_print_endpoints_group_group array $args Filter the args passed to a group template (endpoint, options, classes, class_icon).
Filter Passed What it does
wcmp_load_public_assets bool $load (default false) Return true to force the portal’s CSS and JS onto a surface auto-detection misses.
wcmp_get_custom_css string $inline_css Amend the inline style-token CSS the plugin prints on the account page.
wcmp_get_avatar_filter bool $suppress Return true to suppress this plugin’s uploaded avatar for the request. Default mirrors the Member avatar upload setting, so this is the seam for handing avatar rendering to another source.
Filter Passed What it does
wcmp_dashboard_shortcode_template string $template_name (default myaccount/dashboard.php) Override the WooCommerce template rendered by the [default_dashboard_content] shortcode.
Filter Passed What it does
wcmp_admin_print_endpoint_field array $args Amend the template args for an endpoint row in the admin builder.
wcmp_admin_print_endpoints_group array $args Amend the template args for a group row in the admin builder.
wcmp_admin_print_link_field array $args Amend the template args for a link row in the admin builder.

These fire while public/templates/wcmp-myaccount-menu.php renders. The two render actions have a default callback at priority 10 that outputs the item or group template; remove_action them if you want to replace that markup rather than add to it.

Action Passed When it fires
wcmp_before_endpoints_menu none Before the entire menu wrapper.
wcmp_before_endpoints_items none Before the list of menu items.
wcmp_print_endpoints_group string $endpoint, array $options To render one group and its children. Default callback prints the group template.
wcmp_print_single_endpoint string $endpoint, array $options To render one endpoint or link item. Default callback prints the item template. Also fired per child inside a group.
wcmp_after_endpoints_items none After the list of menu items.
wcmp_after_endpoints_menu none After the entire menu wrapper.