Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active February 4, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervous/10c51c81f7a37f2c30621278a406e11d to your computer and use it in GitHub Desktop.
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
/* 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;
}
@virtualmaquinas
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment