BP_XProfile_Group::update_position( int $field_group_id, int $position )
Update field group position.
Description Description
Parameters Parameters
- $field_group_id
-
(Required) ID of the group the field belongs to.
- $position
-
(Required) Field group position.
Return Return
(boolean)
Source 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 and group query caches.
wp_cache_delete( 'all', 'bp_xprofile_groups' );
bp_core_reset_incrementor( '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 Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |