List and Usage Guide for Filters in Init User Engine

The Init User Engine plugin offers a rich set of filters that allow developers to customize various aspects of the user system — including check-ins, rewards, VIP pricing, inbox content, and more. This article provides a complete list of available filters, along with their usage and real code examples.

List and Usage Guide for Filters in Init User Engine

1. init_plugin_suite_user_engine_online_minutes

Modify how many minutes a user must stay online after checking in to receive a reward.

// Reduce time if user is admin
add_filter( 'init_plugin_suite_user_engine_online_minutes', function( $minutes, $user_id, $is_vip ) {
    if ( user_can( $user_id, 'manage_options' ) ) {
        return 3;
    }
    return $minutes;
}, 10, 3 );

2. init_plugin_suite_user_engine_vip_prices

Override the VIP package prices displayed on the frontend.

// Increase VIP Lifetime package price
add_filter( 'init_plugin_suite_user_engine_vip_prices', function( $prices ) {
    $prices['vip_price_6'] = 2000000;
    return $prices;
});

3. init_plugin_suite_user_engine_referral_rewards

Customize referral rewards for both the referrer and the invited user.

// Give referrer 200 coins and invitee 100 EXP
add_filter( 'init_plugin_suite_user_engine_referral_rewards', function( $rewards ) {
    $rewards['ref_reward_coin'] = 200;
    $rewards['ref_new_exp']     = 100;
    return $rewards;
});

4. init_plugin_suite_user_engine_localized_data

Modify the InitUserEngineData object sent to the frontend.

// Add username to JS data
add_filter( 'init_plugin_suite_user_engine_localized_data', function( $data, $user_id ) {
    $user = get_userdata( $user_id );
    $data['username'] = $user->user_login;
    return $data;
}, 10, 2 );

5. init_plugin_suite_user_engine_calculated_coin_amount

Modify the number of coins granted before it is processed.

// Double coin reward on Sundays
add_filter( 'init_plugin_suite_user_engine_calculated_coin_amount', function( $amount, $user_id ) {
    if ( date( 'w' ) == 0 ) {
        return $amount * 2;
    }
    return $amount;
}, 10, 2 );

6. init_plugin_suite_user_engine_calculated_exp_amount

Modify the amount of EXP granted before it is processed.

// Reduce EXP for contributors
add_filter( 'init_plugin_suite_user_engine_calculated_exp_amount', function( $exp, $user_id ) {
    $user = get_userdata( $user_id );
    if ( in_array( 'contributor', $user->roles ) ) {
        return $exp * 0.5;
    }
    return $exp;
}, 10, 2 );

7. init_plugin_suite_user_engine_exp_required

Customize the formula to calculate how much EXP is required to level up.

// Make each level require 1000 EXP
add_filter( 'init_plugin_suite_user_engine_exp_required', function( $required, $level ) {
    return 1000 + ( $level - 1 ) * 1000;
}, 10, 2 );

8. init_plugin_suite_user_engine_checkin_milestones

Define which check-in streak days grant bonus rewards.

// Add milestones on day 3 and day 100
add_filter( 'init_plugin_suite_user_engine_checkin_milestones', function( $milestones ) {
    $milestones[] = 3;
    $milestones[] = 100;
    return $milestones;
});

9. init_plugin_suite_user_engine_format_inbox

Customize inbox data before returning it via REST API.

// Add a short title to each message
add_filter( 'init_plugin_suite_user_engine_format_inbox', function( $formatted, $raw ) {
    $formatted['short_title'] = wp_trim_words( $raw['title'], 5 );
    return $formatted;
}, 10, 2 );

10. init_plugin_suite_user_engine_render_level_badge

Override the HTML for user level badges.

// Add star icon before badge
add_filter( 'init_plugin_suite_user_engine_render_level_badge', function( $html, $level, $rank ) {
    return '<span class="iue-icon-star"></span>' . $html;
}, 10, 3 );

11. init_plugin_suite_user_engine_inbox_insert_data

Customize inbox data before saving to the database.

// Add metadata if type is "event"
add_filter( 'init_plugin_suite_user_engine_inbox_insert_data', function( $data, $user_id ) {
    if ( $data['type'] === 'event' ) {
        $data['metadata'] = maybe_serialize( [ 'from' => 'system' ] );
    }
    return $data;
}, 10, 2 );

12. init_plugin_suite_user_engine_vip_expire_soon_threshold

Allows you to customize the time window (in seconds) used to determine when a VIP status is considered “close to expiration”. The default value is 1 day (DAY_IN_SECONDS).

// Treat VIP as expiring soon when less than 3 days remain
add_filter(
    'init_plugin_suite_user_engine_vip_expire_soon_threshold',
    function( $seconds, $user_id, $expire ) {
        return 3 * DAY_IN_SECONDS;
    },
    10,
    3
);

This filter is typically used to fine-tune renewal reminders or time-based promotions.

13. init_plugin_suite_user_engine_body_vip_classes

Allows developers to add, modify, or remove VIP-related CSS classes applied to the <body> element. Useful for extending UI logic or integrating with themes and third-party plugins.

// Add a custom class for users who have ever purchased VIP
add_filter(
    'init_plugin_suite_user_engine_body_vip_classes',
    function( $classes, $user_id, $expire ) {
        if ( in_array( 'iue-vip-expired', $classes, true ) ) {
            $classes[] = 'iue-vip-ever';
        }
        return $classes;
    },
    10,
    3
);

This filter acts as a bridge between VIP business logic and the presentation layer (HTML/CSS).

Conclusion

The filter system in Init User Engine is built for flexibility and power. With just a few lines of code, you can adjust everything from logic and rewards to how data is displayed or saved — making your user experience as custom as you want without editing the core plugin files.

Comments


  • No comments yet.

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login