Function Hook_fields_codename->get_field_random
Definitions
sources/hooks/systems/fields/codename.php
- Get a fresh value for a random valued field.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $field_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The field ID |
| $default | string | No | No | Blank (empty string) | N/A | N/A | The field default |
Returns
- The value (null: could not process)
- Type: ?string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get a fresh value for a random valued field.
*
* @param AUTO_LINK $field_id The field ID
* @param string $default The field default
* @return ?string The value (null: could not process)
*/
public function get_field_random(int $field_id, string $default = '') : ?string
* Get a fresh value for a random valued field.
*
* @param AUTO_LINK $field_id The field ID
* @param string $default The field default
* @return ?string The value (null: could not process)
*/
public function get_field_random(int $field_id, string $default = '') : ?string

