Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created July 6, 2020 06:11
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/4edaae7e35876d7c1f5fb8955d410533 to your computer and use it in GitHub Desktop.
Save digitalchild/4edaae7e35876d7c1f5fb8955d410533 to your computer and use it in GitHub Desktop.
Make a social field required in WC Vendors settings form
// To make a field required for social media you will need to use the social settings id
// Hook with 'wcv_social_field_(socialfield id).
// In this example it is 'instagram'
add_filter( 'wcv_social_field_instagram', 'make_required' );
function make_required( $field ){
$field['custom_attributes'] = array( 'required' => '' );
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment