Forum: Bug Reports

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

Taxonomy checkboxes in premium verson

Forums Bug Reports Taxonomy checkboxes in premium verson

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29848
    cschell
    Member

    I found a bug when activating checkboxes instead of dropdowns for taxonomies in the premium version. In the functions file the labels and input fields for each term are set to display the taxonomy name instead of the term name in both the ID and name. Currently it looks like this:

    <code>

    function custom_taxonomy_checkboxes($tax_name) {

    $get_tax = false;

    if (isset($_GET[$tax_name])) $get_tax = $_GET[$tax_name];

    $terms = get_terms($tax_name);

    foreach ($terms as $term) {

    echo ‘<label for=”‘ . $tax_name . ‘_id”><input type=”checkbox” name=”‘ .$tax_name .'[]” id=”‘ . $tax_name . ‘_id” value=”‘. $term->term_id . ‘” ‘; if( isset($get_tax) && !empty($get_tax) && in_array($term->term_id, $get_tax) ) echo ‘checked=”checked”‘; echo ‘  >’ . $term->name . ‘</label>’;

    }

    }

    </code>

    It should read:

    <code>function custom_taxonomy_checkboxes($tax_name) {

    $get_tax = false;

    if (isset($_GET[$tax_name])) $get_tax = $_GET[$tax_name];

    $terms = get_terms($tax_name);

    foreach ($terms as $term) {

    echo ‘<label for=”‘ . $term->name . ‘_id”><input type=”checkbox” name=”‘ .$term->name .'[]” id=”‘ . $term->name . ‘_id” value=”‘. $term->term_id . ‘” ‘; if( isset($get_tax) && !empty($get_tax) && in_array($term->term_id, $get_tax) ) echo ‘checked=”checked”‘; echo ‘  >’ . $term->name . ‘</label>’;

    }

    }

    </code>

    <code>$term-> name</code> should be put in place of <code>$tax_name</code>

    #29849

    You are right.

    I changed the label for and the Id to:

    $term->name.’_’.$tax_name

    just to prevent issues if users have same term names in different taxonomies.

    Thank you

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.