Skip to content

Instantly share code, notes, and snippets.

/-
Created Nov 29, 2017

Embed
What would you like to do?
diff --git a/src/bp-core/bp-core-template.php b/src/bp-core/bp-core-template.php
index 21825050f..6b558fe04 100644
--- a/src/bp-core/bp-core-template.php
+++ b/src/bp-core/bp-core-template.php
@@ -1017,7 +1017,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
$is_word_boundary = ' ' === $truncate[ $pos ];
if ( ! $is_word_boundary && isset( $truncate_tags[ $pos - 1 ] ) ) {
$preceding_tag = $truncate_tags[ $pos - 1 ];
- if ( ' ' === $truncate[ $preceding_tag['start'] - 1 ] ) {
+ if ( isset( $truncate[ $preceding_tag['start'] - 1 ] ) && ' ' === $truncate[ $preceding_tag['start'] - 1 ] ) {
$is_word_boundary = true;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.