Last active
February 21, 2018 12:48
-
-
Save julien731/a519956ce9c81542439c to your computer and use it in GitHub Desktop.
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
add_filter( 'wpas_get_custom_fields', 'wpas_make_product_required' ); | |
/** | |
* Make the products field required | |
* | |
* @param array $custom_fields Registered custom fields | |
* | |
* @return array | |
*/ | |
function wpas_make_product_required( $custom_fields ) { | |
if ( isset( $custom_fields['product'] ) ) { | |
$custom_fields['product']['args']['required'] = true; | |
} | |
return $custom_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment