diff --git .travis.yml .travis.yml
index d8f737f96..8c065b9e8 100644
|
|
|
before_install: |
| 80 | 80 | |
| 81 | 81 | # setup NodeJS version using NVM |
| 82 | 82 | - export PATH="$HOME/.composer/vendor/bin:$PATH" |
| 83 | | # make sure composer is < 2.0.0 to avoid dependencies install errors. |
| 84 | | - composer self-update 1.10.16 |
| 85 | 83 | - node --version |
| 86 | 84 | - nvm install 14.15.0 |
| 87 | 85 | - node --version |
diff --git composer.json composer.json
index d07167858..3bf5b45c3 100644
|
|
|
|
| 13 | 13 | "social network" |
| 14 | 14 | ], |
| 15 | 15 | "homepage": "https://buddypress.org", |
| 16 | | "license": "GPL-2.0+", |
| | 16 | "license": "GPL-2.0-or-later", |
| 17 | 17 | "authors": [ { |
| 18 | 18 | "name": "BuddyPress Community", |
| 19 | 19 | "homepage": "https://buddypress.org/about/" |
| … |
… |
|
| 27 | 27 | "wiki": "https://codex.buddypress.org/" |
| 28 | 28 | }, |
| 29 | 29 | "require": { |
| 30 | | "composer/installers": "~1.0", |
| 31 | | "php": ">=5.3.0" |
| | 30 | "composer/installers": "^1.10.0", |
| | 31 | "php": ">=5.6.0" |
| 32 | 32 | }, |
| 33 | 33 | "require-dev": { |
| 34 | | "phpcompatibility/phpcompatibility-wp": "*", |
| 35 | | "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", |
| 36 | | "wp-phpunit/wp-phpunit": "^5.4" |
| | 34 | "phpcompatibility/phpcompatibility-wp": "^2.1.0", |
| | 35 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", |
| | 36 | "wp-phpunit/wp-phpunit": "^5.6", |
| | 37 | "phpunit/phpunit": "^7.5" |
| 37 | 38 | } |
| 38 | 39 | } |
diff --git package.json package.json
index 8a9336e13..6ae270c71 100644
|
|
|
|
| 48 | 48 | "build:components": "parcel build src/js/bp-core/js/block-components/block-components.js --out-dir build/bp-core/js --out-file block-components.js --global bp", |
| 49 | 49 | "wp-env": "wp-env", |
| 50 | 50 | "test-php": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml'", |
| | 51 | "test-php:composer": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml'", |
| 51 | 52 | "test-php:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml --group $npm_confi_g'", |
| | 53 | "test-php:composer:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml --group $npm_confi_g'", |
| 52 | 54 | "test-php-multisite": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml'", |
| 53 | | "test-php-multisite:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'" |
| | 55 | "test-php-multisite:composer": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml'", |
| | 56 | "test-php-multisite:group": "npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'", |
| | 57 | "test-php-multisite:composer:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'" |
| 54 | 58 | }, |
| 55 | 59 | "keywords": [ |
| 56 | 60 | "activity", |
diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
index 50b7b399d..d1af9ad1f 100644
|
|
|
function groups_delete_invite( $user_id, $group_id, $inviter_id = false ) { |
| 1669 | 1669 | * @type bool $force_resend Whether to resend the email & notification if one has already been sent. |
| 1670 | 1670 | * } |
| 1671 | 1671 | */ |
| 1672 | | function groups_send_invites( $args = array() ) { |
| | 1672 | function groups_send_invites( ...$args ) { |
| 1673 | 1673 | // Backward compatibility with old method of passing arguments. |
| 1674 | | if ( ! is_array( $args ) || func_num_args() > 1 ) { |
| | 1674 | if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { |
| 1675 | 1675 | _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); |
| 1676 | 1676 | |
| 1677 | 1677 | $old_args_keys = array( |
| … |
… |
function groups_send_invites( $args = array() ) { |
| 1679 | 1679 | 1 => 'group_id', |
| 1680 | 1680 | ); |
| 1681 | 1681 | |
| 1682 | | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
| | 1682 | $args = bp_core_parse_args_array( $old_args_keys, $args ); |
| | 1683 | } else { |
| | 1684 | $args = reset( $args ); |
| 1683 | 1685 | } |
| 1684 | 1686 | |
| 1685 | 1687 | $r = bp_parse_args( $args, array( |
| … |
… |
function groups_remove_member( $user_id, $group_id ) { |
| 2008 | 2010 | * } |
| 2009 | 2011 | * @return bool True on success, false on failure. |
| 2010 | 2012 | */ |
| 2011 | | function groups_send_membership_request( $args = array() ) { |
| | 2013 | function groups_send_membership_request( ...$args ) { |
| 2012 | 2014 | // Backward compatibility with old method of passing arguments. |
| 2013 | | if ( ! is_array( $args ) || func_num_args() > 1 ) { |
| | 2015 | if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { |
| 2014 | 2016 | _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); |
| 2015 | 2017 | |
| 2016 | 2018 | $old_args_keys = array( |
| … |
… |
function groups_send_membership_request( $args = array() ) { |
| 2018 | 2020 | 1 => 'group_id', |
| 2019 | 2021 | ); |
| 2020 | 2022 | |
| 2021 | | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
| | 2023 | $args = bp_core_parse_args_array( $old_args_keys, $args ); |
| | 2024 | } else { |
| | 2025 | $args = reset( $args ); |
| 2022 | 2026 | } |
| 2023 | 2027 | |
| 2024 | 2028 | $r = bp_parse_args( $args, array( |
diff --git src/bp-members/classes/class-bp-core-members-template.php src/bp-members/classes/class-bp-core-members-template.php
index af00c6bdf..ed82ef88f 100644
|
|
|
class BP_Core_Members_Template { |
| 123 | 123 | * @type string $page_arg Optional. The string used as a query parameter in pagination links. |
| 124 | 124 | * } |
| 125 | 125 | */ |
| 126 | | public function __construct( $args ) { |
| | 126 | public function __construct( ...$args ) { |
| 127 | 127 | // Backward compatibility with old method of passing arguments. |
| 128 | | if ( ! is_array( $args ) || func_num_args() > 1 ) { |
| | 128 | if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { |
| 129 | 129 | _deprecated_argument( __METHOD__, '7.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); |
| 130 | 130 | |
| 131 | 131 | $old_args_keys = array( |
| … |
… |
class BP_Core_Members_Template { |
| 146 | 146 | 14 => 'member_type__not_in' |
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
| | 149 | $args = bp_core_parse_args_array( $old_args_keys, $args ); |
| | 150 | } else { |
| | 151 | $args = reset( $args ); |
| 150 | 152 | } |
| 151 | 153 | |
| 152 | 154 | // Support both 'page_number' and 'page' for backward compatibility. |