Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2012 10:10:47 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in Activity component. See #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-actions.php

    r5664 r5684  
    115115 * @param int $activity_id Activity id to be deleted. Defaults to 0.
    116116 *
    117  * @global object $bp BuddyPress global settings
    118117 * @uses bp_is_activity_component()
    119118 * @uses bp_is_current_action()
     
    130129 */
    131130function bp_activity_action_delete_activity( $activity_id = 0 ) {
    132     global $bp;
    133131
    134132    // Not viewing activity or action is not delete
     
    347345 * @since 1.2.0
    348346 *
    349  * @global object $bp BuddyPress global settings
    350347 * @uses is_user_logged_in()
    351348 * @uses bp_is_activity_component()
     
    361358 */
    362359function bp_activity_action_mark_favorite() {
    363     global $bp;
    364360
    365361    if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )
     
    383379 * @since 1.2.0
    384380 *
    385  * @global object $bp BuddyPress global settings
    386381 * @uses is_user_logged_in()
    387382 * @uses bp_is_activity_component()
     
    397392 */
    398393function bp_activity_action_remove_favorite() {
    399     global $bp;
    400394
    401395    if ( !is_user_logged_in() || ( bp_is_activity_component() ) || !bp_is_current_action( 'unfavorite' ) )
     
    447441 * @since 1.0.0
    448442 *
    449  * @global object $bp BuddyPress global settings
    450443 * @global object $wp_query
    451444 * @uses bp_is_user_activity()
     
    456449 */
    457450function bp_activity_action_personal_feed() {
    458     global $bp, $wp_query;
     451    global $wp_query;
    459452
    460453    if ( !bp_is_user_activity() || !bp_is_current_action( 'feed' ) )
     
    474467 * @since 1.0.0
    475468 *
    476  * @global object $bp BuddyPress global settings
    477469 * @global object $wp_query
    478470 * @uses bp_is_active()
     
    486478 */
    487479function bp_activity_action_friends_feed() {
    488     global $bp, $wp_query;
     480    global $wp_query;
    489481
    490482    if ( !bp_is_active( 'friends' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
     
    504496 * @since 1.2.0
    505497 *
    506  * @global object $bp BuddyPress global settings
    507498 * @global object $wp_query
    508499 * @uses bp_is_active()
     
    516507 */
    517508function bp_activity_action_my_groups_feed() {
    518     global $bp, $wp_query;
     509    global $wp_query;
    519510
    520511    if ( !bp_is_active( 'groups' ) || !bp_is_user_activity() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
     
    534525 * @since 1.2.0
    535526 *
    536  * @global object $bp BuddyPress global settings
    537527 * @global object $wp_query
    538528 * @uses bp_is_user_activity()
     
    544534 */
    545535function bp_activity_action_mentions_feed() {
    546     global $bp, $wp_query;
     536    global $wp_query;
    547537
    548538    if ( !bp_is_user_activity() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
     
    562552 * @since 1.2.0
    563553 *
    564  * @global object $bp BuddyPress global settings
    565554 * @global object $wp_query
    566555 * @uses bp_is_user_activity()
     
    572561 */
    573562function bp_activity_action_favorites_feed() {
    574     global $bp, $wp_query;
     563    global $wp_query;
    575564
    576565    if ( !bp_is_user_activity() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
     
    584573}
    585574add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
    586 
    587575
    588576/**
     
    610598    $bp->activity->akismet = new BP_Akismet();
    611599}
     600
    612601?>
Note: See TracChangeset for help on using the changeset viewer.