From e5675cf17be05c82261c8a2b1fc9d00cfcc0cf71 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Mon, 7 Sep 2020 15:10:43 -0300 Subject: [PATCH] Fixing a bug and other doc improvements --- features/scaffold.feature | 3 +++ src/member.php | 11 ----------- src/tool.php | 7 ++++--- src/xprofile-field.php | 4 ++-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/features/scaffold.feature b/features/scaffold.feature index e41191a..ed79abe 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -21,6 +21,9 @@ Feature: Scaffold BuddyPress tests And the {PLUGIN_DIR}/hello-world/tests directory should contain: """ bootstrap.php + """ + And the {PLUGIN_DIR}/hello-world/tests directory should contain: + """ bootstrap-buddypress.php """ And the {PLUGIN_DIR}/hello-world/tests/bootstrap-buddypress.php file should contain: diff --git a/src/member.php b/src/member.php index d5e7406..e42ef43 100644 --- a/src/member.php +++ b/src/member.php @@ -2,8 +2,6 @@ namespace Buddypress\CLI\Command; -use WP_CLI; - /** * Manage BuddyPress Members * @@ -16,15 +14,6 @@ */ class Member extends BuddyPressCommand { - /** - * Default dependency check for a BuddyPress CLI command. - */ - public static function check_dependencies() { - if ( ! class_exists( 'Buddypress' ) ) { - WP_CLI::error( 'The BuddyPress plugin is not active.' ); - } - } - /** * Generate BuddyPress members. See documentation for `wp_user_generate`. * diff --git a/src/tool.php b/src/tool.php index 5f76db4..c6dc118 100644 --- a/src/tool.php +++ b/src/tool.php @@ -12,6 +12,9 @@ * $ wp bp tool repair friend-count * Success: Counting the number of friends for each user. Complete! * + * $ wp bp tool version + * BuddyPress: 6.0.0 + * * @since 1.5.0 */ class Tool extends BuddyPressCommand { @@ -41,7 +44,7 @@ public static function check_dependencies() { * - last-activity * --- * - * ## EXAMPLES + * ## EXAMPLE * * $ wp bp tool repair friend-count * Success: Counting the number of friends for each user. Complete! @@ -94,8 +97,6 @@ public function version() { * * $ wp bp tool signup 0 * Success: Signup tool updated. - * - * @since 2.0.0 */ public function signup( $args ) { bp_update_option( 'users_can_register', $args[0] ); diff --git a/src/xprofile-field.php b/src/xprofile-field.php index 6574a37..5dc6e50 100644 --- a/src/xprofile-field.php +++ b/src/xprofile-field.php @@ -68,7 +68,7 @@ public function list_( $args, $assoc_args ) { // phpcs:ignore PSR2.Methods.Metho * * ## OPTIONS * - * --type= + * [--type=] * : Field type. * --- * default: textbox @@ -88,7 +88,7 @@ public function list_( $args, $assoc_args ) { // phpcs:ignore PSR2.Methods.Metho * $ wp bp xprofile field create --type=checkbox --field-group-id=508 --name="Field Name" * Success: Created XProfile field "Field Name" (ID 24564). * - * $ wp bp xprofile field add --type=checkbox --field-group-id=165 --name="Another Field" + * $ wp bp xprofile field add --field-group-id=165 --name="Another Field" * Success: Created XProfile field "Another Field" (ID 5465). * * @alias add