XProfile_Group::get( $args, $assoc_args )
Fetch specific XProfile field group.
Description Description
OPTIONS OPTIONS
[–fields=
[–format=
## EXAMPLES
$ wp bp xprofile group get 500 $ wp bp xprofile group see 56 –format=json
Source Source
File: cli/src/xprofile-group.php
public function get( $args, $assoc_args ) { $field_group_id = $args[0]; if ( ! is_numeric( $field_group_id ) ) { WP_CLI::error( 'Please provide a numeric field group ID.' ); } $object = xprofile_get_field_group( $field_group_id ); if ( empty( $object->id ) && ! is_object( $object ) ) { WP_CLI::error( 'No XProfile field group found.' ); } $object_arr = get_object_vars( $object ); if ( empty( $assoc_args['fields'] ) ) { $assoc_args['fields'] = array_keys( $object_arr ); } $this->get_formatter( $assoc_args )->display_item( $object_arr ); }
Expand full source code Collapse full source code View on Trac