WC_Product_Attribute::get_terms PHP Method

get_terms() public method

Gets terms from the stored options.
public get_terms ( ) : array | null
return array | null
    public function get_terms()
    {
        if (!$this->is_taxonomy() || !taxonomy_exists($this->get_name())) {
            return null;
        }
        foreach ($this->get_options() as $option) {
            if (is_int($option)) {
                $term = get_term_by('id', $option, $this->get_name());
            } else {
                $term = get_term_by('name', $option, $this->get_name());
            }
            if ($term && !is_wp_error($term)) {
                $terms[] = $term;
            }
        }
        return $terms;
    }