declaring product as select2 does not work
-
Hi, it appears that declaring product or department as a select2 field does not work in the ticket submit form:
function wpas_make_product_required( $custom_fields ) { if ( isset( $custom_fields['product'] ) ) { $custom_fields['product']['args']['required'] = true; $custom_fields['product']['args']['select2'] = true; } return $custom_fields; }To make it work you have to either declare first a custom field as select2, or use the following hack:
add_action( 'wp_enqueue_scripts', array( Awesome_Support::instance()->custom_fields, 'enqueue_select2_assets' ) );
The topic ‘declaring product as select2 does not work’ is closed to new replies.