Created
September 20, 2014 19:24
-
-
Save JustinSainton/ccf7a7bee6e9fe005e6c to your computer and use it in GitHub Desktop.
Hide test gateway if a user is not an admin
This file contains hidden or 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( 'option_custom_gateway_options', 'js_gateway_options' ); | |
| function js_gateway_options( $gateways ) { | |
| if ( in_array( 'wpsc_merchant_testmode', $gateways ) && ! current_user_can( 'manage_options' ) ) { | |
| unset( $gateways[ array_search( 'wpsc_merchant_testmode', $gateways ) ] ); | |
| } | |
| return $gateways; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment