Last active
December 21, 2015 08:05
-
-
Save wpweb101/99df374ba1273ee350d9 to your computer and use it in GitHub Desktop.
Add / Remove tabs for voucher codes listing at wp admin side
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 | |
| /** | |
| * | |
| * You can add or remove tab using this filter | |
| */ | |
| add_filter( 'woo_vou_admin_voucher_code_tabs', 'woo_vou_admin_voucher_code_custom_tabs' ); | |
| function woo_vou_admin_voucher_code_custom_tabs( $voucher_code_tabs ) { | |
| if( !empty( $voucher_code_tabs['purchased'] ) ) { // For remove purchased voucher codes tab | |
| unset( $voucher_code_tabs['purchased'] ); | |
| } | |
| if( !empty( $voucher_code_tabs['expired'] ) ) { // For remove expired voucher codes tab | |
| unset( $voucher_code_tabs['expired'] ); | |
| } | |
| // if you want to add new custom tab | |
| $voucher_code_tabs['custom_voucher'] = array( | |
| 'name' => __( 'Custom Voucher Codes', 'woovoucher' ), | |
| 'path' => 'full/directory/path/to/file' | |
| ); | |
| return $voucher_code_tabs; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment