Changeset 13968
- Timestamp:
- 07/23/2024 01:13:42 AM (8 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-moderation.php
r13903 r13968 56 56 * @param string $content The content being posted. 57 57 * @param string $error_type The error type to return. Either 'bool' or 'wp_error'. 58 * @return bool|WP_Error True if test is passed, false if fail.58 * @return bool|WP_Error True if test is passed, false if it fails. 59 59 */ 60 60 function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) { -
trunk/src/bp-core/bp-core-options.php
r13903 r13968 4 4 * 5 5 * @package BuddyPress 6 * @subpackage Options6 * @subpackage Core 7 7 * @since 1.6.0 8 8 */ … … 229 229 * @since 1.5.0 230 230 * 231 * @param string $option_name The option to be retrieved.232 * @param string $default 233 * isn't set. See {@link get_blog_option()}.231 * @param string $option_name The option to be retrieved. 232 * @param string $default_value Optional. Default value to be returned if the option 233 * isn't set. See {@link get_blog_option()}. 234 234 * @return mixed The value for the option. 235 235 */ 236 function bp_get_option( $option_name, $default = '' ) {237 $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );236 function bp_get_option( $option_name, $default_value = '' ) { 237 $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default_value ); 238 238 239 239 /** … … 345 345 * 346 346 * @todo Use settings API and audit these methods. 347 * 348 * @global wpdb $wpdb WordPress database object. 347 349 * 348 350 * @return array $root_blog_options_meta List of options. … … 427 429 * 428 430 * "Root options" are those that apply across an entire installation, and are fetched only a single 429 * time during a page load and stored in `buddypress()->site_options` to prevent future lookups.431 * time during a page load and stored in `buddypress()->site_options` to prevent future lookups. 430 432 * See {@see bp_core_get_root_options()}. 431 433 * … … 457 459 * @since 1.6.0 458 460 * 459 * @param bool $default Optional. Fallback value if not found in the database.460 * Default: true.461 * @param bool $default_value Optional. Fallback value if not found in the database. 462 * Default: true. 461 463 * @return bool True if profile sync is enabled, otherwise false. 462 464 */ 463 function bp_disable_profile_sync( $default = false ) {465 function bp_disable_profile_sync( $default_value = false ) { 464 466 465 467 /** … … 468 470 * @since 1.6.0 469 471 * 470 * @param bool $ valueWhether or not syncing is disabled.471 */ 472 return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );472 * @param bool $profile_sync Whether or not syncing is disabled. 473 */ 474 return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default_value ) ); 473 475 } 474 476 … … 478 480 * @since 1.6.0 479 481 * 480 * @param bool $default Optional. Fallback value if not found in the database.481 * Default: true.482 * @param bool $default_value Optional. Fallback value if not found in the database. 483 * Default: true. 482 484 * @return bool True if the admin bar should be hidden for logged-out users, 483 485 * otherwise false. 484 486 */ 485 function bp_hide_loggedout_adminbar( $default = true ) {487 function bp_hide_loggedout_adminbar( $default_value = true ) { 486 488 487 489 /** … … 490 492 * @since 1.6.0 491 493 * 492 * @param bool $ valueWhether or not the toolbar is hidden.493 */ 494 return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );494 * @param bool $hide_loggedout_adminar_bar Whether or not the toolbar is hidden. 495 */ 496 return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default_value ) ); 495 497 } 496 498 … … 500 502 * @since 1.6.0 501 503 * 502 * @param bool $default Optional. Fallback value if not found in the database.503 * Default: true.504 * @param bool $default_value Optional. Fallback value if not found in the database. 505 * Default: true. 504 506 * @return bool True if avatar uploads are disabled, otherwise false. 505 507 */ 506 function bp_disable_avatar_uploads( $default = true ) {508 function bp_disable_avatar_uploads( $default_value = true ) { 507 509 508 510 /** … … 511 513 * @since 1.6.0 512 514 * 513 * @param bool $ valueWhether or not members are able to upload their own avatars.514 */ 515 return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );515 * @param bool $disable_avatar Whether or not members are able to upload their own avatars. 516 */ 517 return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default_value ) ); 516 518 } 517 519 … … 521 523 * @since 2.4.0 522 524 * 523 * @param bool $default Optional. Fallback value if not found in the database.524 * Default: false.525 * @param bool $default_value Optional. Fallback value if not found in the database. 526 * Default: false. 525 527 * @return bool True if cover image uploads are disabled, otherwise false. 526 528 */ 527 function bp_disable_cover_image_uploads( $default = false ) {529 function bp_disable_cover_image_uploads( $default_value = false ) { 528 530 529 531 /** … … 532 534 * @since 2.4.0 533 535 * 534 * @param bool $ value Whether or not members are able to upload their own cover images.535 */ 536 return (bool) apply_filters( 'bp_disable_cover_image_uploads', (bool) bp_get_option( 'bp-disable-cover-image-uploads', $default ) );536 * @param bool $disable_cover_image Whether or not members are able to upload their own cover images. 537 */ 538 return (bool) apply_filters( 'bp_disable_cover_image_uploads', (bool) bp_get_option( 'bp-disable-cover-image-uploads', $default_value ) ); 537 539 } 538 540 … … 545 547 * @since 2.3.0 546 548 * 547 * @param bool|null $default Optional. Fallback value if not found in the database.548 * Defaults to the value of `bp_disable_avatar_uploads()`.549 * @param bool|null $default_value Optional. Fallback value if not found in the database. 550 * Defaults to the value of `bp_disable_avatar_uploads()`. 549 551 * @return bool True if group avatar uploads are disabled, otherwise false. 550 552 */ 551 function bp_disable_group_avatar_uploads( $default = null ) {553 function bp_disable_group_avatar_uploads( $default_value = null ) { 552 554 $disabled = bp_get_option( 'bp-disable-group-avatar-uploads', '' ); 553 555 554 556 if ( '' === $disabled ) { 555 if ( is_null( $default ) ) {557 if ( is_null( $default_value ) ) { 556 558 $disabled = bp_disable_avatar_uploads(); 557 559 } else { 558 $disabled = $default ;560 $disabled = $default_value; 559 561 } 560 562 } … … 565 567 * @since 2.3.0 566 568 * 567 * @param bool $disabled Whether or not members are able to upload their groups avatars.568 * @param bool $default 569 */ 570 return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default);569 * @param bool $disabled Whether or not members are able to upload their groups avatars. 570 * @param bool $default_value Default value passed to the function. 571 */ 572 return apply_filters( 'bp_disable_group_avatar_uploads', wp_validate_boolean( $disabled ), $default_value ); 571 573 } 572 574 … … 576 578 * @since 2.4.0 577 579 * 578 * @param bool $default Optional. Fallback value if not found in the database.579 * Default: false.580 * @param bool $default_value Optional. Fallback value if not found in the database. 581 * Default: false. 580 582 * @return bool True if group cover image uploads are disabled, otherwise false. 581 583 */ 582 function bp_disable_group_cover_image_uploads( $default = false ) {584 function bp_disable_group_cover_image_uploads( $default_value = false ) { 583 585 584 586 /** … … 587 589 * @since 2.4.0 588 590 * 589 * @param bool $ value Whether or not members are able to upload thier groups cover images.590 */ 591 return (bool) apply_filters( 'bp_disable_group_cover_image_uploads', (bool) bp_get_option( 'bp-disable-group-cover-image-uploads', $default ) );591 * @param bool $disable_group_cover_image Whether or not members are able to upload their groups cover images. 592 */ 593 return (bool) apply_filters( 'bp_disable_group_cover_image_uploads', (bool) bp_get_option( 'bp-disable-group-cover-image-uploads', $default_value ) ); 592 594 } 593 595 … … 597 599 * @since 14.0.0 598 600 * 599 * @param bool $ retvalOptional. Fallback value if not found in the database.600 * Default: false.601 * @param bool $default_value Optional. Fallback value if not found in the database. 602 * Default: false. 601 603 * @return bool True if group activity deletions are disabled, otherwise false. 602 604 */ 603 function bp_disable_group_activity_deletions( $ retval= false ) {605 function bp_disable_group_activity_deletions( $default_value = false ) { 604 606 605 607 /** … … 611 613 * group admin or group mod are able to delete group activity post. 612 614 */ 613 return (bool) apply_filters( 'bp_disable_group_activity_deletions', (bool) bp_get_option( 'bp-disable-group-activity-deletions', $ retval) );615 return (bool) apply_filters( 'bp_disable_group_activity_deletions', (bool) bp_get_option( 'bp-disable-group-activity-deletions', $default_value ) ); 614 616 } 615 617 … … 619 621 * @since 1.6.0 620 622 * 621 * @param bool $ retvalOptional. Fallback value if not found in the database.622 * Default: true.623 * @param bool $default_value Optional. Fallback value if not found in the database. 624 * Default: true. 623 625 * @return bool True if users are able to delete their own accounts, otherwise 624 626 * false. 625 627 */ 626 function bp_disable_account_deletion( $ retval= false ) {628 function bp_disable_account_deletion( $default_value = false ) { 627 629 628 630 /** … … 633 635 * @param bool $disable_account_deletion Whether or not members are able to delete their own accounts. 634 636 */ 635 return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $ retval) );637 return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default_value ) ); 636 638 } 637 639 … … 643 645 * @todo split and move into blog and forum components. 644 646 * 645 * @param bool $ retvalOptional. Fallback value if not found in the database.646 * Default: false.647 * @param bool $default_value Optional. Fallback value if not found in the database. 648 * Default: false. 647 649 * @return bool True if activity comments are disabled for blog and forum 648 650 * items, otherwise false. 649 651 */ 650 function bp_disable_blogforum_comments( $ retval= false ) {652 function bp_disable_blogforum_comments( $default_value = false ) { 651 653 652 654 /** … … 657 659 * @param bool $disable_blog_forum_comments Whether or not blog and forum activity stream comments are disabled. 658 660 */ 659 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $ retval) );661 return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default_value ) ); 660 662 } 661 663 … … 667 669 * @todo Move into groups component. 668 670 * 669 * @param bool $ retvalOptional. Fallback value if not found in the database.670 * Default: true.671 * @param bool $default_value Optional. Fallback value if not found in the database. 672 * Default: true. 671 673 * @return bool True if group creation is restricted, otherwise false. 672 674 */ 673 function bp_restrict_group_creation( $ retval= true ) {675 function bp_restrict_group_creation( $default_value = true ) { 674 676 675 677 /** … … 680 682 * @param bool $group_creation Whether or not group creation is turned off. 681 683 */ 682 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $ retval) );684 return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default_value ) ); 683 685 } 684 686 … … 688 690 * @since 1.6.0 689 691 * 690 * @param bool $ retvalOptional. Fallback value if not found in the database.691 * Default: true.692 * @param bool $default_value Optional. Fallback value if not found in the database. 693 * Default: true. 692 694 * @return bool True if Akismet is enabled, otherwise false. 693 695 */ 694 function bp_is_akismet_active( $ retval= true ) {696 function bp_is_akismet_active( $default_value = true ) { 695 697 696 698 /** … … 699 701 * @since 1.6.0 700 702 * 701 * @param bool $ akismetWhether or not Akismet is enabled.702 */ 703 return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $ retval) );703 * @param bool $is_akistmet_active Whether or not Akismet is enabled. 704 */ 705 return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default_value ) ); 704 706 } 705 707 … … 709 711 * @since 2.0.0 710 712 * 711 * @param bool $ retvalOptional. Fallback value if not found in the database.712 * Default: true.713 * @param bool $default_value Optional. Fallback value if not found in the database. 714 * Default: true. 713 715 * @return bool True if Heartbeat refresh is enabled, otherwise false. 714 716 */ 715 function bp_is_activity_heartbeat_active( $ retval= true ) {717 function bp_is_activity_heartbeat_active( $default_value = true ) { 716 718 717 719 /** … … 722 724 * @param bool $heartbeat_active Whether or not Activity Heartbeat refresh is enabled. 723 725 */ 724 return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $ retval) );726 return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default_value ) ); 725 727 } 726 728 -
trunk/src/bp-core/bp-core-rest-api.php
r13903 r13968 25 25 * Should we use the REST Endpoints of built BuddyPress? 26 26 * 27 * If the BP REST plugin is active, it overrides BuddyPress REST en points.27 * If the BP REST plugin is active, it overrides BuddyPress REST endpoints. 28 28 * This allows us to carry on maintaining all the BP REST API endpoints from 29 29 * the BP REST plugin on GitHub. … … 55 55 * @since 5.0.0 56 56 * 57 * @param bool ean $value True if the BP REST API is available. False otherwise.57 * @param bool $api_is_available True if the BP REST API is available. False otherwise. 58 58 */ 59 59 return apply_filters( 'bp_rest_api_is_available', bp_rest_in_buddypress() ) || bp_rest_is_plugin_active(); … … 204 204 function bp_rest_sanitize_member_types( $value ) { 205 205 if ( empty( $value ) ) { 206 return $value;206 return null; 207 207 } 208 208 -
trunk/src/bp-core/bp-core-rewrites.php
r13877 r13968 326 326 * 327 327 * @param string $request The request used during parsing. 328 * @return array 328 * @return array Data to use to find a member single item from the request. 329 329 */ 330 330 function bp_rewrites_get_member_data( $request = '' ) { -
trunk/src/bp-core/bp-core-taxonomy.php
r13903 r13968 88 88 * @since 2.6.0 89 89 * 90 * @param int $site_id Site ID to c ehck for.90 * @param int $site_id Site ID to check for. 91 91 * @param string $taxonomy Taxonomy slug to check for. 92 92 */ … … 105 105 * @param string $taxonomy Taxonomy name. 106 106 * @param bool $append Optional. True to append terms to existing terms. Default: false. 107 * @return arrayArray of term taxonomy IDs.107 * @return int[] Array of term taxonomy IDs. 108 108 */ 109 109 function bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { -
trunk/src/bp-core/bp-core-template-loader.php
r13903 r13968 8 8 * 9 9 * @package BuddyPress 10 * @subpackage TemplateFunctions10 * @subpackage Core 11 11 * @since 1.7.0 12 12 */ … … 19 19 * 20 20 * @since 1.7.0 21 * @since 7.0.0 Added $argsparameter.21 * @since 7.0.0 Added `$args` parameter. 22 22 * 23 23 * @param string $slug Template part slug. Used to generate filenames, … … 55 55 * 56 56 * @since 1.7.0 57 * @since 7.0.0 Added $argsparameter.57 * @since 7.0.0 Added `$args` parameter. 58 58 * 59 59 * @param array $templates Array of templates located. … … 75 75 * 76 76 * @since 2.6.0 77 * @since 7.0.0 Added $argsparameter.77 * @since 7.0.0 Added `$args` parameter. 78 78 * 79 79 * @see bp_get_template_part() for full documentation. … … 156 156 * 157 157 * @since 1.7.0 158 * @since 7.0.0 Added $argsparameter.158 * @since 7.0.0 Added `$args` parameter. 159 159 * 160 160 * @param string|array $template_names Template file(s) to search for, in order. … … 218 218 * @since 2.5.0 219 219 * 220 * @param bool $ value True to load the template, false otherwise.220 * @param bool $load_template True to load the template, false otherwise. 221 221 */ 222 222 $load_template = (bool) apply_filters( 'bp_locate_template_and_load', true ); … … 392 392 * 393 393 * @since 1.7.0 394 * @since 7.0.0 Added $argsparameter.394 * @since 7.0.0 Added `$args` parameter. 395 395 * 396 396 * @see bp_get_template_part() for a description of $slug, $name and $args params. … … 541 541 * @since 1.7.0 542 542 * 543 * @param array $ valueArray of all template locations registered so far.543 * @param array $template_locations Array of all template locations registered so far. 544 544 * @param array $stacks Array of template locations. 545 545 */ … … 643 643 * @since 12.0.0 644 644 * 645 * @param WP_Query $ posts_query WP_Query instance. Passed by reference.645 * @param WP_Query $referer_query WP_Query instance. Passed by reference. 646 646 */ 647 647 do_action_ref_array( 'bp_parse_query', array( &$referer_query ) ); … … 654 654 * 655 655 * @since 12.0.0 656 * 657 * @global WP $wp WordPress main instance. 656 658 * 657 659 * @param string $bp_request A specific BuddyPress request. … … 659 661 * @return true 660 662 */ 661 function bp_reset_query( $bp_request = '', WP_Query$query = null ) {663 function bp_reset_query( $bp_request = '', $query = null ) { 662 664 global $wp; 663 665 … … 676 678 $matched_query = wp_parse_url( $bp_request, PHP_URL_QUERY ); 677 679 } else { 678 // Temporar ly override the request uri.680 // Temporarily override the request uri. 679 681 $_SERVER['REQUEST_URI'] = $bp_request; 680 682 … … 700 702 $query->parse_query( $matched_query ); 701 703 702 // Use to reque ryin case of root profiles.704 // Use to request in case of root profiles. 703 705 } elseif ( isset( $wp->request ) ) { 704 // Temporar ly override the request uri.706 // Temporarily override the request uri. 705 707 $_SERVER['REQUEST_URI'] = str_replace( $wp->request, $bp_request, $reset_server_request_uri ); 706 708 … … 783 785 * @since 1.8.0 784 786 * 785 * @return bool True if yes, false if no.787 * @return bool 786 788 */ 787 789 function bp_is_template_included() { … … 794 796 * @since 1.7.0 795 797 * 796 * @global string $pagenow 798 * @global string $pagenow The current page being loaded. 799 * @global WP_Query $wp_query The WordPress Query object. 797 800 */ 798 801 function bp_load_theme_functions() { -
trunk/src/bp-core/bp-core-theme-compatibility.php
r13932 r13968 4 4 * 5 5 * @package BuddyPress 6 * @subpackage ThemeCompatibility6 * @subpackage Core 7 7 * @since 1.7.0 8 8 */ … … 61 61 * @since 1.7.0 62 62 * 63 * @param string $ id ID of the theme package in use.63 * @param string $theme_compat_id ID of the theme package in use. 64 64 */ 65 65 return apply_filters( 'bp_get_theme_compat_id', buddypress()->theme_compat->theme->id ); … … 83 83 * @since 1.7.0 84 84 * 85 * @param string $ name Name of the theme package in use.85 * @param string $theme_compat_name Name of the theme package in use. 86 86 */ 87 87 return apply_filters( 'bp_get_theme_compat_name', buddypress()->theme_compat->theme->name ); … … 105 105 * @since 1.7.0 106 106 * 107 * @param string $ version The version string of the theme package in use.107 * @param string $theme_compat_version The version string of the theme package in use. 108 108 */ 109 109 return apply_filters( 'bp_get_theme_compat_version', buddypress()->theme_compat->theme->version ); … … 127 127 * @since 1.7.0 128 128 * 129 * @param string $ dir The absolute path of the theme package in use.129 * @param string $theme_compat_dir The absolute path of the theme package in use. 130 130 */ 131 131 return apply_filters( 'bp_get_theme_compat_dir', buddypress()->theme_compat->theme->dir ); … … 150 150 * @since 1.7.0 151 151 * 152 * @param string $ url URL of the theme package in use.152 * @param string $theme_compat_url URL of the theme package in use. 153 153 */ 154 154 return apply_filters( 'bp_get_theme_compat_url', buddypress()->theme_compat->theme->url ); … … 170 170 } 171 171 172 $theme_compat_with_current_theme = wp_validate_boolean( buddypress()->theme_compat->use_with_current_theme ); 173 172 174 /** 173 175 * Filters whether or not to use theme compat for the active theme. … … 175 177 * @since 1.9.0 176 178 * 177 * @param bool $ use_with_current_theme True if the current theme needs theme compatibility.178 */ 179 return apply_filters( 'bp_use_theme_compat_with_current_theme', buddypress()->theme_compat->use_with_current_theme );179 * @param bool $theme_compat_with_current_theme True if the current theme needs theme compatibility. 180 */ 181 return apply_filters( 'bp_use_theme_compat_with_current_theme', $theme_compat_with_current_theme ); 180 182 } 181 183 … … 373 375 * 374 376 * @param string $feature The feature (eg: cover_image). 375 * @return object The feature settings.377 * @return false|object The feature settings or false if the feature is not found. 376 378 */ 377 379 function bp_get_theme_compat_feature( $feature = '' ) { … … 482 484 * @param string $template The template name to check. 483 485 * @return bool True if the value of $template is the same as the 484 * "original_template" originally selected by WP. Otherwise false.486 * "original_template" originally selected by WP. Otherwise, false. 485 487 */ 486 488 function bp_is_theme_compat_original_template( $template = '' ) { … … 491 493 } 492 494 493 return (bool) ( $bp->theme_compat->original_template === $template );495 return $bp->theme_compat->original_template === $template; 494 496 } 495 497 … … 807 809 * @since 1.7.0 808 810 * 809 * @global WP_filter $wp_filter810 * @global array $merged_filters 811 * @global array $wp_filter Stores all the filters. 812 * @global array $merged_filters Merges the filter hooks using this function. 811 813 * 812 814 * @param string $tag The filter tag to remove filters from. … … 862 864 * @since 1.7.0 863 865 * 864 * @global WP_filter $wp_filter865 * @global array $merged_filters 866 * @global array $wp_filter Stores all the filters. 867 * @global array $merged_filters Merges the filter hooks using this function. 866 868 * 867 869 * @param string $tag The tag to which filters should be restored. … … 978 980 * @since 1.9.2 979 981 * 982 * @global WP_Query $wp_query WordPress database query object. 983 * 980 984 * @param string $retval The current post content. 981 * @return string $retval985 * @return string 982 986 */ 983 987 function bp_theme_compat_toggle_is_page( $retval = '' ) { … … 1001 1005 * 1002 1006 * @see bp_theme_compat_toggle_is_page() 1003 * @param object $query The WP_Query object. 1007 * 1008 * @param WP_Query $query The WP_Query object. 1004 1009 */ 1005 1010 function bp_theme_compat_loop_end( $query ) { … … 1119 1124 * 1120 1125 * @param array $args An associative array containing **ONE** feature & keyed by the BP Component ID. 1121 * @return bool eanTrue if the theme supports the BP feature. False otherwise.1126 * @return bool True if the theme supports the BP feature. False otherwise. 1122 1127 */ 1123 1128 function bp_current_theme_supports( $args = array() ) { 1124 1129 if ( is_array( $args ) && $args && ( 1 < count( $args ) || is_array( $args[ key( $args ) ] ) ) ) { 1125 _doing_it_wrong( __FUNCTION__, esc_html( 'The function only supports checking 1 feature for a specific component at a time for now.', 'buddypress' ), '14.0.0' ); 1130 _doing_it_wrong( 1131 __FUNCTION__, 1132 esc_html__( 'The function only supports checking 1 feature for a specific component at a time for now.', 'buddypress' ), 1133 '14.0.0' 1134 ); 1135 1126 1136 return false; 1127 1137 } … … 1134 1144 * @since 14.0.0 1135 1145 * 1136 * @param bool ean$supports True if the theme supports the BP feature. False otherwise.1146 * @param bool $supports True if the theme supports the BP feature. False otherwise. 1137 1147 */ 1138 1148 return apply_filters( 'bp_current_theme_supports', $supports, $args ); -
trunk/src/bp-core/bp-core-update.php
r13943 r13968 4 4 * 5 5 * @package BuddyPress 6 * @subpackage Updater6 * @subpackage Core 7 7 * @since 1.6.0 8 8 */ … … 338 338 * 339 339 * @since 2.3.0 340 * 341 * @global wpdb $wpdb WordPress database object. 340 342 */ 341 343 function bp_pre_schema_upgrade() { … … 731 733 * 732 734 * @param array $emails The array of emails schema. 735 * @return array 733 736 */ 734 737 function bp_core_get_8_0_upgrade_email_schema( $emails ) { … … 769 772 * 770 773 * @param array $emails The array of emails schema. 774 * @return array 771 775 */ 772 776 function bp_core_get_10_0_upgrade_email_schema( $emails ) { … … 807 811 * 808 812 * @param array $emails The array of emails schema. 813 * @return array 809 814 */ 810 815 function bp_core_get_11_0_upgrade_email_schema( $emails ) { … … 947 952 * 948 953 * Edit db schema to stop using boolean fields in favor of tinyint ones. 949 * This move swas necessary to support WP Playground.954 * This move was necessary to support WP Playground. 950 955 * 951 956 * @since 14.0.0 957 * 958 * @global wpdb $wpdb WordPress database object. 952 959 */ 953 960 function bp_update_to_14_0() { 954 961 global $wpdb; 955 $bp = buddypress(); 956 $bp _prefix = bp_core_get_table_prefix();962 963 $bp = buddypress(); 957 964 958 965 if ( isset( $bp->members->table_name_last_activity ) && $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->members->table_name_last_activity}%'" ) ) { … … 1000 1007 function bp_migrate_new_member_activity_component() { 1001 1008 global $wpdb; 1009 1002 1010 $bp = buddypress(); 1003 1011 -
trunk/src/bp-core/bp-core-wpabstraction.php
r13395 r13968 10 10 * 11 11 * @package BuddyPress 12 * @subpackage WPAbstraction12 * @subpackage Core 13 13 * @since 1.2.0 14 14 */ … … 24 24 * @global string $wp_version WP Version number. 25 25 * 26 * @return double26 * @return float 27 27 */ 28 28 function bp_get_major_wp_version() { … … 35 35 * Only add MS-specific abstraction functions if WordPress is not in multisite mode. 36 36 */ 37 if ( ! is_multisite() ) {37 if ( ! is_multisite() ) { 38 38 global $wpdb; 39 39 … … 41 41 $wpdb->blogid = BP_ROOT_BLOG; 42 42 43 if ( ! function_exists( 'get_blog_option' ) ) {43 if ( ! function_exists( 'get_blog_option' ) ) { 44 44 45 45 /** … … 52 52 * @param int $blog_id Blog ID to fetch for. Not used. 53 53 * @param string $option_name Option name to fetch. 54 * @param bool $default Whether or not default.54 * @param bool $default Optional. Default value to return if the option does not exist. 55 55 * @return mixed 56 56 */ … … 72 72 * @param string $option_name Option name to add. 73 73 * @param mixed $option_value Option value to add. 74 * @return mixed74 * @return bool 75 75 */ 76 76 function add_blog_option( $blog_id, $option_name, $option_value ) { … … 79 79 } 80 80 81 if ( ! function_exists( 'update_blog_option' ) ) {81 if ( ! function_exists( 'update_blog_option' ) ) { 82 82 83 83 /** … … 88 88 * @see update_blog_option() 89 89 * 90 * @param int $blog_id Blog ID to update for. Not used.91 * @param string $option_name Option name to update.92 * @param mixed $ valueOption value to update.93 * @return mixed94 */ 95 function update_blog_option( $blog_id, $option_name, $ value ) {96 return update_option( $option_name, $ value );97 } 98 } 99 100 if ( ! function_exists( 'delete_blog_option' ) ) {90 * @param int $blog_id Blog ID to update for. Not used. 91 * @param string $option_name Option name to update. 92 * @param mixed $option_value Option value to update. 93 * @return bool 94 */ 95 function update_blog_option( $blog_id, $option_name, $option_value ) { 96 return update_option( $option_name, $option_value ); 97 } 98 } 99 100 if ( ! function_exists( 'delete_blog_option' ) ) { 101 101 102 102 /** … … 109 109 * @param int $blog_id Blog ID to delete for. Not used. 110 110 * @param string $option_name Option name to delete. 111 * @return mixed111 * @return bool 112 112 */ 113 113 function delete_blog_option( $blog_id, $option_name ) { … … 116 116 } 117 117 118 if ( ! function_exists( 'switch_to_blog' ) ) {118 if ( ! function_exists( 'switch_to_blog' ) ) { 119 119 120 120 /** … … 126 126 * 127 127 * @param mixed $new_blog New blog to switch to. Not used. 128 * @param null $deprecated Whether or not deprecated.Not used.128 * @param null $deprecated Not used. 129 129 * @return int 130 130 */ … … 134 134 } 135 135 136 if ( ! function_exists( 'restore_current_blog' ) ) {136 if ( ! function_exists( 'restore_current_blog' ) ) { 137 137 138 138 /** … … 150 150 } 151 151 152 if ( ! function_exists( 'get_blogs_of_user' ) ) {153 154 /** 155 * Retri ve blogs associated with user.152 if ( ! function_exists( 'get_blogs_of_user' ) ) { 153 154 /** 155 * Retrieve blogs associated with user. 156 156 * 157 157 * @since 1.2.0 … … 160 160 * 161 161 * @param int $user_id ID of the user. Not used. 162 * @param bool $all Whether or notto return all. Not used.163 * @return bool162 * @param bool $all Whether to return all. Not used. 163 * @return false 164 164 */ 165 165 function get_blogs_of_user( $user_id, $all = false ) { … … 168 168 } 169 169 170 if ( ! function_exists( 'update_blog_status' ) ) {170 if ( ! function_exists( 'update_blog_status' ) ) { 171 171 172 172 /** … … 181 181 * @param string $value Value. Not used. 182 182 * @param null $deprecated Whether or not deprecated. Not used. 183 * @return bool183 * @return true 184 184 */ 185 185 function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) { … … 188 188 } 189 189 190 if ( ! function_exists( 'is_subdomain_install' ) ) {190 if ( ! function_exists( 'is_subdomain_install' ) ) { 191 191 192 192 /** … … 200 200 */ 201 201 function is_subdomain_install() { 202 if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) ) 203 return true; 204 205 return false; 202 return ( ( defined( 'VHOST' ) && 'yes' === VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) ); 206 203 } 207 204 } … … 218 215 */ 219 216 function bp_core_get_status_sql( $prefix = false ) { 220 if ( ! is_multisite() )217 if ( ! is_multisite() ) { 221 218 return "{$prefix}user_status = 0"; 222 else 223 return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0"; 219 } 220 221 return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0"; 224 222 } 225 223 … … 232 230 * Borrowed from MediaWiki, under the GPLv2. Thanks! 233 231 */ 234 if ( ! function_exists( 'mb_strlen' ) ) {232 if ( ! function_exists( 'mb_strlen' ) ) { 235 233 236 234 /** … … 243 241 function mb_strlen( $str, $enc = '' ) { 244 242 $counts = count_chars( $str ); 245 $total = 0;243 $total = 0; 246 244 247 245 // Count ASCII bytes. 248 for ( $i = 0; $i < 0x80; $i++ ) {249 $total += $counts[ $i];246 for ( $i = 0; $i < 0x80; $i++ ) { 247 $total += $counts[ $i ]; 250 248 } 251 249 252 250 // Count multibyte sequence heads. 253 for ( $i = 0xc0; $i < 0xff; $i++ ) {254 $total += $counts[ $i];251 for ( $i = 0xc0; $i < 0xff; $i++ ) { 252 $total += $counts[ $i ]; 255 253 } 256 254 return $total; … … 258 256 } 259 257 260 if ( ! function_exists( 'mb_strpos' ) ) {258 if ( ! function_exists( 'mb_strpos' ) ) { 261 259 262 260 /** … … 275 273 preg_match( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset ); 276 274 277 if ( isset( $ar[0][1] ) ) {275 if ( isset( $ar[0][1] ) ) { 278 276 return $ar[0][1]; 279 } else {280 return false; 281 }282 } 283 } 284 285 if ( ! function_exists( 'mb_strrpos' ) ) {277 } 278 279 return false; 280 } 281 } 282 283 if ( ! function_exists( 'mb_strrpos' ) ) { 286 284 287 285 /** … … 300 298 preg_match_all( '/' . $needle . '/u', $haystack, $ar, PREG_OFFSET_CAPTURE, $offset ); 301 299 302 if ( isset( $ar[0] ) && count( $ar[0] ) > 0 &&303 isset( $ar[0][ count( $ar[0] ) - 1][1] ) ) {304 return $ar[0][ count( $ar[0] ) - 1][1];305 } else {306 return false; 307 }300 if ( isset( $ar[0] ) && count( $ar[0] ) > 0 && 301 isset( $ar[0][ count( $ar[0] ) - 1 ][1] ) ) { 302 return $ar[0][ count( $ar[0] ) - 1 ][1]; 303 } 304 305 return false; 308 306 } 309 307 } … … 313 311 * 314 312 * @since 6.0.0 313 * 314 * @param WP_Error|null $errors The WP_Error object. 315 * @param array $data Associative array of complete site data. See {@see wp_insert_site()}. 315 316 */ 316 317 function bp_catch_site_data( $errors = null, $data = array() ) { … … 390 391 function bp_delete_site_no_tables_drop( $site ) { 391 392 if ( isset( $site->deleted ) && 1 === (int) $site->deleted ) { 392 return bp_delete_site( $site->id, false);393 } 394 } 395 add_action( 'wp_update_site', 'bp_delete_site_no_tables_drop' , 10, 1);393 bp_delete_site( $site->id ); 394 } 395 } 396 add_action( 'wp_update_site', 'bp_delete_site_no_tables_drop' ); 396 397 397 398 /**
Note: See TracChangeset
for help on using the changeset viewer.