Created
June 12, 2013 19:01
-
-
Save cam5/5768125 to your computer and use it in GitHub Desktop.
Link out the default ellipses that appear on forum updates in BuddyPress!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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 . "'>[…]</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