Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2015 06:51:25 PM (9 years ago)
Author:
tw2113
Message:

First pass at cleanup of Activity component documetnation.

See #6396.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r9819 r9833  
    6161 * mentions suggestions?
    6262 *
     63 * @since BuddyPress (2.1.0)
     64 *
    6365 * @return bool True if mentions scripts should be loaded.
    64  * @since BuddyPress (2.1.0)
    6566 */
    6667function bp_activity_maybe_load_mentions_scripts() {
     
    7374     * @since BuddyPress (2.1.0)
    7475     *
    75      * @param bool $load_mentions True to load mentions assets, false otherwise.
     76     * @param bool $load_mentions    True to load mentions assets, false otherwise.
    7677     * @param bool $mentions_enabled True if mentions are enabled.
    7778     */
     
    8586 *
    8687 * @param string $content The content of the activity, usually found in
    87  *        $activity->content.
     88 *                        $activity->content.
     89 *
    8890 * @return array|bool Associative array with user ID as key and username as
    89  *         value. Boolean false if no mentions found.
     91 *                    value. Boolean false if no mentions found.
    9092 */
    9193function bp_activity_find_mentions( $content ) {
     
    148150 * @uses bp_activity_update_mention_count_for_user()
    149151 *
    150  * @param int $activity_id The unique id for the activity item.
    151  * @param string $action Can be 'delete' or 'add'. Defaults to 'add'.
     152 * @param int    $activity_id The unique id for the activity item.
     153 * @param string $action      Can be 'delete' or 'add'. Defaults to 'add'.
     154 *
     155 * @return bool
    152156 */
    153157function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
     
    186190 * @uses bp_update_user_meta()
    187191 *
    188  * @param int $user_id The user ID.
    189  * @param int $activity_id The unique ID for the activity item.
    190  * @param string $action 'delete' or 'add'. Default: 'add'.
     192 * @param int    $user_id     The user ID.
     193 * @param int    $activity_id The unique ID for the activity item.
     194 * @param string $action      'delete' or 'add'. Default: 'add'.
     195 *
    191196 * @return bool
    192197 */
     
    239244 *
    240245 * @since BuddyPress (1.9.0)
     246 *
     247 * @param int|string $user_id ID of the user to get @-mention name for.
    241248 *
    242249 * @return string User name appropriate for @-mentions.
     
    316323 * @since BuddyPress (1.1.0)
    317324 *
    318  * @param  string   $component_id    The unique string ID of the component.
    319  * @param  string   $type            The action type.
    320  * @param  string   $description     The action description.
    321  * @param  callable $format_callback Callback for formatting the action string.
    322  * @param  string   $label           String to describe this action in the activity stream filter dropdown.
    323  * @param  array    $context         Optional. Activity stream contexts where the filter should appear.
    324  *                                   Values: 'activity', 'member', 'member_groups', 'group'
    325  * @param  int      $position        Optional. The position of the action when listed in dropdowns.
     325 * @param  string        $component_id    The unique string ID of the component.
     326 * @param  string        $type            The action type.
     327 * @param  string        $description     The action description.
     328 * @param  callable|bool $format_callback Callback for formatting the action string.
     329 * @param  string|bool   $label           String to describe this action in the activity stream filter dropdown.
     330 * @param  array         $context         Optional. Activity stream contexts where the filter should appear.
     331 *                                        Values: 'activity', 'member', 'member_groups', 'group'
     332 * @param  int           $position        Optional. The position of the action when listed in dropdowns.
     333 *
    326334 * @return bool False if any param is empty, otherwise true.
    327335 */
     
    353361     * @since BuddyPress (1.1.0)
    354362     *
    355      * @param array    $array Array of arguments for action type being set.
    356      * @param string   $component_id ID of the current component being set.
    357      * @param string   $type Action type being set.
    358      * @param string   $description Action description for action being set.
     363     * @param array    $array           Array of arguments for action type being set.
     364     * @param string   $component_id    ID of the current component being set.
     365     * @param string   $type            Action type being set.
     366     * @param string   $description     Action description for action being set.
    359367     * @param callable $format_callback Callback for formatting the action string.
    360      * @param string   $label String to describe this action in the activity stream filter dropdown.
    361      * @param array    $context Activity stream contexts where the filter should appear. 'activity', 'member',
    362      *                 'member_groups', 'group'.
     368     * @param string   $label           String to describe this action in the activity stream filter dropdown.
     369     * @param array    $context         Activity stream contexts where the filter should appear. 'activity', 'member',
     370     *                                  'member_groups', 'group'.
    363371     */
    364372    $bp->activity->actions->{$component_id}->{$type} = apply_filters( 'bp_activity_set_action', array(
     
    406414 *                                              the post type does not natively support comments, otherwise false.
    407415 * }
     416 *
     417 * @return bool
    408418 */
    409419function bp_activity_set_post_type_tracking_args( $post_type = '', $args = array() ) {
     
    433443 * @since BuddyPress (2.2.0)
    434444 *
    435  * @param  string $post_type Name of the post type
     445 * @param  string $post_type Name of the post type.
     446 *
    436447 * @return object The tracking arguments of the post type.
    437448 */
     
    490501     *
    491502     * @param object $post_type_activity The tracking arguments of the post type.
    492      * @param string $post_type Name of the post type.
     503     * @param string $post_type          Name of the post type.
    493504     */
    494505    return apply_filters( 'bp_activity_get_post_type_tracking_args', $post_type_activity, $post_type );
     
    582593 *
    583594 * @param string $component_id The unique string ID of the component.
    584  * @param string $key The action key.
     595 * @param string $key          The action key.
     596 *
    585597 * @return string|bool Action value if found, otherwise false.
    586598 */
     
    654666 *
    655667 * @param int $user_id ID of the user whose favorites are being queried.
     668 *
    656669 * @return array IDs of the user's favorite activity items.
    657670 */
     
    690703 *
    691704 * @param int $activity_id ID of the activity item being favorited.
    692  * @param int $user_id ID of the user favoriting the activity item.
     705 * @param int $user_id     ID of the user favoriting the activity item.
     706 *
    693707 * @return bool True on success, false on failure.
    694708 */
     
    734748         *
    735749         * @param int $activity_id ID of the activity item being favorited.
    736          * @param int $user_id ID of the user doing the favoriting.
     750         * @param int $user_id     ID of the user doing the favoriting.
    737751         */
    738752        do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
     
    750764         *
    751765         * @param int $activity_id ID of the activity item being favorited.
    752          * @param int $user_id ID of the user doing the favoriting.
     766         * @param int $user_id     ID of the user doing the favoriting.
    753767         */
    754768        do_action( 'bp_activity_add_user_favorite_fail', $activity_id, $user_id );
     
    771785 *
    772786 * @param int $activity_id ID of the activity item being unfavorited.
    773  * @param int $user_id ID of the user unfavoriting the activity item.
     787 * @param int $user_id     ID of the user unfavoriting the activity item.
     788 *
    774789 * @return bool True on success, false on failure.
    775790 */
     
    814829                 *
    815830                 * @param int $activity_id ID of the activity item being unfavorited.
    816                  * @param int $user_id ID of the user doing the unfavoriting.
     831                 * @param int $user_id     ID of the user doing the unfavoriting.
    817832                 */
    818833                do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
     
    846861 *
    847862 * @param string $content The content to filter by.
     863 *
    848864 * @return int|null The ID of the located activity item. Null if none is found.
    849865 */
     
    890906 *
    891907 * @param int $user_id ID of the user whose favorite count is being requested.
     908 *
    892909 * @return int Total favorite count for the user.
    893910 */
     
    911928 * @global object $wpdb WordPress database access object.
    912929 *
    913  * @param int $activity_id ID of the activity item whose metadata is being deleted.
    914  * @param string $meta_key Optional. The key of the metadata being deleted. If
    915  *        omitted, all metadata associated with the activity
    916  *        item will be deleted.
    917  * @param string $meta_value Optional. If present, the metadata will only be
    918  *        deleted if the meta_value matches this parameter.
    919  * @param bool $delete_all Optional. If true, delete matching metadata entries
    920  *    for all objects, ignoring the specified object_id. Otherwise,
    921  *    only delete matching metadata entries for the specified
    922  *    activity item. Default: false.
     930 * @param int    $activity_id ID of the activity item whose metadata is being deleted.
     931 * @param string $meta_key    Optional. The key of the metadata being deleted. If
     932 *                            omitted, all metadata associated with the activity
     933 *                            item will be deleted.
     934 * @param string $meta_value  Optional. If present, the metadata will only be
     935 *                            deleted if the meta_value matches this parameter.
     936 * @param bool   $delete_all  Optional. If true, delete matching metadata entries
     937 *                            for all objects, ignoring the specified object_id. Otherwise,
     938 *                            only delete matching metadata entries for the specified
     939 *                            activity item. Default: false.
     940 *
    923941 * @return bool True on success, false on failure.
    924942 */
     
    954972 * @uses apply_filters() To call the 'bp_activity_get_meta' hook.
    955973 *
    956  * @param int $activity_id ID of the activity item whose metadata is being requested.
    957  * @param string $meta_key Optional. If present, only the metadata matching
    958  *        that meta key will be returned. Otherwise, all metadata for the
    959  *        activity item will be fetched.
    960  * @param bool $single Optional. If true, return only the first value of the
    961  *    specified meta_key. This parameter has no effect if meta_key is not
    962  *    specified. Default: true.
     974 * @param int    $activity_id ID of the activity item whose metadata is being requested.
     975 * @param string $meta_key    Optional. If present, only the metadata matching
     976 *                            that meta key will be returned. Otherwise, all metadata for the
     977 *                            activity item will be fetched.
     978 * @param bool   $single      Optional. If true, return only the first value of the
     979 *                            specified meta_key. This parameter has no effect if meta_key is not
     980 *                            specified. Default: true.
     981 *
    963982 * @return mixed The meta value(s) being requested.
    964983 */
     
    973992     * @since BuddyPress (1.5.0)
    974993     *
    975      * @param mixed  $retval The meta values for the activity item.
     994     * @param mixed  $retval      The meta values for the activity item.
    976995     * @param int    $activity_id ID of the activity item.
    977      * @param string $meta_key Meta key for the value being requested.
    978      * @param bool   $single Whether to return one matched meta key row or all.
     996     * @param string $meta_key    Meta key for the value being requested.
     997     * @param bool   $single      Whether to return one matched meta key row or all.
    979998     */
    980999    return apply_filters( 'bp_activity_get_meta', $retval, $activity_id, $meta_key, $single );
     
    9861005 * @since BuddyPress (1.2.0)
    9871006 *
    988  * @param int $activity_id ID of the activity item whose metadata is being
    989  *        updated.
    990  * @param string $meta_key Key of the metadata being updated.
    991  * @param mixed $meta_value Value to be set.
    992  * @param mixed $prev_value Optional. If specified, only update existing
    993  *        metadata entries with the specified value. Otherwise, update all
    994  *        entries.
     1007 * @param int    $activity_id ID of the activity item whose metadata is being updated.
     1008 * @param string $meta_key    Key of the metadata being updated.
     1009 * @param mixed  $meta_value  Value to be set.
     1010 * @param mixed  $prev_value  Optional. If specified, only update existing metadata entries
     1011 *                            with the specified value. Otherwise, update all entries.
     1012 *
    9951013 * @return bool|int Returns false on failure. On successful update of existing
    996  *         metadata, returns true. On successful creation of new metadata,
    997  *         returns the integer ID of the new metadata row.
     1014 *                  metadata, returns true. On successful creation of new metadata,
     1015 *                  returns the integer ID of the new metadata row.
    9981016 */
    9991017function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    10101028 * @since BuddyPress (2.0.0)
    10111029 *
    1012  * @param int $activity_id ID of the activity item.
    1013  * @param string $meta_key Metadata key.
    1014  * @param mixed $meta_value Metadata value.
    1015  * @param bool $unique Optional. Whether to enforce a single metadata value
    1016  *        for the given key. If true, and the object already has a value for
    1017  *        the key, no change will be made. Default: false.
     1030 * @param int    $activity_id ID of the activity item.
     1031 * @param string $meta_key    Metadata key.
     1032 * @param mixed  $meta_value  Metadata value.
     1033 * @param bool   $unique      Optional. Whether to enforce a single metadata value for the
     1034 *                            given key. If true, and the object already has a value for
     1035 *                            the key, no change will be made. Default: false.
     1036 *
    10181037 * @return int|bool The meta ID on successful update, false on failure.
    10191038 */
     
    10401059 *
    10411060 * @param int $user_id ID of the user whose activity is being deleted.
     1061 *
     1062 * @return bool
    10421063 */
    10431064function bp_activity_remove_all_user_data( $user_id = 0 ) {
     
    10781099 *
    10791100 * @param int $user_id ID of the user whose activity is being spammed.
     1101 *
     1102 * @return bool
    10801103 */
    10811104function bp_activity_spam_all_user_data( $user_id = 0 ) {
     
    11311154     * @since BuddyPress (1.6.0)
    11321155     *
    1133      * @param int   $user_id ID of the user whose activity is being marked as spam.
     1156     * @param int   $user_id    ID of the user whose activity is being marked as spam.
    11341157     * @param array $activities Array of activity items being marked as spam.
    11351158     */
     
    11461169 *
    11471170 * @param int $user_id ID of the user whose activity is being hammed.
     1171 *
     1172 * @return bool
    11481173 */
    11491174function bp_activity_ham_all_user_data( $user_id = 0 ) {
     
    12001225     * @since BuddyPress (1.6.0)
    12011226     *
    1202      * @param int   $user_id ID of the user whose activity is being marked as ham.
     1227     * @param int   $user_id    ID of the user whose activity is being marked as ham.
    12031228     * @param array $activities Array of activity items being marked as ham.
    12041229     */
     
    12501275 *
    12511276 * @param object $activity Activity data object.
     1277 *
    12521278 * @return string|bool Returns false if no callback is found, otherwise returns
    1253  *         the formatted action string.
     1279 *                     the formatted action string.
    12541280 */
    12551281function bp_activity_generate_action_string( $activity ) {
     
    12741300     * @since BuddyPress (2.0.0)
    12751301     *
    1276      * @param BP_Activity_Activity $action Action string being requested.
     1302     * @param BP_Activity_Activity $action   Action string being requested.
    12771303     * @param BP_Activity_Activity $activity Activity item object.
    12781304     */
     
    12901316 * @since BuddyPress (2.0.0)
    12911317 *
    1292  * @param string $action Static activity action.
     1318 * @param string $action   Static activity action.
    12931319 * @param object $activity Activity data object.
     1320 *
    12941321 * @return string
    12951322 */
     
    13021329     * @since BuddyPress (1.2.0)
    13031330     *
    1304      * @param string               $action Activity action string value.
     1331     * @param string               $action   Activity action string value.
    13051332     * @param BP_Activity_Activity $activity Activity item object.
    13061333     */
     
    13131340 * @since BuddyPress (2.0.0)
    13141341 *
    1315  * @param string $action Static activity action.
     1342 * @param string $action   Static activity action.
    13161343 * @param object $activity Activity data object.
     1344 *
    13171345 * @return string
    13181346 */
     
    13251353     * @since BuddyPress (1.2.0)
    13261354     *
    1327      * @param string               $action Activity action string value.
     1355     * @param string               $action   Activity action string value.
    13281356     * @param BP_Activity_Activity $activity Activity item object.
    13291357     */
     
    13381366 * @param string $action   Static activity action.
    13391367 * @param object $activity Activity data object.
     1368 *
    13401369 * @return string
    13411370 */
     
    13821411     * @since BuddyPress (2.2.0)
    13831412     *
    1384      * @param string               $action Activity action string value.
     1413     * @param string               $action   Activity action string value.
    13851414     * @param BP_Activity_Activity $activity Activity item object.
    13861415     */
     
    14141443 * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook.
    14151444 *
    1416  * @param array $args See BP_Activity_Activity::get() for description.
     1445 * @param array|string $args See BP_Activity_Activity::get() for description.
     1446 *
    14171447 * @return array $activity See BP_Activity_Activity::get() for description.
    14181448 */
     
    15051535     *
    15061536     * @param BP_Activity_Activity $activity Requested activity object.
    1507      * @param array                $r Arguments used for the activity query.
     1537     * @param array                $r        Arguments used for the activity query.
    15081538     */
    15091539    return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
     
    15201550 * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
    15211551 *
    1522  * @param array $args {
     1552 * @param array|string $args {
    15231553 *     All arguments and defaults are shared with BP_Activity_Activity::get(),
    15241554 *     except for the following:
     
    15601590     *
    15611591     * @param BP_Activity_Activity $activity Requested activity object.
    1562      * @param array                $args Original passed in arguments.
     1592     * @param array                $args     Original passed in arguments.
    15631593     * @param array                $get_args Constructed arguments used with request.
    15641594     */
     
    15771607 * @uses do_action() To call the 'bp_activity_add' hook
    15781608 *
    1579  * @param array $args {
     1609 * @param array|string $args {
    15801610 *     An array of arguments.
    1581  *     @type int|bool $id Pass an activity ID to update an existing item, or
    1582  *           false to create a new item. Default: false.
    1583  *     @type string $action Optional. The activity action/description, typically
    1584  *           something like "Joe posted an update". Values passed to this param
    1585  *           will be stored in the database and used as a fallback for when the
    1586  *           activity item's format_callback cannot be found (eg, when the
    1587  *           component is disabled). As long as you have registered a
    1588  *           format_callback for your $type, it is unnecessary to include this
    1589  *           argument - BP will generate it automatically.
    1590  *           See {@link bp_activity_set_action()}.
    1591  *     @type string $content Optional. The content of the activity item.
    1592  *     @type string $component The unique name of the component associated with
    1593  *           the activity item - 'groups', 'profile', etc.
    1594  *     @type string $type The specific activity type, used for directory
    1595  *           filtering. 'new_blog_post', 'activity_update', etc.
    1596  *     @type string $primary_link Optional. The URL for this item, as used in
    1597  *           RSS feeds. Defaults to the URL for this activity item's permalink page.
    1598  *     @type int|bool $user_id Optional. The ID of the user associated with the
    1599  *           activity item. May be set to false or 0 if the item is not related
    1600  *           to any user. Default: the ID of the currently logged-in user.
    1601  *     @type int $item_id Optional. The ID of the associated item.
    1602  *     @type int $secondary_item_id Optional. The ID of a secondary associated
    1603  *           item.
    1604  *     @type string $date_recorded Optional. The GMT time, in Y-m-d h:i:s format,
    1605  *           when the item was recorded. Defaults to the current time.
    1606  *     @type bool $hide_sitewide Should the item be hidden on sitewide streams?
    1607  *           Default: false.
    1608  *     @type bool $is_spam Should the item be marked as spam? Default: false.
     1611 *     @type int|bool $id                Pass an activity ID to update an existing item, or
     1612 *                                       false to create a new item. Default: false.
     1613 *     @type string   $action            Optional. The activity action/description, typically
     1614 *                                       something like "Joe posted an update". Values passed to this param
     1615 *                                       will be stored in the database and used as a fallback for when the
     1616 *                                       activity item's format_callback cannot be found (eg, when the
     1617 *                                       component is disabled). As long as you have registered a
     1618 *                                       format_callback for your $type, it is unnecessary to include this
     1619 *                                       argument - BP will generate it automatically.
     1620 *                                       See {@link bp_activity_set_action()}.
     1621 *     @type string   $content          Optional. The content of the activity item.
     1622 *     @type string   $component        The unique name of the component associated with
     1623 *                                       the activity item - 'groups', 'profile', etc.
     1624 *     @type string   $type              The specific activity type, used for directory
     1625 *                                       filtering. 'new_blog_post', 'activity_update', etc.
     1626 *     @type string   $primary_link      Optional. The URL for this item, as used in
     1627 *                                       RSS feeds. Defaults to the URL for this activity
     1628 *                                       item's permalink page.
     1629 *     @type int|bool $user_id           Optional. The ID of the user associated with the activity
     1630 *                                       item. May be set to false or 0 if the item is not related
     1631 *                                       to any user. Default: the ID of the currently logged-in user.
     1632 *     @type int      $item_id           Optional. The ID of the associated item.
     1633 *     @type int      $secondary_item_id Optional. The ID of a secondary associated item.
     1634 *     @type string   $date_recorded     Optional. The GMT time, in Y-m-d h:i:s format, when
     1635 *                                       the item was recorded. Defaults to the current time.
     1636 *     @type bool     $hide_sitewide    Should the item be hidden on sitewide streams?
     1637 *                                       Default: false.
     1638 *     @type bool     $is_spam          Should the item be marked as spam? Default: false.
    16091639 * }
    16101640 * @return int|bool The ID of the activity on success. False on error.
     
    16941724 * @uses do_action() To call the 'bp_activity_posted_update' hook.
    16951725 *
    1696  * @param array $args {
     1726 * @param array|string $args {
    16971727 *     @type string $content The content of the activity update.
    1698  *     @type int $user_id Optional. Defaults to the logged-in user.
     1728 *     @type int    $user_id Optional. Defaults to the logged-in user.
    16991729 * }
    17001730 * @return int $activity_id The activity id
     
    17511781     * @since BuddyPress (1.6.0)
    17521782     *
    1753      * @param string $r Content of the activity update.
     1783     * @param string $r                Content of the activity update.
    17541784     * @param string $activity_content Content of the activity update.
    17551785     */
     
    17671797     * @since BuddyPress (1.2.0)
    17681798     *
    1769      * @param string $content Content of the activity post update.
    1770      * @param int    $user_id ID of the user posting the activity update.
     1799     * @param string $content     Content of the activity post update.
     1800     * @param int    $user_id     ID of the user posting the activity update.
    17711801     * @param int    $activity_id ID of the activity item being updated.
    17721802     */
     
    17841814 * @param  WP_Post  $post    Post object.
    17851815 * @param  int      $user_id ID of the post author.
     1816 *
    17861817 * @return int|bool The ID of the activity on success. False on error.
    17871818 */
     
    19191950 *
    19201951 * @param  WP_Post $post Post item.
     1952 *
    19211953 * @return bool    True on success, false on failure.
    19221954 */
     
    19732005     * @since BuddyPress (2.2.0)
    19742006     *
    1975      * @param WP_Post              $post Post object.
     2007     * @param WP_Post              $post     Post object.
    19762008     * @param BP_Activity_Activity $activity Activity object.
    19772009     */
     
    19882020 * @param  int     $post_id ID of the post being unpublished.
    19892021 * @param  WP_Post $post    Post object.
     2022 *
    19902023 * @return bool    True on success, false on failure.
    19912024 */
     
    20242057     * @param array   $delete_activity_args Array of arguments for activity deletion.
    20252058     * @param WP_Post $post                 Post object.
    2026      * @param bool    $activity             Whether or not the activity
    2027      *                                      was successfully deleted.
     2059     * @param bool    $activity             Whether or not the activity was successfully deleted.
    20282060     */
    20292061    do_action( 'bp_activity_post_type_unpublished', $delete_activity_args, $post, $deleted );
     
    20442076 * @uses do_action() To call the 'bp_activity_comment_posted' hook.
    20452077 *
    2046  * @param array $args {
    2047  *     @type int $id Optional. Pass an ID to update an existing comment.
    2048  *     @type string $content The content of the comment.
    2049  *     @type int $user_id Optional. The ID of the user making the comment.
    2050  *           Defaults to the ID of the logged-in user.
    2051  *     @type int $activity_id The ID of the "root" activity item, ie the oldest
    2052  *           ancestor of the comment.
    2053  *     @type int $parent_id Optional. The ID of the parent activity item, ie the
    2054  *           item to which the comment is an immediate reply. If not provided,
    2055  *           this value defaults to the $activity_id.
     2078 * @param array|string $args {
     2079 *     @type int    $id          Optional. Pass an ID to update an existing comment.
     2080 *     @type string $content     The content of the comment.
     2081 *     @type int    $user_id    Optional. The ID of the user making the comment.
     2082 *                               Defaults to the ID of the logged-in user.
     2083 *     @type int    $activity_id The ID of the "root" activity item, ie the oldest
     2084 *                               ancestor of the comment.
     2085 *     @type int    $parent_id   Optional. The ID of the parent activity item, ie the item to
     2086 *                               which the comment is an immediate reply. If not provided,
     2087 *                               this value defaults to the $activity_id.
    20562088 * }
    20572089 * @return int|bool The ID of the comment on success, otherwise false.
     
    21422174     *
    21432175     * @param int   $comment_id ID of the newly posted activity comment.
    2144      * @param array $r Array of parsed comment arguments.
    2145      * @param int   $activity ID of the activity item being commented on.
     2176     * @param array $r          Array of parsed comment arguments.
     2177     * @param int   $activity   ID of the activity item being commented on.
    21462178     */
    21472179    do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
     
    21652197 * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
    21662198 *
    2167  * @param array $args See BP_Activity_Activity::get() for description.
     2199 * @param array|string $args See BP_Activity_Activity::get() for description.
     2200 *
    21682201 * @return int $activity_id The ID of the activity item found.
    21692202 */
     
    21862219     * @since BuddyPress (1.2.0)
    21872220     *
    2188      * @param BP_Activity_Activity ID returned by BP_Activity_Activity get_id() method with provided arguments.
     2221     * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments.
    21892222     */
    21902223    return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id(
     
    22262259 * @uses wp_cache_delete()
    22272260 *
    2228  * @param array $args To delete specific activity items, use
    2229  *            $args = array( 'id' => $ids );
    2230  *        Otherwise, to use filters for item deletion, the argument format is
    2231  *        the same as BP_Activity_Activity::get(). See that method for a description.
     2261 * @param array|string $args To delete specific activity items, use
     2262 *                           $args = array( 'id' => $ids ); Otherwise, to use
     2263 *                           filters for item deletion, the argument format is
     2264 *                           the same as BP_Activity_Activity::get().
     2265 *                           See that method for a description.
     2266 *
    22322267 * @return bool True on success, false on failure.
    22332268 */
     
    23122347     * @uses bp_activity_delete()
    23132348     *
    2314      * @param array $args See BP_Activity_Activity::get for a description
    2315      *                    of accepted arguments.
     2349     * @param array|string $args See BP_Activity_Activity::get for a
     2350     *                           description of accepted arguments.
    23162351     *
    23172352     * @return bool True on success, false on failure.
     
    23372372     * @uses bp_activity_delete()
    23382373     *
    2339      * @param int ID of the activity item to be deleted.
     2374     * @param int $activity_id ID of the activity item to be deleted.
     2375     *
    23402376     * @return bool True on success, false on failure.
    23412377     */
     
    23542390     * @uses bp_activity_delete()
    23552391     *
    2356      * @param int $user_id The user id.
    2357      * @param string $content The activity id.
     2392     * @param int    $user_id  The user id.
     2393     * @param string $content   The activity id.
    23582394     * @param string $component The activity component.
    2359      * @param string $type The activity type.
     2395     * @param string $type      The activity type.
     2396     *
    23602397     * @return bool True on success, false on failure.
    23612398     */
     
    23792416     * @uses bp_activity_delete()
    23802417     *
    2381      * @param int $user_id The user id.
     2418     * @param int    $user_id  The user id.
    23822419     * @param string $component The activity component.
     2420     *
    23832421     * @return bool True on success, false on failure.
    23842422     */
     
    24072445 * @param int $activity_id The ID of the "root" activity, ie the comment's
    24082446 *                         oldest ancestor.
    2409  * @param int $comment_id The ID of the comment to be deleted.
     2447 * @param int $comment_id  The ID of the comment to be deleted.
     2448 *
    24102449 * @return bool True on success, false on failure
    24112450 */
     
    24202459     * @since BuddyPress (1.2.0)
    24212460     *
    2422      * @param bool $value Whether BuddyPress should continue or not.
     2461     * @param bool $value       Whether BuddyPress should continue or not.
    24232462     * @param int  $activity_id ID of the root activity item being deleted.
    2424      * @param int  $comment_id ID of the comment being deleted.
     2463     * @param int  $comment_id  ID of the comment being deleted.
    24252464     */
    24262465    if ( ! apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) {
     
    24482487     *
    24492488     * @param int $activity_id ID of the activity that has had a comment deleted from.
    2450      * @param int $comment_id ID of the comment that was deleted.
     2489     * @param int $comment_id  ID of the comment that was deleted.
    24512490     */
    24522491    do_action( 'bp_activity_delete_comment', $activity_id, $comment_id );
     
    24652504     *
    24662505     * @param int $activity_id The ID of the "root" activity, ie the
    2467      *        comment's oldest ancestor.
    2468      * @param int $comment_id The ID of the comment to be deleted.
     2506     *                         comment's oldest ancestor.
     2507     * @param int $comment_id  The ID of the comment to be deleted.
    24692508     */
    24702509    function bp_activity_delete_children( $activity_id, $comment_id ) {
     
    25022541 * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook.
    25032542 *
    2504  * @param int $activity_id The unique id of the activity object.
    2505  * @param object $activity_obj Optional. The activity object.
     2543 * @param int         $activity_id  The unique id of the activity object.
     2544 * @param object|bool $activity_obj Optional. The activity object.
     2545 *
    25062546 * @return string $link Permalink for the activity item.
    25072547 */
     
    25562596 *
    25572597 * @param int $user_id The ID of the user whose activity is being hidden.
     2598 *
    25582599 * @return bool True on success, false on failure.
    25592600 */
     
    25792620 * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
    25802621 *
    2581  * @param string $content The content of the activity item.
    2582  * @param string $link Optional. The unescaped URL that the image should link
    2583  *        to. If absent, the image will not be a link.
    2584  * @param array $args Optional. The args passed to the activity
    2585  *        creation function (eg bp_blogs_record_activity()).
     2622 * @param string      $content The content of the activity item.
     2623 * @param string|bool $link    Optional. The unescaped URL that the image should link
     2624 *                             to. If absent, the image will not be a link.
     2625 * @param array|bool  $args    Optional. The args passed to the activity
     2626 *                             creation function (eg bp_blogs_record_activity()).
     2627 *
    25862628 * @return string $content The content with images stripped and replaced with a
    25872629 *         single thumb.
     
    26392681     * @param string $content Activity content that had images replaced in.
    26402682     * @param array  $matches Array of all image tags found in the posted content.
    2641      * @param array  $args Arguments passed into function creating the activity update.
     2683     * @param array  $args    Arguments passed into function creating the activity update.
    26422684     */
    26432685    return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
     
    26562698 * @param array  $activity The data passed to bp_activity_add() or the values
    26572699 *                         from an Activity obj.
     2700 *
    26582701 * @return string
    26592702 */
     
    26682711    }
    26692712
    2670 
    26712713    /**
    26722714     * Filter the class name of the media extractor when creating an Activity summary.
     
    26742716     * Use this filter to change the media extractor used to extract media info for the activity item.
    26752717     *
     2718     * @since BuddyPress (2.3.0)
     2719     *
    26762720     * @param string $extractor Class name.
    2677      * @param string $content The content of the activity item.
    2678      * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.
    2679      * @since BuddyPress (2.3.0)
     2721     * @param string $content   The content of the activity item.
     2722     * @param array  $activity  The data passed to bp_activity_add() or the values from an Activity obj.
    26802723     */
    26812724    $extractor = apply_filters( 'bp_activity_create_summary_extractor_class', 'BP_Media_Extractor', $content, $activity );
     
    26852728     * Filter the arguments passed to the media extractor when creating an Activity summary.
    26862729     *
    2687      * @param array $args Array of bespoke data for the media extractor.
    2688      * @param string $content The content of the activity item.
    2689      * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.
     2730     * @since BuddyPress (2.3.0)
     2731     *
     2732     * @param array              $args      Array of bespoke data for the media extractor.
     2733     * @param string             $content   The content of the activity item.
     2734     * @param array              $activity  The data passed to bp_activity_add() or the values from an Activity obj.
    26902735     * @param BP_Media_Extractor $extractor The media extractor object.
    2691      * @since BuddyPress (2.3.0)
    26922736     */
    26932737    $args = apply_filters( 'bp_activity_create_summary_extractor_args', $args, $content, $activity, $extractor );
     
    27352779        $use_media_type = 'images';
    27362780        $image_source   = 'html';
    2737    
     2781
    27382782        // Featured Image > Galleries > inline <img>.
    27392783        if ( $has_feat_image ) {
     
    27572801         * Filter the results of the media extractor when creating an Activity summary.
    27582802         *
    2759          * @param array $extracted_media Extracted media item. See {@link BP_Media_Extractor::extract()} for format.
    2760          * @param string $content Content of the activity item.
    2761          * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.
    2762          * @param array $media All results from the media extraction. See {@link BP_Media_Extractor::extract()} for format.
    2763          * @param string $use_media_type The kind of media item that was preferentially extracted.
    2764          * @param string $image_source If $use_media_type was "images", the preferential source of the image.
    2765          *               Otherwise empty.
    27662803         * @since BuddyPress (2.3.0)
     2804         *
     2805         * @param array  $extracted_media Extracted media item. See {@link BP_Media_Extractor::extract()} for format.
     2806         * @param string $content         Content of the activity item.
     2807         * @param array  $activity        The data passed to bp_activity_add() or the values from an Activity obj.
     2808         * @param array  $media           All results from the media extraction.
     2809         *                                See {@link BP_Media_Extractor::extract()} for format.
     2810         * @param string $use_media_type  The kind of media item that was preferentially extracted.
     2811         * @param string $image_source    If $use_media_type was "images", the preferential source of the image.
     2812         *                                Otherwise empty.
    27672813         */
    27682814        $extracted_media = apply_filters(
     
    27922838     * Filters the newly-generated summary for the activity item.
    27932839     *
    2794      * @param string $summary Activity summary HTML.
    2795      * @param string $content $content Content of the activity item.
    2796      * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.
    2797      * @param array $extracted_media Media item extracted. See {@link BP_Media_Extractor::extract()} for format.
    27982840     * @since BuddyPress (2.3.0)
     2841     *
     2842     * @param string $summary         Activity summary HTML.
     2843     * @param string $content         Content of the activity item.
     2844     * @param array  $activity        The data passed to bp_activity_add() or the values from an Activity obj.
     2845     * @param array  $extracted_media Media item extracted. See {@link BP_Media_Extractor::extract()} for format.
    27992846     */
    28002847    return apply_filters( 'bp_activity_create_summary', $summary, $content, $activity, $extracted_media );
     
    28262873 *
    28272874 * @param BP_Activity_Activity $activity The activity item to be spammed.
    2828  * @param string $source Optional. Default is "by_a_person" (ie, a person has
    2829  *        manually marked the activity as spam). BP core also accepts
    2830  *        'by_akismet'.
     2875 * @param string               $source  Optional. Default is "by_a_person" (ie, a person has
     2876 *                                       manually marked the activity as spam). BP core also
     2877 *                                       accepts 'by_akismet'.
    28312878 */
    28322879function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
     
    28612908     *
    28622909     * @param BP_Activity_Activity $activity Activity item being marked as spam.
    2863      * @param string               $source Source of determination of spam status. For example
    2864      *                             "by_a_person" or "by_akismet".
     2910     * @param string               $source   Source of determination of spam status. For example
     2911     *                                       "by_a_person" or "by_akismet".
    28652912     */
    28662913    do_action( 'bp_activity_mark_as_spam', $activity, $source );
     
    28722919 * @since BuddyPress (1.6.0)
    28732920 *
    2874  * @param BP_Activity_Activity $activity The activity item to be hammed.
    2875  * @param string $source Optional. Default is "by_a_person" (ie, a person has
    2876  *        manually marked the activity as spam). BP core also accepts
    2877  *        'by_akismet'.
     2921 * @param BP_Activity_Activity $activity The activity item to be hammed. Passed by reference.
     2922 * @param string               $source  Optional. Default is "by_a_person" (ie, a person has
     2923 *                                       manually marked the activity as spam). BP core also accepts
     2924 *                                       'by_akismet'.
    28782925 */
    28792926function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
     
    29082955     *
    29092956     * @param BP_Activity_Activity $activity Activity item being marked as ham.
    2910      * @param string               $source Source of determination of ham status. For example
    2911      *                             "by_a_person" or "by_akismet".
     2957     * @param string               $source   Source of determination of ham status. For example
     2958     *                                       "by_a_person" or "by_akismet".
    29122959     */
    29132960    do_action( 'bp_activity_mark_as_ham', $activity, $source );
     
    30153062 * @uses bp_activity_get_meta()
    30163063 *
    3017  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
    3018  *        functions like this one to filter.
    3019  * @param int $id The ID of the activity item.
     3064 * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
     3065 *                         functions like this one to filter.
     3066 * @param int    $id      The ID of the activity item.
    30203067 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
     3068 *
    30213069 * @return mixed The cached embeds for this activity item.
    30223070 */
     
    30353083 * @uses bp_activity_update_meta()
    30363084 *
    3037  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
    3038  *        functions like this one to filter.
     3085 * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
     3086 *                         functions like this one to filter.
    30393087 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
    3040  * @param int $id The ID of the activity item.
     3088 * @param int    $id       The ID of the activity item.
     3089 *
    30413090 * @return bool True on success, false on failure.
    30423091 */
Note: See TracChangeset for help on using the changeset viewer.