term_id ) ) { $is_match = ( (int) $obj->term_id === (int) $args['value'] ); } } if ( 'is_not' === $args['operator'] ) { return ! $is_match; } return $is_match; } /** * Get UI options. * * @return array */ public function get_options_ui() { $categories = get_categories( [ 'hide_empty' => false ] ); $options = []; foreach ( $categories as $cat ) { $options[] = [ 'value' => $cat->term_id, 'label' => $cat->name, ]; } return [ 'type' => 'select', 'options' => $options, ]; } }