Advertisement
SiamKreative

Awesome Support - How to enable Select2 on select dropdowns?

May 18th, 2016
15,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. add_filter( 'wpas_get_custom_fields', 'wpas_products_dropdown_select2', 10, 1 );
  2. /**
  3.  * Enable Select2 for the "Products" dropdown
  4.  *
  5.  * @param array $fields Registered custom fields
  6.  * @return array
  7.  */
  8. function wpas_products_dropdown_select2( $fields ) {
  9.     if ( isset( $fields['product'] ) ) {
  10.         $fields['product']['args']['select2'] = true;
  11.     }
  12.     return $fields;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement