WordPress.org

Ready to get started?Download WordPress

Forums

Urlencode problem when querying taxonomy groups (1 post)

  1. vk011
    Member
    Posted 7 months ago #

    I made a dynamic "list" of checkboxes based on custom taxonomies (from POST type.

    foreach ($terms as $term) {
        $term_name = $term->name;
        echo "<p><input type=\"checkbox\" name=\"{$tax_name_cb}[]\" value=\"$term_name\" id=\"$term_name\" /><label for=\"$term_name\"> $cv2</label></p>";
    }

    The problem is that whenever I do a search, i get the following warning: Warning: urlencode() expects parameter 1 to be string, array given . The funny thing is, I DON'T get this warning when querying a custom post type the same way!

    Anyway, if I for example change $tax_name_cb}[]\ to $tax_name_cb}\ I don't get the warning, but then obviously I can't search thru multiple checkbox groups.

Reply

You must log in to post.

About this Topic