PluginProbe
bbPress / 2.0-beta-3
bbPress v2.0-beta-3
2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 72 releases
bbpress / bbp-admin / bbp-users.php

bbp-users.php in bbPress 2.0-beta-3, at bbp-admin/bbp-users.php

137 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 (PHP4 compat)
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 BBP_Users_Admin() {
36 $this->__construct();
37 }
38
39 /**
40 * The bbPress users admin loader
41 *
42 * @since bbPress (r2515)
43 *
44 * @uses BBP_Users_Admin::_setup_globals() Setup the globals needed
45 * @uses BBP_Users_Admin::_setup_actions() Setup the hooks and actions
46 */
47 function __construct() {
48 $this->_setup_globals();
49 $this->_setup_actions();
50 }
51
52 /**
53 * Setup the admin hooks, actions and filters
54 *
55 * @since bbPress (r2646)
56 * @access private
57 *
58 * @uses add_action() To add various actions
59 */
60 function _setup_actions() {
61
62 // User profile edit/display actions
63 add_action( 'edit_user_profile', array( $this, 'user_profile_forums' ) );
64 add_action( 'show_user_profile', array( $this, 'user_profile_forums' ) );
65
66 // User profile save actions
67 add_action( 'personal_options_update', array( $this, 'user_profile_update' ) );
68 add_action( 'edit_user_profile_update', array( $this, 'user_profile_update' ) );
69 }
70
71 /**
72 * Admin globals
73 *
74 * @since bbPress (r2646)
75 * @access private
76 */
77 function _setup_globals() { }
78
79 /**
80 * Add some general styling to the admin area
81 *
82 * @since bbPress (r2464)
83 *
84 * @uses bbp_get_forum_post_type() To get the forum post type
85 * @uses bbp_get_topic_post_type() To get the topic post type
86 * @uses bbp_get_reply_post_type() To get the reply post type
87 * @uses sanitize_html_class() To sanitize the classes
88 */
89 function admin_head() { }
90
91 /**
92 * Responsible for saving additional profile options and settings
93 *
94 * @todo Everything
95 *
96 * @since bbPress (r2464)
97 *
98 * @param $user_id The user id
99 * @uses do_action() Calls 'bbp_user_profile_update'
100 * @return bool Always false
101 */
102 function user_profile_update( $user_id ) {
103 return false;
104 }
105
106 /**
107 * Responsible for saving additional profile options and settings
108 *
109 * @todo Everything
110 *
111 * @since bbPress (r2464)
112 *
113 * @param WP_User $profileuser User data
114 * @uses do_action() Calls 'bbp_user_profile_forums'
115 * @return bool Always false
116 */
117 function user_profile_forums( $profileuser ) {
118 return false;
119 }
120 }
121 endif; // class exists
122
123 /**
124 * Setup bbPress Users Admin
125 *
126 * @since bbPress (r2596)
127 *
128 * @uses BBP_Replies_Admin
129 */
130 function bbp_users_admin() {
131 global $bbp;
132
133 $bbp->admin->users = new BBP_Users_Admin();
134 }
135
136 ?>
137