Skip to:
Content

BuddyPress.org

Ticket #4663: ticket-4663.01.patch

File ticket-4663.01.patch, 1.2 KB (added by DJPaul, 12 years ago)
  • bp-activity/bp-activity-template.php

     
    13801380        }
    13811381
    13821382/**
     1383 * Output the parent activity's user ID
     1384 *
     1385 * @since BuddyPress (1.7)
     1386 */
     1387function bp_activity_parent_user_id() {
     1388        echo bp_get_activity_parent_user_id();
     1389}
     1390
     1391        /**
     1392         * Return the parent activity's user ID
     1393         *
     1394         * @global BP_Activity_Template $activities_template
     1395         * @return bool|int False if parent activity can't be found, otherwise returns the parent activity's user ID
     1396         * @since BuddyPress (1.7)
     1397         */
     1398        function bp_get_activity_parent_user_id() {
     1399                global $activities_template;
     1400
     1401                $retval = false;
     1402
     1403                // Get the user ID of the parent activity
     1404                $parent_id = $activities_template->activity->item_id;
     1405                if ( $parent_id && ! empty( $activities_template->activity_parents[$parent_id] ) )
     1406                        $retval = $activities_template->activity_parents[$parent_id]->user_id;
     1407
     1408                return apply_filters( 'bp_get_activity_parent_user_id', $retval );
     1409        }
     1410
     1411/**
    13831412 * Output whether or not the current activity is in a current user's favorites
    13841413 *
    13851414 * @since BuddyPress (1.2)