WC_Product_Attribute::get_slugs PHP 메소드

get_slugs() 공개 메소드

Gets slugs from the stored options, or just the string if text based.
public get_slugs ( ) : array
리턴 array
    public function get_slugs()
    {
        if (!$this->is_taxonomy() || !taxonomy_exists($this->get_name())) {
            return $this->get_options();
        }
        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->slug;
            }
        }
        return $terms;
    }