Skip to content

Instantly share code, notes, and snippets.

@cam5
Created June 12, 2013 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cam5/5768125 to your computer and use it in GitHub Desktop.
Save cam5/5768125 to your computer and use it in GitHub Desktop.
Link out the default ellipses that appear on forum updates in BuddyPress!
<?
class Better_Ellipses {
static $link;
static function init() {
add_action('bbp_new_reply', array(__CLASS__, 'get_reply_info'), 1, 2);
add_action('bbp_new_topic', array(__CLASS__, 'get_topic_info'), 1, 1);
add_filter('bp_excerpt_append_text', array(__CLASS__, 'link_ellipses') );
}
static function link_ellipses($string) {
return " <a href='" . self::$link . "'>[&hellip;]</a>";
}
static function get_reply_info($reply_id, $topic_id) {
self::$link = get_permalink($topic_id);
}
static function get_topic_info($topic_id) {
self::$link = get_permalink($topic_id);
}
}
Better_Ellipses::init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment