Skip to content

Instantly share code, notes, and snippets.

View zaerl's full-sized avatar
🏠
Working from home

Francesco Bigiarini zaerl

🏠
Working from home
View GitHub Profile
@zaerl
zaerl / functions.php
Created November 16, 2012 09:49
Custom bbPress role names
function my_custom_roles( $role, $user_id, $user_role ) {
if( $role == 'Key Master' )
return 'Site Owner';
return $role;
}
add_filter( 'bbp_get_user_display_role', 'my_custom_roles', 10, 3 );
@zaerl
zaerl / bbp-replay-functions.php
Created October 22, 2012 07:42
bbPress FORCE INDEX workaround
function _bbp_has_replies_where( $where, $query ) {
// Bail if no post_parent to replace
if ( ! is_numeric( $query->get( 'post_parent' ) ) )
return $where;
// Bail if not a topic and reply query
if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) != $query->get( 'post_type' ) )
return $where;
@zaerl
zaerl / bbp-core-filters.php
Created October 13, 2012 12:38
bbPress 1,000 count bug
// add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 );
add_filter( 'bbp_topic_reply_count', 'bbp_number_format', 10 );