Changeset 7468 for trunk/bp-forums/bp-forums-bbpress-sa.php
- Timestamp:
- 10/23/2013 06:47:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-bbpress-sa.php
r7298 r7468 1 1 <?php 2 2 /** 3 * BuddyPress bbPress 1.x integration 3 * BuddyPress bbPress 1.x integration. 4 4 * 5 5 * @package BuddyPress … … 10 10 if ( !defined( 'ABSPATH' ) ) exit; 11 11 12 /** 13 * Bootstrap bbPress 1.x, and manipulate globals to integrate with BuddyPress. 14 * 15 * @return bool|null Returns false on failure. 16 */ 12 17 function bp_forums_load_bbpress() { 13 18 global $bp, $wpdb, $wp_roles, $current_user, $wp_users_object; … … 122 127 add_action( 'bbpress_init', 'bp_forums_load_bbpress' ); 123 128 124 /* WP to bbP wrapper functions */ 129 /** WP to bbPress wrapper functions ******************************************/ 130 131 /** 132 * Get the current bbPress user. 133 * 134 * @return object $current_user Current user object from WordPress. 135 */ 125 136 function bb_get_current_user() { global $current_user; return $current_user; } 137 138 /** 139 * Get userdata for a bbPress user. 140 * 141 * @param int $user_id User ID. 142 * @return object User data from WordPress. 143 */ 126 144 function bb_get_user( $user_id ) { return get_userdata( $user_id ); } 145 146 /** 147 * Cache users. 148 * 149 * Noop. 150 * 151 * @param array $users 152 */ 127 153 function bb_cache_users( $users ) {} 128 154 … … 141 167 142 168 /** 143 * bbPress needs the DB class to be BPDB, but we want to use WPDB, so we can 144 * extend it and use this. 169 * bbPress needs the DB class to be BPDB, but we want to use WPDB, so we can extend it and use this. 145 170 * 146 171 * The class is pluggable, so that plugins that swap out WPDB with a custom … … 152 177 var $db_servers = array(); 153 178 179 /** 180 * Constructor 181 * 182 * @see WPDB::__construct() for description of parameters. 183 */ 154 184 function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) { 155 185 parent::__construct( $dbuser, $dbpassword, $dbname, $dbhost ); … … 165 195 * Determine if a database supports a particular feature. 166 196 * 167 * Overriden here to work around differences between bbPress', and WordPress', implementation differences. 168 * In particular, when BuddyPress tries to run bbPress' SQL installation script, the collation check always 169 * failed. The capability is long supported by WordPress' minimum required MySQL version, so this is safe. 197 * Overriden here to work around differences between bbPress's 198 * and WordPress's implementations. In particular, when 199 * BuddyPress tries to run bbPress' SQL installation script, 200 * the collation check always failed. The capability is long 201 * supported by WordPress' minimum required MySQL version, so 202 * this is safe. 203 * 204 * @see WPDB::has_cap() for a description of parameters and 205 * return values. 206 * 207 * @param string $db_cap See {@link WPDB::has_cap()}. 208 * @param string $_table_name See {@link WPDB::has_cap()}. 209 * @return bool See {@link WPDB::has_cap()}. 170 210 */ 171 211 function has_cap( $db_cap, $_table_name='' ) { … … 177 217 178 218 /** 179 * Initialises the class variables based on provided arguments. 180 * Based on, and taken from, the BackPress class in turn taken from the 1.0 branch of bbPress. 219 * Initialize the class variables based on provided arguments. 220 * 221 * Based on, and taken from, the BackPress class in turn taken 222 * from the 1.0 branch of bbPress. 223 * 224 * @see BBDB::__construct() for a description of params. 181 225 */ 182 226 function init( $args ) { … … 205 249 } 206 250 251 /** 252 * Stub for escape_deep() compatibility. 253 * 254 * @see WPDB::escape_deep() for description of parameters and 255 * return values. 256 * 257 * @param mixed $data See {@link WPDB::escape_deep()}. 258 * @return mixed $data See {@link WPDB::escape_deep()}. 259 */ 207 260 function escape_deep( $data ) { 208 261 return $this->escape( $data ); … … 211 264 endif; // class_exists( 'BPDB' ) 212 265 213 /* BBPress needs this function to convert vars */ 266 /** 267 * Convert object to given output format. 268 * 269 * bbPress needs this to convert vars. 270 * 271 * @param object $object Object to convert. 272 * @param string $output Type of object to return. OBJECT, ARRAY_A, or ARRAY_N. 273 */ 214 274 function backpress_convert_object( &$object, $output ) { 215 275 if ( is_array( $object ) ) { … … 226 286 227 287 /** 288 * Parse and execute queries for updating a set of database tables. 289 * 228 290 * Copied from wp-admin/includes/upgrade.php, this will take care of creating 229 291 * the bbPress stand-alone tables without loading a conflicting WP Admin. 230 292 * 231 * @param array $queries 232 * @param bool $execute Optional; defaults to true. 233 * @return array 293 * @see dbDelta() for a description of parameters and return value. 294 * 295 * @param array $queries See {@link dbDelta()}. 296 * @param bool $execute See {@link dbDelta()}. 297 * @return array See {@link dbDelta()}. 234 298 */ 235 299 function bp_bb_dbDelta($queries, $execute = true) {
Note: See TracChangeset
for help on using the changeset viewer.