Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created September 14, 2020 05:57
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 digitalchild/92084f56cd4656628ac12059c5b0c14f to your computer and use it in GitHub Desktop.
Save digitalchild/92084f56cd4656628ac12059c5b0c14f to your computer and use it in GitHub Desktop.
Set a max length for the store name with 2 custom messages for WC Vendors Pro
<?php
add_filter( 'wcv_vendor_store_name', 'wcv_vendor_store_name_limit' );
function wcv_vendor_store_name_limit( $field ){
$field['custom_attributes'] = array(
'required' => '',
'data-parsley-required-message' => __( 'Store Name is required', 'wcvendors-pro' ),
'max' => '7',
'data-parsley-max-message' => __( 'Store Name max length 7', 'wcvendors-pro' ),
);
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment