| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* bbPress Users Admin Class |
| 5 |
* |
| 6 |
* @package bbPress |
| 7 |
* @subpackage Administration |
| 8 |
*/ |
| 9 |
|
| 10 |
// Exit if accessed directly |
| 11 |
if ( !defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
if ( !class_exists( 'BBP_Users_Admin' ) ) : |
| 14 |
/** |
| 15 |
* Loads bbPress users admin area |
| 16 |
* |
| 17 |
* @package bbPress |
| 18 |
* @subpackage Administration |
| 19 |
* @since bbPress (r2464) |
| 20 |
*/ |
| 21 |
class BBP_Users_Admin { |
| 22 |
|
| 23 |
/** Variables *************************************************************/ |
| 24 |
|
| 25 |
/** Functions *************************************************************/ |
| 26 |
|
| 27 |
/** |
| 28 |
* The bbPress users admin loader |
| 29 |
* |
| 30 |
* @since bbPress (r2515) |
| 31 |
* |
| 32 |
* @uses BBP_Users_Admin::setup_globals() Setup the globals needed |
| 33 |
* @uses BBP_Users_Admin::setup_actions() Setup the hooks and actions |
| 34 |
*/ |
| 35 |
function __construct() { |
| 36 |
$this->setup_globals(); |
| 37 |
$this->setup_actions(); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Setup the admin hooks, actions and filters |
| 42 |
* |
| 43 |
* @since bbPress (r2646) |
| 44 |
* @access private |
| 45 |
* |
| 46 |
* @uses add_action() To add various actions |
| 47 |
*/ |
| 48 |
function setup_actions() { |
| 49 |
|
| 50 |
// User profile edit/display actions |
| 51 |
add_action( 'edit_user_profile', array( $this, 'user_profile_forums' ) ); |
| 52 |
add_action( 'show_user_profile', array( $this, 'user_profile_forums' ) ); |
| 53 |
|
| 54 |
// User profile save actions |
| 55 |
add_action( 'personal_options_update', array( $this, 'user_profile_update' ) ); |
| 56 |
add_action( 'edit_user_profile_update', array( $this, 'user_profile_update' ) ); |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Admin globals |
| 61 |
* |
| 62 |
* @since bbPress (r2646) |
| 63 |
* @access private |
| 64 |
*/ |
| 65 |
function setup_globals() { } |
| 66 |
|
| 67 |
/** |
| 68 |
* Add some general styling to the admin area |
| 69 |
* |
| 70 |
* @since bbPress (r2464) |
| 71 |
* |
| 72 |
* @uses bbp_get_forum_post_type() To get the forum post type |
| 73 |
* @uses bbp_get_topic_post_type() To get the topic post type |
| 74 |
* @uses bbp_get_reply_post_type() To get the reply post type |
| 75 |
* @uses sanitize_html_class() To sanitize the classes |
| 76 |
*/ |
| 77 |
function admin_head() { } |
| 78 |
|
| 79 |
/** |
| 80 |
* Responsible for saving additional profile options and settings |
| 81 |
* |
| 82 |
* @since bbPress (r2464) |
| 83 |
* |
| 84 |
* @param $user_id The user id |
| 85 |
* @uses do_action() Calls 'bbp_user_profile_update' |
| 86 |
* @return bool Always false |
| 87 |
*/ |
| 88 |
function user_profile_update( $user_id ) { } |
| 89 |
|
| 90 |
/** |
| 91 |
* Responsible for saving additional profile options and settings |
| 92 |
* |
| 93 |
* @since bbPress (r2464) |
| 94 |
* |
| 95 |
* @param WP_User $profileuser User data |
| 96 |
* @uses do_action() Calls 'bbp_user_profile_forums' |
| 97 |
* @return bool Always false |
| 98 |
*/ |
| 99 |
function user_profile_forums( $profileuser ) { } |
| 100 |
} |
| 101 |
endif; // class exists |
| 102 |
|