Skip to main content

benecaster_donor_wall_query_args

Filter Free Since v1.0.0

Fires immediately before ListenerSupportRepository::find() runs inside DonorWallShortcode::render(). Exposes the seven query parameters as a mutable associative array — return the array with any keys changed to alter the query.

Available keys: show_id (int), page (int), per_page (int), platform (string|null), date_from (string|null — ISO 8601 date), date_to (string|null — ISO 8601 date), orderby (string).

per_page flows into pagination. Overriding per_page here updates both the query and the “Page N of M” strip — the shortcode recomputes total pages from the effective value the filter returns, not from the raw shortcode attribute.

Branch on $show_id for per-show behavior. The filter fires for every shortcode instance. Return the args unchanged for shows that should use the default query, and apply your override only for the targeted show ID.

Scope the Donor Wall to Stripe Donations Only

Free

Restrict a public donor wall to Stripe-only donations, hiding link-mode reference rows that were logged manually, on a per-show basis.

<?php
add_filter( 'benecaster_donor_wall_query_args', function ( array $args, int $show_id ): array {
    // 42 = the show whose wall should be Stripe-only. All other shows keep
    // the default all-platforms behavior.
    if ( 42 !== $show_id ) {
        return $args;
    }
    $args['platform'] = 'stripe';
    return $args;
}, 10, 2 );

View on GitHub →

Parameters

Name Type Default Description
$args array Associative array of query parameters with keys: show_id, page, per_page, platform, date_from, date_to, orderby.
$show_id int WordPress post ID of the show being queried.

Returns: array

Examples

Restrict to Stripe donations on one show

add_filter( 'benecaster_donor_wall_query_args', function ( array $args, int $show_id ): array {
    if ( 42 !== $show_id ) {
        return $args;
    }
    $args['platform'] = 'stripe';
    return $args;
}, 10, 2 );

Override page size to 5 per page

add_filter( 'benecaster_donor_wall_query_args', function ( array $args, int $show_id ): array {
    $args['per_page'] = 5;
    return $args;
} );