BP_XProfile_Group::update_position( int $field_group_id, int $position )

Update field group position.


Parameters Parameters

$field_group_id

(int) (Required) ID of the group the field belongs to.

$position

(int) (Required) Field group position.


Top ↑

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 ) );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.