Filter
rpress_accepted_payment_{$card}_image
On this page
Filters the image URL used for an accepted payment card icon.
The dynamic part is the card name in lowercase with spaces removed, for example visa or americanexpress. The filter is used both on the Accepted Cards setting screen and in the checkout payment icons. It is only applied when at least one callback is attached for that card; otherwise the icon is resolved from the plugin's images/icons template folder. The value starts as an empty string and should be returned as a full image URL.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$image | string | Image URL. Empty string by default. |
Return value#
string. The URL of the card icon image.
Example#
function my_visa_icon( $image ) {
return plugins_url( 'images/visa.png', __FILE__ );
}
add_filter( 'rpress_accepted_payment_visa_image', 'my_visa_icon' );
Notes#
Fired from the Accepted Cards setting field and from the checkout payment icons. Because the code checks has_filter() first, attaching any callback replaces the default icon lookup entirely.
Source#
Applied in:
includes/admin/settings/register-settings.php(line 2475), inrpress_payment_icons_callback()includes/checkout/template.php(line 902), inrpress_show_payment_icons()
