Created
November 25, 2017 01:44
-
-
Save fervous/b1e49ee04b86e20cbcc64a5c56c5f396 to your computer and use it in GitHub Desktop.
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
/* WC Vendors Pro - My Custom Field */ | |
add_action( 'wcvendors_settings_after_shop_description', 'store_bank_details', 9,2 ); | |
function store_bank_details( ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
$key = '_wcv_custom_settings_bankname'; | |
$value = get_user_meta( get_current_user_id(), $key, true ); | |
// Bank Name | |
WCVendors_Pro_Form_Helper::input( array( | |
'id' => $key, | |
'label' => __( 'Total Staff Members', 'wcvendors-pro' ), | |
'placeholder' => __( 'Staff Members at your Company, including yourself', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'Number of Staff Members at your Company, including yourself', 'wcvendors-pro' ), | |
'type' => 'text', | |
'value' => $value, | |
) | |
); | |
} | |
} | |
add_action( 'wcvendors_admin_after_commission_due', 'wcv_store_bank_details_admin' ); | |
function wcv_store_bank_details_admin( $user ) { | |
?> | |
<tr> | |
<th><label for="_wcv_custom_settings_bankname"><?php _e( 'Number of Staff Members', 'wcvendors-pro' ); ?></label></th> | |
<td><input type="text" name="_wcv_custom_settings_bankname" id="_wcv_custom_settings_bankname" value="<?php echo get_user_meta( $user->ID, '_wcv_custom_settings_bankname', true ); ?>" class="regular-text"></td> | |
</tr> | |
<?php | |
} | |
/* WC Vendors Pro - My Custom Field */ | |
add_action( 'wcvendors_settings_after_shop_description', 'store_franchise_details',10,2 ); | |
function store_franchise_details( ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
$key = '_wcv_custom_settings_franchise'; | |
$value = get_user_meta( get_current_user_id(), $key, true ); | |
// franchise Name | |
WCVendors_Pro_Form_Helper::input( array( | |
'id' => $key, | |
'label' => __( 'Is your Company a Franchise?', 'wcvendors-pro' ), | |
'placeholder' => __( 'Yes or No', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'Tell us if your Company is a Franchise', 'wcvendors-pro' ), | |
'type' => 'text', | |
'value' => $value, | |
) | |
); | |
} | |
} | |
add_action( 'wcvendors_admin_after_commission_due', 'wcv_store_franchise_details_admin' ); | |
function wcv_store_franchise_details_admin( $user ) { | |
?> | |
<tr> | |
<th><label for="_wcv_custom_settings_franchise"><?php _e( 'Franchise? (Y/N)', 'wcvendors-pro' ); ?></label></th> | |
<td><input type="text" name="_wcv_custom_settings_franchise" id="_wcv_custom_settings_franchise" value="<?php echo get_user_meta( $user->ID, '_wcv_custom_settings_franchise', true ); ?>" class="regular-text"></td> | |
</tr> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment