$taxonomy,
'pad_counts' => 'true',
);
$terms = MLAShortcodes::mla_get_terms( $attr );
unset( $terms['found_rows'] );
foreach ( $terms as $term ) {
$this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
}
}
/**
* Start the element output.
*
* @see Walker::start_el()
*
* @param string Passed by reference. Used to append additional content.
* @param object Taxonomy data object.
* @param int Depth of category in reference to parents. Default 0.
* @param array An array of arguments. @see wp_list_categories()
* @param int ID of the current category.
*/
function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
$taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
}
parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
}
}// Class MNA_Pad_Counts_Walker
$taxonomies = get_object_taxonomies( 'attachment', 'objects' );
foreach ( $taxonomies as $taxonomy ) {
echo '
' . $taxonomy->labels->name . '
';
unset( $checklist_walker );
$checklist_walker = new MNA_Pad_Counts_Walker( $taxonomy->name );
$args = array(
'taxonomy' => $taxonomy->name,
'hierarchical' => 1,
'hide_empty' => 0,
'pad_counts' => 1,
'show_count' => 1,
'title_li' => '',
'walker' => $checklist_walker,
);
echo '
wp_list_categories
';
wp_list_categories( $args );
echo '
mla_tag_cloud
';
echo '
pad_counts=false ';
echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=false]" );
echo ' | pad_counts=true ';
echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=true]" );
echo ' |
';
}
?>