• Hi, I’m using wp_dropdown_categories in a form but it only returns ID.
    I dont want IDs, I want names.

    $args = array(
            'taxonomy' => 'product_category',
            'hide_empty' => '0',
            'orderby' => 'id',
            'show_count' => '0',
            'pad_counts' => '0',
            'order' => 'desc',
            'hierarchical' => '1',
            'selected' => '0',
            'name' => $name,
            'show_option_none' => $select,
            'class' => 'postform'
        );
        wp_dropdown_categories($args);

    What’s wrong with my code?

Viewing 1 replies (of 1 total)
  • Thread Starter Sina Saeedi

    (@melodymag)

    Actually when I press “Submit”, it returns this:

    Array ( [product_1] => 7 [vahed_1] => Ton [vazn_1] => 12
    [product_2] => 10 [vahed_2] => Boshke [vazn_2] => 13
    [product_3] => 4 [vahed_3] => Kilo [vazn_3] => 14
    [product_4] => 11 [vahed_4] => Ton [vazn_4] => 15
    [product_5] => -1 [vahed_5] => [vazn_5] =>
    [submit-order-form] => Submit Order )

    [product_1] => 7
    [product_2] => 10
    [product_3] => 4
    [product_4] => 11
    [product_5] => -1

    I don’t need these taxonomy IDs, I want taxonomy names. Like this:
    [product_1] => Polyester
    [product_2] => Polyester n. 56
    [product_3] => Polyester n. 12
    [product_4] => Polyester n. 67
    [product_5] => None

    [No bumping. If it’s that urgent, consider hiring someone.]

Viewing 1 replies (of 1 total)
  • The topic ‘wp_dropdown_categories returns ID’ is closed to new replies.