Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: “alphabetical” ordering of hot tags


_ck_
Participant

@_ck_

Any guide that is for WordPress plugins should work for bbPress, it’s just that bbPress’s “hooks” (do_action, do_filter) will be named differently.

bbPress is unfortunately too young to have decent documentation yet. WordPress itself didn’t really “take off” until 2.0 beta came out.

This is essentially the plugin framework you need:

<?php
/*
Plugin Name: My Tag Sort
*/
remove_filter('sort_tag_heat_map', 'bb_sort_tag_heat_map');
add_filter('sort_tag_heat_map', 'my_sort_tag_heat_map');

function my_sort_tag_heat_map( &$tag_counts ) {
// put your replacement code here
}
?>

Save it as my-tag-sort.php, put it into the bbpress/my-plugins folder, activate and you’re in business (well after you figure out the sort method).

Typically you’d have to do a return $tag_counts; at the end of a filter but that & on the &$tag_counts means it’s “passed by refererence” which is a fancy way of using the original array directly without making a copy, so the original is changed at the source when you modify it. It’s a much faster way to move large amounts of info around.

Skip to toolbar