AffiliateX icon
Ads & Monetisation

AffiliateX hooks reference

  • By WPCenter
  • v2.3.11
  • Updated

AffiliateX 2.3.11 has 4 actions and 16 filters, read directly from its source code on Nov 17, 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.

functions.phpyour child theme
// Run your own code when AffiliateX fires an action
add_action( 'affiliatex_free_loaded', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value AffiliateX is about to use
add_filter( 'affiliatex_post_for_stylesheet', function( $this_post ) {
	// Change $this_post here.
	return $this_post;
}, 10, 1 );

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

  • includes/classes/class-ab-fonts-manager.php line 172
    /**
     * Filters the post to build stylesheet for.
     */
    apply_filters( 'affiliatex_post_for_stylesheet', $this_post );
  • includes/traits/ButtonRenderTrait.php line 938 · used in 5 places
    apply_filters( 'affiliatex_button_url', esc_url( do_shortcode( $settings['buttonURL'] ) ) );
  • includes/classes/class-ab-fonts-manager.php line 752
    apply_filters_deprecated( 'ab_typography_google_fonts_source', array( null ), '1.3.9', 'affiliatex_typography_google_fonts_source', 'Please use affiliatex_typography_google_fonts_source instead.' );
  • includes/AffiliateXAdmin.php line 122
    apply_filters( 'affiliatex_admin_features', array() );
  • includes/functions/HelperFunctions.php line 76
    apply_filters( 'affiliatex_block_settings_defaults', array( 'buttons' => true, 'prosAndCons' => true, 'cta' => true, 'notice' => true, 'verdict' => true, 'singleProduct' => true, 'specifications' => true, 'versusLine' => true, 'singleProductProsAndCons' => true, 'productImageButton' => true, 'singleCoupon' => true, 'couponGrid' => true, 'productTabs' => true, 'couponListing' => true, 'topProducts' => true, 'versus' => true, 'productTable' => true... );
  • includes/functions/HelperFunctions.php line 118
    apply_filters( 'affiliatex_customization_settings_defaults', array( 'typography' => array( 'family' => 'Default', 'variation' => 'n4', 'size' => array( 'desktop' => '18px', 'mobile' => '18px', 'tablet' => '18px', ), 'line-height' => array( 'desktop' => '1.65', 'mobile' => '1.65', 'tablet' => '1.65', ), 'letter-spacing' => array( 'desktop' => '0em', 'mobile' => '0em', 'tablet' => '0em', ), 'text-transform' => 'none', 'text-decoration' => 'none', ), 'fontC... );
  • affiliatex.php line 88
    do_action( 'affiliatex_free_loaded' );
  • affiliatex.php line 60
    do_action( 'affiliatex_fs_loaded' );
  • includes/classes/class-ab-fonts-manager.php line 424
    apply_filters( 'affiliatex_get_block_css', $css, $name, $blockattr, $block_id );
  • includes/classes/class-ab-fonts-manager.php line 423
    apply_filters( 'affiliatex_get_block_fonts', $block_fonts, $name, $blockattr );
  • includes/notice/CampaignNotice.php line 109
    apply_filters( 'affiliatex_is_pro_install', false );
  • includes/broken-links/BrokenLinkAPI.php line 442
    do_action( 'affiliatex_scan_complete', $total );
  • includes/classes/class-ab-fonts-manager.php line 36
    apply_filters( 'affiliatex_typography_font_sources', array( 'system' => array( 'type' => 'system', 'families' => $this->get_system_fonts(), ), 'google' => array( 'type' => 'google', 'families' => $this->get_googgle_fonts(), ), ) );
  • includes/classes/class-ab-fonts-manager.php line 760
    apply_filters( 'affiliatex_typography_google_fonts_source', $maybe_custom_source );
  • includes/classes/class-ab-fonts-manager.php line 478
    apply_filters( 'affiliatex_typography_google_use_remote', true );
  • includes/AffiliateXWidgets.php line 40
    apply_filters( 'affiliatex_widgets_before_init', array( 'affiliatex/buttons' => ButtonWidget::class, 'affiliatex/cta' => CtaWidget::class, 'affiliatex/notice' => NoticeWidget::class, 'affiliatex/product-comparison' => ProductComparisonWidget::class, 'affiliatex/product-table' => ProductTableWidget::class, 'affiliatex/pros-and-cons' => ProsAndConsWidget::class, 'affiliatex/single-product' => SingleProductWidget::class, 'affiliatex/specificatio... );
  • includes/AffiliateX.php line 116
    do_action( 'before_affiliatex_init' );
  • includes/helpers/class-affiliatex-helpers.php line 364
    apply_filters( 'is_affiliatex_block', $affx_block );
  • plugin_locale

    filter
    includes/AffiliateX.php line 184
    apply_filters( 'plugin_locale', $locale, 'affiliatex' );
  • includes/helpers/class-affiliatex-helpers.php line 375
    apply_filters( 'post_has_affiliatex_items', self::is_affiliatex_block() || self::has_elementor_widgets() );

Generated from AffiliateX's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: