Skip to content
Docs
Get RestroPress

Filter

rpress_accepted_payment_{$slug}_image

Updated
On this page

Filters the image URL of an accepted payment card icon.

Runs in rpress_get_accepted_card_icon_urls() for each card configured in the accepted cards setting, but only when a callback is hooked to the filter. The dynamic part is the card name lowercased with spaces removed, for example visa or americanexpress. When a callback exists, it replaces the bundled icon lookup, so it must return the image URL.

Parameters#

ParameterTypeDescription
$imagestringEmpty string; the filter supplies the icon URL.

Return value#

string. URL of the card icon image.

Example#

function my_visa_icon( $image ) {
	return 'https://example.com/icons/visa.svg';
}
add_filter( 'rpress_accepted_payment_visa_image', 'my_visa_icon', 10, 1 );

Notes#

Cards whose configured key is already an image URL skip this filter.

Source#

Applied in:

  • includes/checkout/template.php (line 947), in rpress_get_accepted_card_icon_urls()
Was this page helpful?