Created
November 17, 2015 06:48
-
-
Save digitalchild/9fe913cd140931a0cc6b to your computer and use it in GitHub Desktop.
Add a custom field to the store settings page for WCVendors Pro
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 | |
// Put this into your themes function.php | |
/** | |
* Create a custom field for the store settings page to output a bank name. | |
*/ | |
function store_bank_details( $store_id ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
// Bank Name | |
WCVendors_Pro_Form_Helper::input( array( | |
'post_id' => $store_id, | |
'id' => '_wcv_custom_settings_bankname', | |
'label' => __( 'Bank Name', 'wcvendors-pro' ), | |
'placeholder' => __( 'First Bank', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'Your local bank name', 'wcvendors-pro' ), | |
'type' => 'text', | |
) | |
); | |
} | |
} | |
?> | |
<?php // Add the following on the store-settings.php template ?> | |
<?php store_bank_details( $store_id ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, something important to mention here:
The right action name to hook into this is
wcv_pro_store_settings_saved
because the actionwcvendors_shop_settings_saved
described in the doc from this gist doesn't work for the PRO plugin.Usage:
Thanks