Used when the member info record is cloned.
}
}
+function customFieldsCloneMemberInfoFields( $oldId, $newId )
+{
+ global $wpdb;
+ $customFields = customFieldsGetMemberInfoFields( $oldId );
+ $fieldDataFormat = array(
+ '%d',
+ '%d',
+ '%s'
+ );
+ if ( isset( $customFields ) ) {
+ foreach ( $customFields as $fieldId => $fieldData ) {
+ $fieldData =array(
+ 'ref_dest' => $newId,
+ 'field_id' => $fieldId,
+ 'field_data' => $fieldData
+ );
+ $wpdb->insert(
+ GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_field_data",
+ $fieldData,
+ $fieldDataFormat
+ );
+ }
+ }
+}
+
/**
* customFieldsGetMemberInfoFields
*
1,
1
);
+add_action(
+ 'glm-member-db-member-info-clone-custom-fields',
+ function( $memberInfoId, $newId ){
+ require_once GLM_MEMBERS_FIELDS_PLUGIN_CLASS_PATH . '/customFieldPluginSupport.php';
+ // this will clone the custom fields data
+ customFieldsCloneMemberInfoFields( $memberInfoId, $newId );
+ },
+ 1,
+ 2
+);