PluginProbe
BuddyPress / trunk
BuddyPress vtrunk
11.6.2 12.7.2 14.5.2 11.6.0 12.7.0 2.5.0-rc1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.0-beta1 2.6.0-rc1 2.6.1 2.6.1.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.0-beta1 2.7.0-rc1 2.7.0-rc2 2.7.1 2.7.2 All 274 releases
buddypress / cli / src / xprofile.php

xprofile.php in BuddyPress trunk, at cli/src/xprofile.php

41 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Buddypress\CLI\Command;
4
5 use WP_CLI;
6
7 /**
8 * Manage BuddyPress XProfile.
9 *
10 * ## EXAMPLES
11 *
12 * # Save a xprofile data to a user with its field and value.
13 * $ wp bp xprofile data set --user-id=45 --field-id=120 --value=test
14 * Success: Updated XProfile field "Field Name" (ID 120) with value "test" for user user_login (ID 45).
15 *
16 * # Create a xprofile group.
17 * $ wp bp xprofile group create --name="Group Name" --description="Xprofile Group Description"
18 * Success: Created XProfile field group "Group Name" (ID 123).
19 *
20 * # List xprofile fields.
21 * $ wp bp xprofile field list
22 * +----+------+-------------+---------+----------+-------------+
23 * | id | name | description | type | group_id | is_required |
24 * +----+------+-------------+---------+----------+-------------+
25 * | 1 | Name | | textbox | 1 | 1 |
26 * +----+------+-------------+---------+----------+-------------+
27 */
28 class XProfile extends BuddyPressCommand {
29
30 /**
31 * Dependency check for this CLI command.
32 */
33 public static function check_dependencies() {
34 parent::check_dependencies();
35
36 if ( ! bp_is_active( 'xprofile' ) ) {
37 WP_CLI::error( 'The XProfile component is not active.' );
38 }
39 }
40 }
41