[buddypress-trac] [BuddyPress] #3452: Long Inserted Image in Post doesn't Render in Activity Stream
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Sat Aug 13 19:21:26 UTC 2011
#3452: Long Inserted Image in Post doesn't Render in Activity Stream
-------------------------+------------------
Reporter: nahummadrid | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.5
Component: Activity | Version: 1.5
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------
Changes (by boonebgorges):
* keywords: => has-patch
Comment:
That function from CakePHP is pretty awesome. I was able to drop it in
more or less as-is, and it seems to be working great. I modified it a bit
to match BP coding standards, to add filters, and to do some backward
compatibility.
As for function arguments. In 1.2.9, the parameters looked like this:
{{{function bp_create_excerpt( $text, $length = 123, $filter_shortcodes =
true )}}}
The previous BP 1.5 version added a fourth parameter, $append_text, which
defaulted to ' […]'. The Cake function worked a bit differently:
{{{function truncate( $text, $length = 123, $options = array() )}}}
where $options is an array (which includes 'ending', corresponding to our
$append_text). I decided to switch over to the Cake method, to minimize
refactoring. I've maintained backward compatibility with BP 1.2.9's
function arguments (see the first line, where I do is_bool() on $options).
The correct arguments from here on out are spelled out in the PHPDoc for
the function.
Please give it a go with some different HTML-strewn content and see if you
get what you'd expect.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3452#comment:5>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list