Hooks & Filters

Using WordPress Hooks in Influenzic

How Influenzic’s action and filter hooks work, where to add them, and priority best practices.

Influenzic exposes WordPress action and filter hooks throughout its codebase following standard WordPress conventions. This means you can modify virtually any platform behaviour without editing plugin core files. All Influenzic hook names use the inzc_ prefix.

Actions vs Filters

  • Actions (add_action) — run your code at a specific point in the execution flow. Return value is ignored.
  • Filters (add_filter) — modify a value before it is used. You must return the value.
// Action: run code when a project is created
add_action( 'inzc_project_created', function( $project_id, $campaign_id, $user_id ) {
    error_log( 'Project created: ' . $project_id );
}, 10, 3 );

// Filter: modify the platform commission rate
add_filter( 'inzc_get_commission_pct', function( float $rate ): float {
    // Zero commission for the first 30 days (launch promotion)
    $diff = ( time() - (int) get_option( 'inzc_launch_timestamp', time() ) ) / DAY_IN_SECONDS;
    return $diff <= 30 ? 0.0 : $rate;
} );

Where to Add Hooks

Add your hooks in one of these locations — never edit plugin core files:

  • A custom plugin — recommended; hooks survive theme changes and can be version-controlled independently
  • Child theme functions.php — acceptable for small site-level tweaks
  • A mu-plugins file — for hooks that must run before all plugins on every request

Priority

The third argument to add_action/add_filter is the priority (default 10). Lower numbers run earlier. Use priority > 10 to run after Influenzic’s own internal hooks on the same action; use priority < 10 to run before.

Key Action Hooks

Hook Args Fires When
inzc_project_created $project_id, $campaign_id, $influencer_id New project row inserted
inzc_project_completed $project_id, $project Project reaches completed status
inzc_dispute_opened $resolution_id, $project_id Dispute case created
inzc_dispute_resolved $resolution_id, $decision Admin resolves a dispute
inzc_review_submitted $reviewee_id, $rating, $reviewer_role A review is saved
inzc_quality_score_updated $user_id, $display_score, $creator_level After every QS recalculation
inzc_post_url_submitted $project_id, $project, $post_url, $is_repost Influencer submits a live post URL
inzc_invitation_expired $invitation_id Invitation passes its deadline

Key Filter Hooks

Hook Default Purpose
inzc_payment_gateways Built-in descriptors array Register additional payment gateways
inzc_get_commission_pct 20.0 Override the platform commission percentage
inzc_get_processing_fee_pct 7.0 Override the checkout processing fee percentage
inzc_calculate_order_totals Array of subtotal/fee/total Override full order total calculation
inzc_dm_daily_limit 25 Override the brand daily DM thread creation limit
inzc_post_monitor_max_per_cron_run 50 Override max projects checked per cron pass

Was this article helpful?