Skip to content

Instantly share code, notes, and snippets.

@fervous
Created September 3, 2016 14:07
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/badc146c8967781e36e154b68a4609e5 to your computer and use it in GitHub Desktop.
Save fervous/badc146c8967781e36e154b68a4609e5 to your computer and use it in GitHub Desktop.
require price
/* PRICE REQUIRED */
function wcv_product_price_required( $args ) {
$args[ 'custom_attributes' ] = array(
'data-rules' => 'required',
'data-error' => __( 'The price field is required- please add a price for your product.', 'wcvendors-pro' )
);
return $args;
}
add_filter( 'wcv_product_price', 'wcv_product_price_required' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment