Skip to main content

Add a “Need help?” support link above the feed URL section on the account page

Free Beginner Since v1.0.0

Use the per-section before/after hooks to inject contextual help content, notices, or UI elements around a specific account section without touching the template file. The hook fires with ( int $show_id, int $user_id ). Analogous hooks exist for every built-in section: benecaster_before_account_subscription, benecaster_after_account_qr_code, etc.

Code

<?php
add_action( 'benecaster_before_account_feed_url', function ( int $show_id, int $user_id ): void {
    echo '<p class="my-support-note">';
    printf(
        /* translators: %s: link to support page */
        esc_html__( 'Having trouble? %s', 'my-addon' ),
        '<a href="' . esc_url( get_permalink( get_page_by_path( 'support' ) ) ) . '">'
        . esc_html__( 'Visit our support centre', 'my-addon' )
        . '</a>'
    );
    echo '</p>';
}, 10, 2 );

View on GitHub →

Hooks Used