Skip to:
Content

BuddyPress.org

Changeset 8783


Ignore:
Timestamp:
08/10/2014 06:24:02 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Replace $bp globals with buddypress() calls in bp-activity-functions.php.

File:
1 edited

Legend:

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

    r8754 r8783  
    17981798 * @since BuddyPress (1.6.0)
    17991799 *
    1800  * @global object $bp BuddyPress global settings.
    1801  *
    18021800 * @param BP_Activity_Activity $activity The activity item to be spammed.
    18031801 * @param string $source Optional. Default is "by_a_person" (ie, a person has
     
    18061804 */
    18071805function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
    1808     global $bp;
     1806    $bp = buddypress();
    18091807
    18101808    $activity->is_spam = 1;
     
    18371835 *
    18381836 * @since BuddyPress (1.6.0)
    1839  *
    1840  * @global object $bp BuddyPress global settings.
    18411837 *
    18421838 * @param BP_Activity_Activity $activity The activity item to be hammed.
     
    18461842 */
    18471843function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
    1848     global $bp;
     1844    $bp = buddypress();
    18491845
    18501846    $activity->is_spam = 0;
     
    19321928 *
    19331929 * @see BP_Embed
    1934  * @global object $bp BuddyPress global settings
    19351930 * @uses add_filter() To attach create_function() to 'embed_post_id'.
    19361931 * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'.
     
    19401935 */
    19411936function bp_dtheme_embed_read_more( $activity ) {
    1942     global $bp;
    1943 
    1944     $bp->activity->read_more_id = $activity->id;
    1945 
    1946     add_filter( 'embed_post_id',            create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) );
    1947     add_filter( 'bp_embed_get_cache',       'bp_embed_activity_cache',      10, 3 );
    1948     add_action( 'bp_embed_update_cache',    'bp_embed_activity_save_cache', 10, 3 );
    1949 }
    1950 add_action( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
     1937    buddypress()->activity->read_more_id = $activity->id;
     1938
     1939    add_filter( 'embed_post_id',         create_function( '', 'return buddypress()->activity->read_more_id;' ) );
     1940    add_filter( 'bp_embed_get_cache',    'bp_embed_activity_cache',      10, 3 );
     1941    add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
     1942}
     1943add_action( 'bp_dtheme_get_single_activity_content',       'bp_dtheme_embed_read_more' );
    19511944add_action( 'bp_legacy_theme_get_single_activity_content', 'bp_dtheme_embed_read_more' );
    19521945
Note: See TracChangeset for help on using the changeset viewer.