Created
July 6, 2020 06:11
-
-
Save digitalchild/4edaae7e35876d7c1f5fb8955d410533 to your computer and use it in GitHub Desktop.
Make a social field required in WC Vendors settings 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
// 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