Created
January 26, 2016 06:34
-
-
Save digitalchild/0e1675371c4dcbe88deb to your computer and use it in GitHub Desktop.
How to make a field required in WC Vendors 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 | |
// The first thing you need to do is find the filter for the field you want to adjust the requirements | |
// You can find the filters in public/forms/class-wcvendors-pro-product-form.php | |
// You will need one of these for each field you'd like to make required. | |
function make_required_fieldname( $args ) { | |
$args[ 'custom_attributes' ] => array( | |
'data-rules' => 'required', | |
'data-error' => __( 'This field is required.', 'wcvendors-pro' ) | |
); | |
} | |
// Using description as an example | |
add_filter( 'wcv_product_description, 'make_required_fieldname' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment