Changeset 5508 for trunk/bp-core/bp-core-options.php
- Timestamp:
- 12/11/2011 05:47:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-options.php
r5304 r5508 25 25 /** DB Version ********************************************************/ 26 26 27 '_bp_db_version' => '155',27 '_bp_db_version' => '155', 28 28 29 29 /** Settings **********************************************************/ 30 30 31 // Lock post editing after 5 minutes32 ' _bp_edit_lock' => '5',33 34 // Throttle post time to 10 seconds35 ' _bp_throttle_time' => '10',36 37 // Favorites38 ' _bp_enable_favorites' => true,39 40 // Subscriptions41 ' _bp_enable_subscriptions'=> true,31 // Disable the WP to BP profile sync 32 'bp-disable-profile-sync' => false, 33 34 // Hide the admin bar for logged out users 35 'hide-loggedout-adminbar' => false, 36 37 // Avatar uploads 38 'bp-disable-avatar-uploads' => false, 39 40 // Allow users to delete their own accounts 41 'bp-disable-account-deletion' => true, 42 42 43 43 // Allow anonymous posting 44 '_bp_allow_anonymous' => false, 45 46 // Users from all sites can post 47 '_bp_allow_global_access' => false, 48 49 // Use the WordPress editor if available 50 '_bp_use_wp_editor' => true, 51 52 /** Per Page **********************************************************/ 53 54 // Topics per page 55 '_bp_topics_per_page' => '15', 56 57 // Replies per page 58 '_bp_replies_per_page' => '15', 59 60 // Forums per page 61 '_bp_forums_per_page' => '50', 62 63 // Topics per RSS page 64 '_bp_topics_per_rss_page' => '25', 65 66 // Replies per RSS page 67 '_bp_replies_per_rss_page' => '25', 68 69 /** Page For **********************************************************/ 70 71 // Page for forums 72 '_bp_page_for_forums' => '0', 73 74 // Page for forums 75 '_bp_page_for_topics' => '0', 76 77 // Page for login 78 '_bp_page_for_login' => '0', 79 80 // Page for register 81 '_bp_page_for_register' => '0', 82 83 // Page for lost-pass 84 '_bp_page_for_lost_pass' => '0', 85 86 /** Archive Slugs *****************************************************/ 87 88 // Forum archive slug 89 '_bp_root_slug' => 'forums', 90 91 // Topic archive slug 92 '_bp_topic_archive_slug' => 'topics', 93 94 /** Single Slugs ******************************************************/ 95 96 // Include Forum archive before single slugs 97 '_bp_include_root' => true, 98 99 // Forum slug 100 '_bp_forum_slug' => 'forum', 101 102 // Topic slug 103 '_bp_topic_slug' => 'topic', 104 105 // Reply slug 106 '_bp_reply_slug' => 'reply', 107 108 // Topic tag slug 109 '_bp_topic_tag_slug' => 'topic-tag', 110 111 /** Other Slugs *******************************************************/ 112 113 // User profile slug 114 '_bp_user_slug' => 'users', 115 116 // View slug 117 '_bp_view_slug' => 'view', 118 119 /** Topics ************************************************************/ 120 121 // Title Max Length 122 '_bp_title_max_length' => '80', 123 124 /** BuddyPress ********************************************************/ 125 126 // Enable BuddyPress Group Extension 127 '_bbp_enable_group_forums' => true, 128 129 // Group Forums parent forum id 130 '_bbp_group_forums_root_id' => '0', 44 'bp-disable-blogforum-comments' => true, 45 46 // Use the WordPress editor when possible 47 '_bp_use_wp_editor' => false, 48 49 /** Groups ************************************************************/ 50 51 // @todo Move this into the groups component 52 53 // Restrict group creation to super admins 54 'bp_restrict_group_creation' => false, 55 56 // Root forum ID for groups 57 '_bbp_group_forums_root_id' => 0, 131 58 132 59 /** Akismet ***********************************************************/ … … 163 90 do_action( 'bp_add_options' ); 164 91 } 92 165 93 /** 166 94 * Delete default options … … 190 118 /** 191 119 * Add filters to each BuddyPress option and allow them to be overloaded from 192 * inside the $b bp->options array.120 * inside the $bp->options array. 193 121 * 194 122 * @since BuddyPress (1.6) … … 213 141 /** 214 142 * Filter default options and allow them to be overloaded from inside the 215 * $b bp->options array.216 * 217 * @since BuddyPress (1.6) 218 * 219 * @global BuddyPress $b bp143 * $bp->options array. 144 * 145 * @since BuddyPress (1.6) 146 * 147 * @global BuddyPress $bp 220 148 * @param bool $value Optional. Default value false 221 149 * @return mixed false if not overloaded, mixed if set 222 150 */ 223 151 function bp_pre_get_option( $value = false ) { 224 global $b bp;152 global $bp; 225 153 226 154 // Get the name of the current filter so we can manipulate it … … 231 159 232 160 // Check the options global for preset value 233 if ( !empty( $b bp->options[$option] ) )234 $value = $b bp->options[$option];161 if ( !empty( $bp->options[$option] ) ) 162 $value = $bp->options[$option]; 235 163 236 164 // Always return a value, even if false … … 241 169 242 170 /** 243 * Checks if favorites feature is enabled.171 * Is profile sycing disabled? 244 172 * 245 173 * @since BuddyPress (1.6) … … 247 175 * @param $default bool Optional.Default value true 248 176 * 249 * @uses get_option() To get the favoritesoption250 * @return bool Is favoritesenabled or not251 */ 252 function bp_ is_favorites_active( $default = true ) {253 return (bool) apply_filters( 'bp_ is_favorites_active', (bool) get_option( '_bp_enable_favorites', $default ) );254 } 255 256 /** 257 * Checks if subscription feature is enabled.177 * @uses get_option() To get the profile sync option 178 * @return bool Is profile sync enabled or not 179 */ 180 function bp_disable_profile_sync( $default = true ) { 181 return (bool) apply_filters( 'bp_disable_profile_sync', (bool) get_option( 'bp-disable-profile-sync', $default ) ); 182 } 183 184 /** 185 * Is the admin bar hidden for logged out users? 258 186 * 259 187 * @since BuddyPress (1.6) … … 261 189 * @param $default bool Optional.Default value true 262 190 * 263 * @uses get_option() To get the subscriptionsoption264 * @return bool Is subscriptionenabled or not265 */ 266 function bp_ is_subscriptions_active( $default = true ) {267 return (bool) apply_filters( 'bp_ is_subscriptions_active', (bool) get_option( '_bp_enable_subscriptions', $default ) );268 } 269 270 /** 271 * Are topic and reply revisions allowed191 * @uses get_option() To get the logged out admin bar option 192 * @return bool Is logged out admin bar enabled or not 193 */ 194 function bp_hide_loggedout_adminbar( $default = true ) { 195 return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) get_option( 'hide-loggedout-adminbar', $default ) ); 196 } 197 198 /** 199 * Are members able to upload their own avatars? 272 200 * 273 201 * @since BuddyPress (r3412) … … 275 203 * @param $default bool Optional. Default value true 276 204 * 277 * @uses get_option() To get the a llow revisions278 * @return bool Are revisions allowed?279 */ 280 function bp_ allow_revisions( $default = true ) {281 return (bool) apply_filters( 'bp_ allow_revisions', (bool) get_option( '_bp_allow_revisions', $default ) );282 } 283 284 /** 285 * Is the anonymous posting allowed?205 * @uses get_option() To get the avatar uploads option 206 * @return bool Are avatar uploads allowed? 207 */ 208 function bp_disable_avatar_uploads( $default = true ) { 209 return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) get_option( 'bp-disable-avatar-uploads', $default ) ); 210 } 211 212 /** 213 * Are members able to delete their own accounts 286 214 * 287 215 * @since BuddyPress (1.6) … … 289 217 * @param $default bool Optional. Default value 290 218 * 291 * @uses get_option() To get the a llow anonymousoption292 * @return bool Is a nonymous postingallowed?293 */ 294 function bp_ allow_anonymous( $default = false ) {295 return apply_filters( 'bp_ allow_anonymous', (bool) get_option( '_bp_allow_anonymous', $default ) );296 } 297 298 /** 299 * Is this community available to all users on all sites in this installation?219 * @uses get_option() To get the account deletion option 220 * @return bool Is account deletion allowed? 221 */ 222 function bp_disable_account_deletion( $default = false ) { 223 return apply_filters( 'bp_disable_account_deletion', (bool) get_option( 'bp-disable-account-deletion', $default ) ); 224 } 225 226 /** 227 * Are blog and forum activity stream comments disabled 300 228 * 301 229 * @since BuddyPress (1.6) 302 230 * 303 231 * @param $default bool Optional. Default value false 304 * 305 * @uses get_option() To get the global access option306 * @return bool Is global access allowed?307 */ 308 function bp_ allow_global_access( $default = false ) {309 return (bool) apply_filters( 'bp_ allow_global_access', (bool) get_option( '_bp_allow_global_access', $default ) );310 } 311 312 /** 313 * Use the WordPress editor if available232 * @todo split and move into blog and forum components 233 * @uses get_option() To get the blog/forum comments option 234 * @return bool Is blog/forum comments allowed? 235 */ 236 function bp_disable_blogforum_comments( $default = false ) { 237 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) get_option( 'bp-disable-blogforum-comments', $default ) ); 238 } 239 240 /** 241 * Is group creation turned off? 314 242 * 315 243 * @since BuddyPress (r3386) … … 317 245 * @param $default bool Optional. Default value true 318 246 * 247 * @todo Move into groups component 248 * @uses get_option() To get the group creation 249 * @return bool Allow group creation? 250 */ 251 function bp_restrict_group_creation( $default = true ) { 252 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) get_option( 'bp_restrict_group_creation', $default ) ); 253 } 254 255 /** 256 * Have we migrated to using the WordPress admin bar? 257 * 258 * @since BuddyPress (r3386) 259 * 260 * @param $default bool Optional. Default value true 261 * 262 * @todo Move into groups component 319 263 * @uses get_option() To get the WP editor option 320 264 * @return bool Use WP editor? 321 265 */ 266 function bp_force_buddybar( $default = true ) { 267 return (bool) apply_filters( 'bp_force_buddybar', (bool) get_option( 'bp-force-buddybar', $default ) ); 268 } 269 270 /** 271 * Use the WordPress editor if available 272 * 273 * @since BuddyPress (r3386) 274 * 275 * @param $default bool Optional. Default value true 276 * 277 * @uses get_option() To get the WP editor option 278 * @return bool Use WP editor? 279 */ 322 280 function bp_use_wp_editor( $default = true ) { 323 281 return (bool) apply_filters( 'bp_use_wp_editor', (bool) get_option( '_bp_use_wp_editor', $default ) ); … … 325 283 326 284 /** 327 * Output the maximum length of a title328 *329 * @since BuddyPress (r3246)330 *331 * @param $default bool Optional. Default value 80332 */333 function bp_title_max_length( $default = '80' ) {334 echo bp_get_title_max_length( $default );335 }336 /**337 * Return the maximum length of a title338 *339 * @since BuddyPress (1.6)340 *341 * @param $default bool Optional. Default value 80342 *343 * @uses get_option() To get the maximum title length344 * @return int Is anonymous posting allowed?345 */346 function bp_get_title_max_length( $default = '80' ) {347 return (int) apply_filters( 'bp_get_title_max_length', (int) get_option( '_bp_title_max_length', $default ) );348 }349 350 /**351 285 * Output the group forums root parent forum id 352 286 * … … 359 293 } 360 294 /** 361 * Return the gro p forums root parent forum id295 * Return the group forums root parent forum id 362 296 * 363 297 * @since BuddyPress (1.6)
Note: See TracChangeset
for help on using the changeset viewer.