pixelgrade / customify

Intuitive Website Styling integrated into WordPress' Customizer
GNU General Public License v2.0
28 stars 5 forks source link

Select for woocommerce category #89

Closed kinolanka closed 7 years ago

kinolanka commented 7 years ago

I need user to choose some of woocommerce category so I create select field this way:

$args = array(
            'taxonomy' => 'product_cat',
            'hide_empty' => false,
                        'fields' => 'id=>name',
            );
$cats_arr = get_terms( $args );

...

"woo_cat" => array(
                    'type'    => 'select',
                    'label'   => __( 'Woo category' ),
                    'choices' => $cats_arr
);

But WP_Error occured: invalid taxonomy.

andreilupu commented 7 years ago

Hi, I'm sorry for missing this issue for such a long time!

I don't think this is a Customify issue. From what I can see this is a problem with the core function get_terms and the only advice that I have for you is to check that the taxonomy really exists.