Skip to content

Developer Hooks

ASA2 exposes a small set of WordPress actions and filters that add-ons and custom code can hook into. This page lists the hooks that are part of ASA2's public API — they will not change without a release note.

Actions

asa2_product_edit_after_fields

Fires on the product edit screen after all core ASA2 product fields have been rendered. Use this to inject your own meta-box-like content below the core fields without monkey-patching the edit page.

  • Available since: ASA2 1.33.0
  • Arguments: WP_Post $post — the current product post
  • Note: This hook does not fire on the create-new page, only when editing a previously saved product.
php
add_action('asa2_product_edit_after_fields', function (\WP_Post $post) {
    echo '<div class="asa2-gridbox"><div class="asa2-gridbox-content">';
    echo '<h3>My add-on panel</h3>';
    echo '<p>Custom UI for product ID ' . (int) $post->ID . '</p>';
    echo '</div></div>';
});

ASA2 - The Amazon Affiliate Plugin for WordPress