Skip to content

Instantly share code, notes, and snippets.

Created September 17, 2013 08:05
Show Gist options
  • Save anonymous/6591363 to your computer and use it in GitHub Desktop.
Save anonymous/6591363 to your computer and use it in GitHub Desktop.
A BuddyPress template tag to display the full length of a message while in threads loop.
<?php
/* You can put this in your functions.php or any file that is loaded in the WordPress process
waiting for a new template tag to be created */
function bp_message_thread_the_content() {
echo bp_get_message_thread_the_content();
}
function bp_get_message_thread_the_content() {
global $messages_template;
/* using the filters of bp_get_message_thread_excerpt as the truncate is not done via filter
New filters on bp_get_message_thread_the_content might be interesting */
return apply_filters( 'bp_get_message_thread_excerpt', $messages_template->thread->last_message_content );
}
/* now in your template simply add <?php bp_message_thread_the_content();?> to display the full length of the message. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment