Skip to content

Instantly share code, notes, and snippets.

@wpweb101
Last active December 21, 2015 08:05
Show Gist options
  • Select an option

  • Save wpweb101/99df374ba1273ee350d9 to your computer and use it in GitHub Desktop.

Select an option

Save wpweb101/99df374ba1273ee350d9 to your computer and use it in GitHub Desktop.
Add / Remove tabs for voucher codes listing at wp admin side
<?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