/** * Save the global field value. * * @since 1.0 * * @param object $field */ public function bp_xprofile_save_global_field_value($field) { if (!empty($_POST['saveField'])) { if (BP_XProfile_Field::admin_validate()) { $field_id = $field->id; if (empty($field_id)) { $field_id = BP_XProfile_Field::get_id_from_name($field->name); } $this->__update_xprofile_meta($field_id, 'field', 'global_value', $_POST['fieldvalue']); } } }
/** * Returns the ID for the field based on the field name. * * @since 1.0.0 * * @param string $field_name The name of the field to get the ID for. * @return int $field_id on success, false on failure. */ function xprofile_get_field_id_from_name($field_name) { return BP_XProfile_Field::get_id_from_name($field_name); }
function save_admin_field($field) { if (isset($_POST['bp_smp'])) { // When creating a new field, no field_id will have been set yet. We'll // look it up based on the $field object passed to the hook if (empty($this->field_id)) { $this->field_id = BP_XProfile_Field::get_id_from_name($field->name); } $new_smp_data = $_POST['bp_smp']; bp_xprofile_update_field_meta($this->field_id, 'bp_smp_data', $new_smp_data); } }