Function __global->cns_set_custom_field

Definitions

sources/cns_members_action2.php

  • Set a Custom Profile Field for a member.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A The member
$field_id AUTO_LINK No No required parameter N/A N/A The field being set
$value mixed No No required parameter N/A N/A The value of the field. For a trans-type field, this can be either a lang-ID to be copied (from forum DB), or an actual string.
$type ?ID_TEXT No No Null N/A N/A The field type (null: look it up)
$defer boolean No No False N/A N/A Whether to defer the change, by returning a result change rather than doing it right away

Returns

  • Mapping change (null: none / can't defer)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Set a Custom Profile Field for a member.
 *
 * @param  MEMBER $member_id The member
 * @param  AUTO_LINK $field_id The field being set
 * @param  mixed $value The value of the field. For a trans-type field, this can be either a lang-ID to be copied (from forum DB), or an actual string.
 * @param  ?ID_TEXT $type The field type (null: look it up)
 * @param  boolean $defer Whether to defer the change, by returning a result change rather than doing it right away
 * @return ?array Mapping change (null: none / can't defer)
 */

function cns_set_custom_field(int $member_id, int $field_id, $value, ?string $type = null, bool $defer = false) : ?array