Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Last active July 19, 2023 12:27
Show Gist options
  • Save remcotolsma/4f8d38655ac63f4b29e18c4e78a54e41 to your computer and use it in GitHub Desktop.
Save remcotolsma/4f8d38655ac63f4b29e18c4e78a54e41 to your computer and use it in GitHub Desktop.
Customize order of Restrict Content Pro gateways.
<?php
add_filter(
'rcp_payment_gateways',
function( $gateways ) {
$order = [
'pronamic_pay_credit_card' => 0,
'pronamic_pay_direct_debit' => 1,
];
foreach ( $gateways as $key => $data ) {
$gateways[ $key ]['order'] = array_key_exists( $key, $order ) ? $order[ $key ] : PHP_INT_MAX;
}
uasort(
$gateways,
function( $a, $b ) {
return $a['order'] <=> $b['order'];
}
);
return $gateways;
},
100
);
#rcp_payment_gateways {
display: flex;
flex-direction: column;
}
#rcp_payment_gateways label[for="rcp_gateway_pronamic_pay_credit_card"] {
order: 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment