Last active
February 4, 2020 21:24
-
-
Save fervous/10c51c81f7a37f2c30621278a406e11d to your computer and use it in GitHub Desktop.
change title required max length and message wc vendors pro product add edit form
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 Change title Length Req. on Product Page */ | |
add_filter('wcv_product_title', 'wcv_product_title_req'); | |
function wcv_product_title_req( $args ){ | |
$args['custom_attributes']['data-rules'] = 'required|max_length[200]'; | |
return $args; | |
} | |
/* WC Vendors Pro Change title Length Req. Message on Product Page */ | |
add_filter('wcv_product_title', 'wcv_product_title_req_error'); | |
function wcv_product_title_req_error( $args ){ | |
$args['custom_attributes']['data-error'] = 'Product name is required, and must be under 200 characters.'; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if it is possible to display the character counter in the field? Can you send the code? Please and thanks for your attention.