Changeset 9598 for trunk/src/bp-core/bp-core-options.php
- Timestamp:
- 03/05/2015 05:22:42 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-options.php
r9471 r9598 101 101 ); 102 102 103 /** 104 * Filters the default options to be set upon activation. 105 * 106 * @since BuddyPress (1.6.0) 107 * 108 * @param array $options Array of default options to set. 109 */ 103 110 return apply_filters( 'bp_get_default_options', $options ); 104 111 } … … 126 133 } 127 134 128 // Allow previously activated plugins to append their own options. 135 /** 136 * Fires after the addition of default options when BuddyPress is first activated. 137 * 138 * Allows previously activated plugins to append their own options. 139 * 140 * @since BuddyPress (1.6.0) 141 */ 129 142 do_action( 'bp_add_options' ); 130 143 } … … 154 167 } 155 168 156 // Allow previously activated plugins to append their own options. 169 /** 170 * Fires after the deletion of default options when BuddyPress is first deactivated. 171 * 172 * Allows previously activated plugins to append their own options. 173 * 174 * @since BuddyPress (1.6.0) 175 */ 157 176 do_action( 'bp_delete_options' ); 158 177 } … … 179 198 } 180 199 181 // Allow previously activated plugins to append their own options. 200 /** 201 * Fires after the addition of filters to each BuddyPress option. 202 * 203 * Allows previously activated plugins to append their own options. 204 * 205 * @since BuddyPress (1.6.0) 206 */ 182 207 do_action( 'bp_setup_option_filters' ); 183 208 } … … 188 213 * Currently unused. 189 214 * 190 * @since BuddyPress (1.6 )215 * @since BuddyPress (1.6.0) 191 216 * 192 217 * @param bool $value Optional. Default value false … … 219 244 * The 'bp_get_option' filter is primarily for backward-compatibility. 220 245 * 221 * @since BuddyPress (1. 5.0)246 * @since BuddyPress (1.2.0) 222 247 * 223 248 * @uses bp_get_root_blog_id() … … 230 255 function bp_get_option( $option_name, $default = '' ) { 231 256 $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default ); 257 258 /** 259 * Filters the option value for the requested option. 260 * 261 * @since BuddyPress (1.2.0) 262 * 263 * @param mixed $value The value for the option. 264 */ 232 265 return apply_filters( 'bp_get_option', $value ); 233 266 } … … 355 388 // On Multisite installations, some options must always be fetched from sitemeta 356 389 if ( is_multisite() ) { 390 391 /** 392 * Filters multisite options retrieved from sitemeta. 393 * 394 * @since BuddyPress (1.5.0) 395 * 396 * @param array $value Array of multisite options from sitemeta table. 397 */ 357 398 $network_options = apply_filters( 'bp_core_network_options', array( 358 399 'tags_blog_id' => '0', … … 431 472 } 432 473 474 /** 475 * Filters the global BP options. 476 * 477 * @since BuddyPress (1.5.0) 478 * 479 * @param array $root_blog_options_meta Array of global BP options. 480 */ 433 481 return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta ); 434 482 } … … 448 496 */ 449 497 function bp_disable_profile_sync( $default = false ) { 498 499 /** 500 * Filters whether or not profile syncing is disabled. 501 * 502 * @since BuddyPress (1.6.0) 503 * 504 * @param bool $value Whether or not syncing is disabled. 505 */ 450 506 return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) ); 451 507 } … … 464 520 */ 465 521 function bp_hide_loggedout_adminbar( $default = true ) { 522 523 /** 524 * Filters whether or not the toolbar is hidden for logged out users. 525 * 526 * @since BuddyPress (1.6.0) 527 * 528 * @param bool $value Whether or not the toolbar is hidden. 529 */ 466 530 return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) ); 467 531 } … … 479 543 */ 480 544 function bp_disable_avatar_uploads( $default = true ) { 545 546 /** 547 * Filters whether or not members are able to upload their own avatars. 548 * 549 * @since BuddyPress (1.6.0) 550 * 551 * @param bool $value Whether or not members are able to upload their own avatars. 552 */ 481 553 return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) ); 482 554 } … … 495 567 */ 496 568 function bp_disable_account_deletion( $default = false ) { 569 570 /** 571 * Filters whether or not members are able to delete their own accounts. 572 * 573 * @since BuddyPress (1.6.0) 574 * 575 * @param bool $value Whether or not members are able to delete their own accounts. 576 */ 497 577 return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) ); 498 578 } … … 512 592 */ 513 593 function bp_disable_blogforum_comments( $default = false ) { 594 595 /** 596 * Filters whether or not blog and forum activity stream comments are disabled. 597 * 598 * @since BuddyPress (1.6.0) 599 * 600 * @param bool $value Whether or not blog and forum activity stream comments are disabled. 601 */ 514 602 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) ); 515 603 } … … 528 616 */ 529 617 function bp_restrict_group_creation( $default = true ) { 618 619 /** 620 * Filters whether or not group creation is turned off. 621 * 622 * @since BuddyPress (1.6.0) 623 * 624 * @param bool $value Whether or not group creation is turned off. 625 */ 530 626 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) ); 531 627 } … … 543 639 */ 544 640 function bp_force_buddybar( $default = true ) { 641 642 /** 643 * Filters whether or not BuddyBar should be forced in place of WP Admin Bar. 644 * 645 * @since BuddyPress (1.6.0) 646 * 647 * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar. 648 */ 545 649 return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) ); 546 650 } … … 567 671 */ 568 672 function bp_get_group_forums_root_id( $default = '0' ) { 673 674 /** 675 * Filters the group forums root parent forum id. 676 * 677 * @since BuddyPress (1.6.0) 678 * 679 * @param int $value The group forums root parent forum id. 680 */ 569 681 return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bp_group_forums_root_id', $default ) ); 570 682 } … … 582 694 */ 583 695 function bp_is_group_forums_active( $default = true ) { 696 697 /** 698 * Filters whether or not BuddyPress Group Forums are enabled. 699 * 700 * @since BuddyPress (1.6.0) 701 * 702 * @param bool $value Whether or not BuddyPress Group Forums are enabled. 703 */ 584 704 return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bp_enable_group_forums', $default ) ); 585 705 } … … 597 717 */ 598 718 function bp_is_akismet_active( $default = true ) { 719 720 /** 721 * Filters whether or not Akismet is enabled. 722 * 723 * @since BuddyPress (1.6.0) 724 * 725 * @param bool $value Whether or not Akismet is enabled. 726 */ 599 727 return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) ); 600 728 } … … 612 740 */ 613 741 function bp_is_activity_heartbeat_active( $default = true ) { 742 743 /** 744 * Filters whether or not Activity Heartbeat refresh is enabled. 745 * 746 * @since BuddyPress (2.0.0) 747 * 748 * @param bool $value Whether or not Activity Heartbeat refresh is enabled. 749 */ 614 750 return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default ) ); 615 751 } … … 627 763 */ 628 764 function bp_get_theme_package_id( $default = 'legacy' ) { 765 766 /** 767 * Filters the current theme package ID. 768 * 769 * @since BuddyPress (1.7.0) 770 * 771 * @param string $value The current theme package ID. 772 */ 629 773 return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $default ) ); 630 774 }
Note: See TracChangeset
for help on using the changeset viewer.