xprofile_ajax_reorder_fields()

Handles the ajax reordering of fields within a group.

Description

Source

File: bp-xprofile/bp-xprofile-admin.php

724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
function xprofile_ajax_reorder_fields() {
 
    // Check the nonce.
    check_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' );
 
    if ( empty( $_POST['field_order'] ) ) {
        return false;
    }
 
    parse_str( $_POST['field_order'], $order );
 
    $field_group_id = $_POST['field_group_id'];
 
    foreach ( (array) $order['draggable_field'] as $position => $field_id ) {
        xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id );
    }
}

Changelog

Changelog
Version Description
BuddyPress 1.0.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.