BP_XProfile_Group::update_position( int $field_group_id, int $position )
Update field group position.
Description
Parameters
- $field_group_id
-
(Required) ID of the group the field belongs to.
- $position
-
(Required) Field group position.
Return
(boolean)
Source
File: bp-xprofile/classes/class-bp-xprofile-group.php
public static function update_position( $field_group_id, $position ) {
global $wpdb;
if ( ! is_numeric( $position ) ) {
return false;
}
// Purge profile field group cache.
wp_cache_delete( 'all', 'bp_xprofile_groups' );
$bp = buddypress();
return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.5.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.