Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2011 08:58:56 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Rename new 'bp-users' component to 'bp-members' for consistency through-out project.
Core, Messages, and Friends Components now use the BP_Component class.
Split Friends and Messages components into smaller files.
Change references to 'profile' to 'xprofile' through-out project for consistency.
Introduce 'bp_actions' and 'bp_screens' standard hooks to replace the usage of 'wp' through-out project.
Move component loader sequence into bp-core-bootstrap.php,
Move old root_component action into 1.3 deprecated file.

Location:
trunk/bp-members
Files:
1 copied
1 moved

Legend:

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

    r3916 r3917  
    2626 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    2727 */
    28 function bp_users_action_set_spammer_status() {
     28function bp_members_action_set_spammer_status() {
    2929    global $bp, $wpdb, $wp_version;
    3030
     
    8080            do_action( 'bp_make_spam_user', $bp->displayed_user->id );
    8181
    82         do_action( 'bp_users_action_set_spammer_status', $bp->displayed_user->id, $is_spam );
     82        do_action( 'bp_members_action_set_spammer_status', $bp->displayed_user->id, $is_spam );
    8383
    8484        bp_core_redirect( wp_get_referer() );
    8585    }
    8686}
    87 add_action( 'wp', 'bp_users_action_set_spammer_status', 3 );
     87add_action( 'bp_actions', 'bp_members_action_set_spammer_status' );
    8888
    8989/**
     
    9393 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    9494 */
    95 function bp_users_action_delete_user() {
     95function bp_members_action_delete_user() {
    9696    global $bp;
    9797
     
    112112        }
    113113
    114         do_action( 'bp_users_action_delete_user', $errors );
     114        do_action( 'bp_members_action_delete_user', $errors );
    115115
    116116        if ( $errors )
     
    120120    }
    121121}
    122 add_action( 'wp', 'bp_users_action_delete_user', 3 );
     122add_action( 'bp_actions', 'bp_members_action_delete_user' );
     123
     124/**
     125 * Returns the user_id for a user based on their username.
     126 *
     127 * @package BuddyPress Core
     128 * @param $username str Username to check.
     129 * @return false on no match
     130 * @return int the user ID of the matched user.
     131 */
     132function bp_core_get_random_member() {
     133    global $bp;
     134
     135    if ( isset( $_GET['random-member'] ) ) {
     136        $user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) );
     137        bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );
     138    }
     139}
     140add_action( 'bp_actions', 'bp_core_get_random_member' );
    123141
    124142?>
Note: See TracChangeset for help on using the changeset viewer.