Last active
July 19, 2023 12:27
-
-
Save remcotolsma/4f8d38655ac63f4b29e18c4e78a54e41 to your computer and use it in GitHub Desktop.
Customize order of Restrict Content Pro gateways.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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