Skip to:
Content

bbPress.org

Changeset 6180


Ignore:
Timestamp:
12/23/2016 02:48:33 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Extend: Consolidate some BuddyPress hooks to the top of each file.

Location:
trunk/src/includes/extend/buddypress
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/functions.php

    r5951 r6180  
    66 * @package bbPress
    77 * @subpackage BuddyPress
    8  * @todo maybe move to BuddyPress Forums once bbPress 1.1 can be removed
    98 */
    109
    1110// Exit if accessed directly
    1211defined( 'ABSPATH' ) || exit;
     12
     13// Hooks
     14add_action( 'bp_modify_page_title', 'bbp_filter_modify_page_title', 10, 3 );
     15add_filter( 'bbp_get_user_id', 'bbp_filter_user_id', 10, 3 );
     16add_filter( 'bbp_is_single_user', 'bbp_filter_is_single_user', 10, 1 );
     17add_filter( 'bbp_is_user_home', 'bbp_filter_is_user_home', 10, 1 );
    1318
    1419/** BuddyPress Helpers ********************************************************/
     
    7479    return $bbp_user_id;
    7580}
    76 add_filter( 'bbp_get_user_id', 'bbp_filter_user_id', 10, 3 );
    7781
    7882/**
     
    9195    return bp_is_user();
    9296}
    93 add_filter( 'bbp_is_single_user', 'bbp_filter_is_single_user', 10, 1 );
    9497
    9598/**
     
    108111    return bp_is_my_profile();
    109112}
    110 add_filter( 'bbp_is_user_home', 'bbp_filter_is_user_home', 10, 1 );
    111113
    112114/**
     
    144146    return $new_title;
    145147}
    146 add_action( 'bp_modify_page_title', 'bbp_filter_modify_page_title', 10, 3 );
    147148
    148149/** BuddyPress Screens ********************************************************/
  • trunk/src/includes/extend/buddypress/notifications.php

    r6141 r6180  
    11<?php
     2
     3/**
     4 * bbPress BuddyPress Notifications
     5 *
     6 * @package bbPress
     7 * @subpackage BuddyPress
     8 */
     9
     10// Exit if accessed directly
     11defined( 'ABSPATH' ) || exit;
     12
     13// Hooks
     14add_filter( 'bp_notifications_get_registered_components', 'bbp_filter_notifications_get_registered_components', 10 );
     15add_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10, 5 );
     16add_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10, 7 );
     17add_action( 'bbp_get_request', 'bbp_buddypress_mark_notifications', 1 );
     18
     19/** BuddyPress Helpers ********************************************************/
    220
    321/**
     
    2442    return $component_names;
    2543}
    26 add_filter( 'bp_notifications_get_registered_components', 'bbp_filter_notifications_get_registered_components', 10 );
    2744
    2845/**
     
    8097    return $return;
    8198}
    82 add_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10, 5 );
    8399
    84100/**
     
    127143        bp_notifications_add_notification( $args );
    128144    }
    129  
     145
    130146    // Notify the immediate reply author if not the current reply author
    131147    if ( ! empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) {
     
    135151    }
    136152}
    137 add_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10, 7 );
    138153
    139154/**
     
    185200    bbp_redirect( $redirect );
    186201}
    187 add_action( 'bbp_get_request', 'bbp_buddypress_mark_notifications', 1 );
Note: See TracChangeset for help on using the changeset viewer.