Changeset 7451 for trunk/bp-core/bp-core-options.php
- Timestamp:
- 10/20/2013 07:21:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-options.php
r7228 r7451 2 2 3 3 /** 4 * BuddyPress Options 4 * BuddyPress Options. 5 5 * 6 6 * @package BuddyPress … … 12 12 13 13 /** 14 * Get the default site options and their values 15 * 16 * @since BuddyPress (1.6 )17 * 18 * @return array Filtered option names and values 14 * Get the default site options and their values. 15 * 16 * @since BuddyPress (1.6.0) 17 * 18 * @return array Filtered option names and values. 19 19 */ 20 20 function bp_get_default_options() { … … 87 87 88 88 /** 89 * Add default options 89 * Add default options when BuddyPress is first activated. 90 90 * 91 91 * Hooked to bp_activate, it is only called once when BuddyPress is activated. 92 92 * This is non-destructive, so existing settings will not be overridden. 93 93 * 94 * @since BuddyPress (1.6) 95 * 96 * @uses bp_get_default_options() To get default options 97 * @uses add_option() Adds default options 98 * @uses do_action() Calls 'bp_add_options' 94 * Currently unused. 95 * 96 * @since BuddyPress (1.6.0) 97 * 98 * @uses bp_get_default_options() To get default options. 99 * @uses add_option() Adds default options. 100 * @uses do_action() Calls 'bp_add_options'. 99 101 */ 100 102 function bp_add_options() { … … 112 114 113 115 /** 114 * Delete default options 116 * Delete default options. 115 117 * 116 118 * Hooked to bp_uninstall, it is only called once when BuddyPress is uninstalled. 117 119 * This is destructive, so existing settings will be destroyed. 118 120 * 119 * @since BuddyPress (1.6) 120 * 121 * @uses bp_get_default_options() To get default options 122 * @uses delete_option() Removes default options 123 * @uses do_action() Calls 'bp_delete_options' 121 * Currently unused. 122 * 123 * @since BuddyPress (1.6.0) 124 * 125 * @uses bp_get_default_options() To get default options. 126 * @uses delete_option() Removes default options. 127 * @uses do_action() Calls 'bp_delete_options'. 124 128 */ 125 129 function bp_delete_options() { … … 137 141 138 142 /** 139 * Add filters to each BuddyPress option and allow them to be overloaded from 140 * inside the $bp->options array. 141 * 142 * @since BuddyPress (1.6) 143 * 144 * @uses bp_get_default_options() To get default options 145 * @uses add_filter() To add filters to 'pre_option_{$key}' 146 * @uses do_action() Calls 'bp_add_option_filters' 143 * Add filters to each BP option, allowing them to be overloaded from inside the $bp->options array. 144 * 145 * Currently unused. 146 * 147 * @since BuddyPress (1.6.0) 148 * 149 * @uses bp_get_default_options() To get default options. 150 * @uses add_filter() To add filters to 'pre_option_{$key}'. 151 * @uses do_action() Calls 'bp_add_option_filters'. 147 152 */ 148 153 function bp_setup_option_filters() { … … 160 165 161 166 /** 162 * Filter default options and allow them to be overloaded from inside the 163 * $bp->options array. 167 * Filter default options and allow them to be overloaded from inside the $bp->options array. 168 * 169 * Currently unused. 164 170 * 165 171 * @since BuddyPress (1.6) … … 187 193 188 194 /** 189 * Retrieve an option 190 * 191 * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)192 * on the appropriate blog, given your current setup.195 * Retrieve an option. 196 * 197 * This is a wrapper for {@link get_blog_option()}, which in turn stores settings data 198 * (such as bp-pages) on the appropriate blog, given your current setup. 193 199 * 194 200 * The 'bp_get_option' filter is primarily for backward-compatibility. 195 201 * 196 * @package BuddyPress 197 * @since BuddyPress (1.5) 202 * @since BuddyPress (1.5.0) 198 203 * 199 204 * @uses bp_get_root_blog_id() 200 * @param string $option_name The option to be retrieved 201 * @param string $default Optional. Default value to be returned if the option isn't set 202 * @return mixed The value for the option 205 * 206 * @param string $option_name The option to be retrieved. 207 * @param string $default Optional. Default value to be returned if the option 208 * isn't set. See {@link get_blog_option()}. 209 * @return mixed The value for the option. 203 210 */ 204 211 function bp_get_option( $option_name, $default = '' ) { … … 209 216 210 217 /** 211 * Save an option 212 * 213 * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)214 * on the appropriate blog, given your current setup.215 * 216 * @package BuddyPress217 * @since BuddyPress (1.5 )218 * Save an option. 219 * 220 * This is a wrapper for {@link update_blog_option()}, which in turn stores 221 * settings data (such as bp-pages) on the appropriate blog, given your current 222 * setup. 223 * 224 * @since BuddyPress (1.5.0) 218 225 * 219 226 * @uses bp_get_root_blog_id() 220 * @param string $option_name The option key to be set 221 * @param string $value The value to be set 227 * 228 * @param string $option_name The option key to be set. 229 * @param string $value The value to be set. 222 230 */ 223 231 function bp_update_option( $option_name, $value ) { … … 226 234 227 235 /** 228 * Delete an option 229 * 230 * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as231 * bp-pages) on the appropriate blog, given your current setup.232 * 233 * @package BuddyPress234 * @since BuddyPress (1.5 )236 * Delete an option. 237 * 238 * This is a wrapper for {@link delete_blog_option()}, which in turn deletes 239 * settings data (such as bp-pages) on the appropriate blog, given your current 240 * setup. 241 * 242 * @since BuddyPress (1.5.0) 235 243 * 236 244 * @uses bp_get_root_blog_id() 237 * @param string $option_name The option key to be set 245 * 246 * @param string $option_name The option key to be deleted. 238 247 */ 239 248 function bp_delete_option( $option_name ) { … … 242 251 243 252 /** 244 * When switching from single to multisite we need to copy blog options to 245 * site options. 246 * 247 * This function is no longer used 248 * 249 * @package BuddyPress Core 250 * @deprecated Since BuddyPress (1.6) 253 * Copy BP options from a single site to multisite config. 254 * 255 * Run when switching from single to multisite and we need to copy blog options 256 * to site options. 257 * 258 * This function is no longer used. 259 * 260 * @deprecated 1.6.0 251 261 */ 252 262 function bp_core_activate_site_options( $keys = array() ) { … … 275 285 276 286 /** 287 * Fetch global BP options. 288 * 277 289 * BuddyPress uses common options to store configuration settings. Many of these 278 290 * settings are needed at run time. Instead of fetching them all and adding many 279 291 * initial queries to each page load, let's fetch them all in one go. 280 292 * 281 * @package BuddyPress Core 282 * @todo Use settings API and audit these methods 293 * @todo Use settings API and audit these methods. 294 * 295 * @return array $root_blog_options_meta List of options. 283 296 */ 284 297 function bp_core_get_root_options() { … … 376 389 * Is profile sycing disabled? 377 390 * 378 * @since BuddyPress (1.6) 379 * 380 * @param bool $default Optional.Default value true 381 * 382 * @uses bp_get_option() To get the profile sync option 383 * @return bool Is profile sync enabled or not 391 * @since BuddyPress (1.6.0) 392 * 393 * @uses bp_get_option() To get the profile sync option. 394 * 395 * @param bool $default Optional. Fallback value if not found in the database. 396 * Default: true. 397 * @return bool True if profile sync is enabled, otherwise false. 384 398 */ 385 399 function bp_disable_profile_sync( $default = true ) { … … 390 404 * Is the Toolbar hidden for logged out users? 391 405 * 392 * @since BuddyPress (1.6) 393 * 394 * @param bool $default Optional.Default value true 395 * 396 * @uses bp_get_option() To get the logged out Toolbar option 397 * @return bool Is logged out Toolbar enabled or not 406 * @since BuddyPress (1.6.0) 407 * 408 * @uses bp_get_option() To get the logged out Toolbar option. 409 * 410 * @param bool $default Optional. Fallback value if not found in the database. 411 * Default: true. 412 * @return bool True if the admin bar should be hidden for logged-out users, 413 * otherwise false. 398 414 */ 399 415 function bp_hide_loggedout_adminbar( $default = true ) { … … 404 420 * Are members able to upload their own avatars? 405 421 * 406 * @since BuddyPress (1.6) 407 * 408 * @param bool $default Optional. Default value true 409 * 410 * @uses bp_get_option() To get the avatar uploads option 411 * @return bool Are avatar uploads allowed? 422 * @since BuddyPress (1.6.0) 423 * 424 * @uses bp_get_option() To get the avatar uploads option. 425 * 426 * @param bool $default Optional. Fallback value if not found in the database. 427 * Default: true. 428 * @return bool True if avatar uploads are disabled, otherwise false. 412 429 */ 413 430 function bp_disable_avatar_uploads( $default = true ) { … … 418 435 * Are members able to delete their own accounts? 419 436 * 420 * @since BuddyPress (1.6) 421 * 422 * @param bool $default Optional. Default value 423 * 424 * @uses bp_get_option() To get the account deletion option 425 * @return bool Is account deletion allowed? 437 * @since BuddyPress (1.6.0) 438 * 439 * @uses bp_get_option() To get the account deletion option. 440 * 441 * @param bool $default Optional. Fallback value if not found in the database. 442 * Default: true. 443 * @return bool True if users are able to delete their own accounts, otherwise 444 * false. 426 445 */ 427 446 function bp_disable_account_deletion( $default = false ) { … … 432 451 * Are blog and forum activity stream comments disabled? 433 452 * 434 * @since BuddyPress (1.6) 435 * 436 * @param bool $default Optional. Default value false 437 * @todo split and move into blog and forum components 438 * @uses bp_get_option() To get the blog/forum comments option 439 * @return bool Is blog/forum comments allowed? 453 * @since BuddyPress (1.6.0) 454 * 455 * @todo split and move into blog and forum components. 456 * @uses bp_get_option() To get the blog/forum comments option. 457 * 458 * @param bool $default Optional. Fallback value if not found in the database. 459 * Default: false. 460 * @return bool True if activity comments are disabled for blog and forum 461 * items, otherwise false. 440 462 */ 441 463 function bp_disable_blogforum_comments( $default = false ) { … … 446 468 * Is group creation turned off? 447 469 * 448 * @since BuddyPress (1.6) 449 * 450 * @param bool $default Optional. Default value true 451 * 452 * @todo Move into groups component 453 * @uses bp_get_option() To get the group creation 454 * @return bool Allow group creation? 470 * @since BuddyPress (1.6.0) 471 * 472 * @todo Move into groups component. 473 * @uses bp_get_option() To get the group creation. 474 * 475 * @param bool $default Optional. Fallback value if not found in the database. 476 * Default: true. 477 * @return bool True if group creation is restricted, otherwise false. 455 478 */ 456 479 function bp_restrict_group_creation( $default = true ) { … … 459 482 460 483 /** 461 * Have we migrated to using the WordPress Toolbar?462 * 463 * @since BuddyPress (1.6 )464 * 465 * @ param bool $default Optional. Default value true466 * 467 * @ todo Move into groups component468 * @uses bp_get_option() To get the WP editor option469 * @return bool Use WP editor?484 * Should the old BuddyBar be forced in place of the WP admin bar? 485 * 486 * @since BuddyPress (1.6.0) 487 * 488 * @uses bp_get_option() To get the BuddyBar option. 489 * 490 * @param bool $default Optional. Fallback value if not found in the database. 491 * Default: true. 492 * @return bool True if the BuddyBar should be forced on, otherwise false. 470 493 */ 471 494 function bp_force_buddybar( $default = true ) { … … 474 497 475 498 /** 476 * Output the group forums root parent forum id 477 * 478 * @since BuddyPress (1.6 )479 * 480 * @param bool $default Optional. Default value499 * Output the group forums root parent forum id. 500 * 501 * @since BuddyPress (1.6.0) 502 * 503 * @param bool $default Optional. Default: '0'. 481 504 */ 482 505 function bp_group_forums_root_id( $default = '0' ) { … … 484 507 } 485 508 /** 486 * Return the group forums root parent forum id 509 * Return the group forums root parent forum id. 487 510 * 488 * @since BuddyPress (1.6 )511 * @since BuddyPress (1.6.0) 489 512 * 490 * @ param bool $default Optional. Default value 0513 * @uses bp_get_option() To get the root forum ID from the database. 491 514 * 492 * @ uses bp_get_option() To get the maximum title length493 * @return int Is anonymous posting allowed?515 * @param bool $default Optional. Default: '0'. 516 * @return int The ID of the group forums root forum. 494 517 */ 495 518 function bp_get_group_forums_root_id( $default = '0' ) { … … 498 521 499 522 /** 500 * Checks if BuddyPress Group Forums are enabled 501 * 502 * @since BuddyPress (1.6) 503 * 504 * @param bool $default Optional. Default value true 505 * 506 * @uses bp_get_option() To get the group forums option 507 * @return bool Is group forums enabled or not 523 * Check whether BuddyPress Group Forums are enabled. 524 * 525 * @since BuddyPress (1.6.0) 526 * 527 * @uses bp_get_option() To get the group forums option. 528 * 529 * @param bool $default Optional. Fallback value if not found in the database. 530 * Default: true. 531 * @return bool True if group forums are active, otherwise false. 508 532 */ 509 533 function bp_is_group_forums_active( $default = true ) { … … 512 536 513 537 /** 514 * Checks if Akismet is enabled 515 * 516 * @since BuddyPress (1.6) 517 * 518 * @param bool $default Optional. Default value true 519 * 520 * @uses bp_get_option() To get the Akismet option 521 * @return bool Is Akismet enabled or not 538 * Check whether Akismet is enabled. 539 * 540 * @since BuddyPress (1.6.0) 541 * 542 * @uses bp_get_option() To get the Akismet option. 543 * 544 * @param bool $default Optional. Fallback value if not found in the database. 545 * Default: true. 546 * @return bool True if Akismet is enabled, otherwise false. 522 547 */ 523 548 function bp_is_akismet_active( $default = true ) { … … 526 551 527 552 /** 528 * Get the current theme package ID 529 * 530 * @since BuddyPress (1.7) 531 * 532 * @param string $default Optional. Default value 'default' 533 * @uses get_option() To get the subtheme option 534 * @return string ID of the subtheme 553 * Get the current theme package ID. 554 * 555 * @since BuddyPress (1.7.0) 556 * 557 * @uses get_option() To get the theme package option. 558 * 559 * @param bool $default Optional. Fallback value if not found in the database. 560 * Default: 'legacy'. 561 * @return string ID of the theme package. 535 562 */ 536 563 function bp_get_theme_package_id( $default = 'legacy' ) {
Note: See TracChangeset
for help on using the changeset viewer.