Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/06/2012, 10:06
Avatar de AlZuwaga
AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 23 años, 3 meses
Puntos: 535
Respuesta: Arbol de términos personalizado

Ya, resuelto con una función que encontré en stackexchange:
http://wordpress.stackexchange.com/q...nomy-tree-view


Código:
//Walker function
function custom_taxonomy_walker($taxonomy, $parent = 0)
{
    $terms = get_terms($taxonomy, array('parent' => $parent, 'hide_empty' => false));
    //If there are terms, start displaying
    if(count($terms) > 0)
    {
        //Displaying as a list
        $out = "<ul>";
        //Cycle though the terms
        foreach ($terms as $term)
        {
            //Secret sauce.  Function calls itself to display child elements, if any
            $out .="<li><input type='checkbox' id='medios_$term->term_id' name='medios' value='$term->name' />" . $term->name . custom_taxonomy_walker($taxonomy, $term->term_id) . "</li>";
        }
        $out .= "</ul>";    
        return $out;
    }
    return;
}

//Example
//echo custom_taxonomy_walker('medios');
Ahora voy a necesitar un poco de javascript para que al clickear cada checkbox del término padre se seleccionen todos los checks de sus hijos.... molestaré en su momento por el foro correspondiente en caso de nueva embolia cerebral :)
__________________
...___...