0 && \strlen( $content ) > $max_length ) { $content = \substr( $content, 0, $max_length ); $last_space = \strrpos( $content, ' ' ); if ( $last_space !== false && $last_space > ( $max_length * 0.9 ) ) { $content = \substr( $content, 0, $last_space ); } $content .= '...'; } return $content; } }