[buddypress-trac] [BuddyPress Trac] #6629: Accept array for the parameter item_id for bp_activity_add() function
buddypress-trac
noreply at wordpress.org
Sun Sep 20 21:40:26 UTC 2015
#6629: Accept array for the parameter item_id for bp_activity_add() function
-------------------------+-----------------------------
Reporter: Tafmakura | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: API | Version:
Severity: normal | Keywords:
-------------------------+-----------------------------
For a project I am working on I want my custom activity to have dynamic
content of the post that invokes the activity when it is created instead
of the static data that is passed to the activity's 'content' parameter, I
achieved this by passing the post id as the secondary_item_id when the
activity is created and then creating a custom entry.php template that
displays activity content based on the secondary item_id (i.e featured
image and exerpt) this works well. The problem is i now have activities
that are suppose to show multiple posts in the activity content (don't ask
how or why). Using the method above I can simply save the post id's into
the secondary_item_id parameter as an array or comma separated string and
then later display them by executing a loop.
The problem is that bp_activity_add() only accepts numbers(no spaces or
letters ) and it will not accept an array either. I am no PHP developer
but can secondary_item_id not accept an array or comma string or perhaps
should there not be another parameter where this can be stored. i ended up
using the content parameter to store a comma separated list of post IDs.
It is untidy because by default the activity function will display this
info yet I want it hidden.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6629>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list