Discount Master exposes WordPress action and filter hooks so you can register custom discount logic, extend the admin UI, and customize how savings are shown, all without editing the plugin. Every hook uses the dmfwc_ prefix. This reference covers the hooks the plugin actually fires, with working examples.

Architecture in one line

The pricing engine builds two registries, actions and conditions, and fires additive hooks so extensions can register their own types. There is no REST API; admin operations run through a single admin-ajax.php endpoint (wp_ajax_admin_ajax_endpoint) with a nonce.

Registering custom action & condition types

These two actions are the main extension points. Each passes a registry object you call register() on with a handler that implements the matching interface.

HookTypeSignature
dmfwc_register_action_typesAction( DMFWC_Action_Registry $registry )
dmfwc_register_condition_typesAction( DMFWC_Condition_Registry $registry )
add_action( 'dmfwc_register_action_types', function ( $registry ) {
    // My_Custom_Action implements the plugin's action handler interface.
    $registry->register( new My_Custom_Action() );
} );

Admin UI hooks

HookTypePurpose
dmfwc_menu_pagesFilter( array $menu_pages ) — the admin menu page definitions.
dmfwc_menu_itemsFilter( array $menu_items ) — the header tab navigation.
dmfwc_render_field_argsFilter( array $args ) — merged args before any field partial renders.
dmfwc_discount_table_actionsFilter( array $actions, array $discount_actions, array $discount_meta ) — per-row buttons in the Discounts table.
dmfwc_before_fields_actions / dmfwc_after_fields_actionsActionRender markup before/after the Actions fields.
dmfwc_before_fields_conditions / dmfwc_after_fields_conditionsActionRender markup before/after the Conditions fields.
dmfwc_before_actions_repeaterActionRender markup before the Actions repeater.
// Append a custom tab to the Discount Master header navigation.
add_filter( 'dmfwc_menu_items', function ( $menu_items ) {
    $menu_items['my-reports'] = array(
        'label' => __( 'Reports', 'my-plugin' ),
        'url'   => admin_url( 'admin.php?page=dmfwc-my-reports' ),
    );
    return $menu_items;
} );

Pricing & display hooks

HookTypeSignature & purpose
dmfwc_discount_action_labelFilter( string $label, array $discount, string $scope )
The human-readable label used for an applied discount (e.g. the cart-item “Discount: …” line).
dmfwc_you_saved_custom_textFilter( float $you_saved )
The savings amount used in the “You Saved” output.
dmfwc_cart_shipping_discount_applied ProAction( array $discount, WC_Cart $cart )
Fires after a shipping discount is applied to the package rates.
dmfwc_pro_cart_totals_after_order_total_amount ProFilter( float $you_saved )
The savings figure shown after the order total.
dmfwc_pro_sales_flash_price_decimals ProFilter( int $decimals )
Decimal places used in the sale-flash price.
// Cap the displayed "You Saved" amount at 50.00.
add_filter( 'dmfwc_you_saved_custom_text', function ( $you_saved ) {
    return min( (float) $you_saved, 50.00 );
} );
Match the hook you actually see

Hook availability can change between plugin versions, and some older third-party references list hooks that are not present in the current build. The hooks above are the ones fired by Discount Master 2.0.0 (free) and Pro 1.1.1. If a hook does not fire on your version, confirm the plugin version and the exact hook name in the source before relying on it.