'name', 'order' => 'asc', ); $product_categories = get_terms( 'product_cat', $cat_args ); foreach ( $product_categories as $category ) { if ( ! empty( $category ) ) { $categories[ $category->term_id ] = array( 'label' => $category->name, 'id' => $category->term_id, ); } } return $categories; } public static function get_id() { return 'product_category_ids'; } public static function get_supported_filters() { return array( 'autocomplete' ); } public static function is_ajax_field() { return true; } public static function get_validators() { return array( 'required' ); } public static function get_field_value_type() { return static::TYPE_ARRAY; } }