Changeset 13903 for trunk/src/bp-core/bp-core-options.php
- Timestamp:
- 06/04/2024 02:30:49 AM (20 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-options.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-options.php
r13890 r13903 24 24 25 25 // Default options. 26 $options = array (26 $options = array( 27 27 28 28 /* Components ********************************************************/ … … 64 64 65 65 // Allow Group Activity Deletions. 66 'bp-disable-group-activity-deletions' => false,66 'bp-disable-group-activity-deletions' => false, 67 67 68 68 // Allow users to delete their own accounts. … … 312 312 function bp_core_activate_site_options( $keys = array() ) { 313 313 314 if ( ! empty( $keys ) && is_array( $keys ) ) {314 if ( ! empty( $keys ) && is_array( $keys ) ) { 315 315 $bp = buddypress(); 316 316 … … 321 321 $bp->site_options[ $key ] = bp_get_option( $key, $default ); 322 322 323 if ( ! bp_update_option( $key, $bp->site_options[ $key ] ) ) {323 if ( ! bp_update_option( $key, $bp->site_options[ $key ] ) ) { 324 324 $errors = true; 325 325 } … … 365 365 if ( false === $root_blog_options_meta ) { 366 366 $blog_options_keys = "'" . join( "', '", (array) $root_blog_option_keys ) . "'"; 367 $blog_options_table = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options';367 $blog_options_table = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options'; 368 368 $blog_options_query = "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )"; 369 369 $root_blog_options_meta = $wpdb->get_results( $blog_options_query ); … … 379 379 * @param array $value Array of multisite options from sitemeta table. 380 380 */ 381 $network_options = apply_filters( 'bp_core_network_options', array( 382 'tags_blog_id' => '0', 383 'sitewide_tags_blog' => '', 384 'registration' => '0', 385 'fileupload_maxk' => '1500' 386 ) ); 381 $network_options = apply_filters( 382 'bp_core_network_options', 383 array( 384 'tags_blog_id' => '0', 385 'sitewide_tags_blog' => '', 386 'registration' => '0', 387 'fileupload_maxk' => '1500', 388 ) 389 ); 387 390 388 391 $current_site = get_current_site(); … … 398 401 // Loop through our results and make them usable. 399 402 foreach ( $root_blog_options_meta as $root_blog_option ) { 400 $root_blog_options[ $root_blog_option->name] = $root_blog_option->value;403 $root_blog_options[ $root_blog_option->name ] = $root_blog_option->value; 401 404 } 402 405 … … 594 597 * @since 14.0.0 595 598 * 596 * @param bool $ defaultOptional. Fallback value if not found in the database.597 * Default: false.599 * @param bool $retval Optional. Fallback value if not found in the database. 600 * Default: false. 598 601 * @return bool True if group activity deletions are disabled, otherwise false. 599 602 */ 600 function bp_disable_group_activity_deletions( $ default= false ) {603 function bp_disable_group_activity_deletions( $retval = false ) { 601 604 602 605 /** … … 605 608 * @since 14.0.0 606 609 * 607 * @param bool $value Whether or not group creator, group admin or group mod are able to delete group activity post. 608 */ 609 return (bool) apply_filters( 'bp_disable_group_activity_deletions', (bool) bp_get_option( 'bp-disable-group-activity-deletions', $default ) ); 610 * @param bool $disable_group_deletions Whether or not group creator, 611 * group admin or group mod are able to delete group activity post. 612 */ 613 return (bool) apply_filters( 'bp_disable_group_activity_deletions', (bool) bp_get_option( 'bp-disable-group-activity-deletions', $retval ) ); 610 614 } 611 615 … … 615 619 * @since 1.6.0 616 620 * 617 * @param bool $ defaultOptional. Fallback value if not found in the database.618 * Default: true.621 * @param bool $retval Optional. Fallback value if not found in the database. 622 * Default: true. 619 623 * @return bool True if users are able to delete their own accounts, otherwise 620 624 * false. 621 625 */ 622 function bp_disable_account_deletion( $ default= false ) {626 function bp_disable_account_deletion( $retval = false ) { 623 627 624 628 /** … … 627 631 * @since 1.6.0 628 632 * 629 * @param bool $ valueWhether or not members are able to delete their own accounts.630 */ 631 return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $ default) );633 * @param bool $disable_account_deletion Whether or not members are able to delete their own accounts. 634 */ 635 return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $retval ) ); 632 636 } 633 637 … … 639 643 * @todo split and move into blog and forum components. 640 644 * 641 * @param bool $ defaultOptional. Fallback value if not found in the database.642 * Default: false.645 * @param bool $retval Optional. Fallback value if not found in the database. 646 * Default: false. 643 647 * @return bool True if activity comments are disabled for blog and forum 644 648 * items, otherwise false. 645 649 */ 646 function bp_disable_blogforum_comments( $ default= false ) {650 function bp_disable_blogforum_comments( $retval = false ) { 647 651 648 652 /** … … 651 655 * @since 1.6.0 652 656 * 653 * @param bool $ valueWhether or not blog and forum activity stream comments are disabled.654 */ 655 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $ default) );657 * @param bool $disable_blog_forum_comments Whether or not blog and forum activity stream comments are disabled. 658 */ 659 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $retval ) ); 656 660 } 657 661 … … 663 667 * @todo Move into groups component. 664 668 * 665 * @param bool $ defaultOptional. Fallback value if not found in the database.666 * Default: true.669 * @param bool $retval Optional. Fallback value if not found in the database. 670 * Default: true. 667 671 * @return bool True if group creation is restricted, otherwise false. 668 672 */ 669 function bp_restrict_group_creation( $ default= true ) {673 function bp_restrict_group_creation( $retval = true ) { 670 674 671 675 /** … … 674 678 * @since 1.6.0 675 679 * 676 * @param bool $ valueWhether or not group creation is turned off.677 */ 678 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $ default) );680 * @param bool $group_creation Whether or not group creation is turned off. 681 */ 682 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $retval ) ); 679 683 } 680 684 … … 684 688 * @since 1.6.0 685 689 * 686 * @param bool $ defaultOptional. Fallback value if not found in the database.687 * Default: true.690 * @param bool $retval Optional. Fallback value if not found in the database. 691 * Default: true. 688 692 * @return bool True if Akismet is enabled, otherwise false. 689 693 */ 690 function bp_is_akismet_active( $ default= true ) {694 function bp_is_akismet_active( $retval = true ) { 691 695 692 696 /** … … 695 699 * @since 1.6.0 696 700 * 697 * @param bool $ valueWhether or not Akismet is enabled.698 */ 699 return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $ default) );701 * @param bool $akismet Whether or not Akismet is enabled. 702 */ 703 return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $retval ) ); 700 704 } 701 705 … … 705 709 * @since 2.0.0 706 710 * 707 * @param bool $ defaultOptional. Fallback value if not found in the database.708 * Default: true.711 * @param bool $retval Optional. Fallback value if not found in the database. 712 * Default: true. 709 713 * @return bool True if Heartbeat refresh is enabled, otherwise false. 710 714 */ 711 function bp_is_activity_heartbeat_active( $ default= true ) {715 function bp_is_activity_heartbeat_active( $retval = true ) { 712 716 713 717 /** … … 716 720 * @since 2.0.0 717 721 * 718 * @param bool $ value Whether or not Activity Heartbeat refresh is enabled.719 */ 720 return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $ default) );722 * @param bool $heartbeat_active Whether or not Activity Heartbeat refresh is enabled. 723 */ 724 return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $retval ) ); 721 725 } 722 726 … … 739 743 * @param string $package_id The current theme package ID. 740 744 */ 741 return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $package_id ) );742 } 745 return apply_filters( 'bp_get_theme_package_id', (string) bp_get_option( '_bp_theme_package_id', $package_id ) ); 746 }
Note: See TracChangeset
for help on using the changeset viewer.