Function __global->add_site_message
Definitions
sources/site_messaging2.php
- Add a new site message.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The title |
$message | LONG_TEXT | No | No | required parameter | N/A | N/A | The message |
$type | ID_TEXT | No | No | required parameter | inform notice warn | N/A | The message type |
$validated | BINARY | No | No | 1 | N/A | N/A | Whether this entry is validated |
$start_date_time | ?TIME | No | No | Null | N/A | N/A | The start time (null: not set) |
$end_date_time | ?TIME | No | No | Null | N/A | N/A | The end time (null: not set) |
$groups | array | No | No | [] | N/A | N/A | List of groups of which to limit the message (empty: no limit) |
$page_links | array | No | No | [] | N/A | N/A | List of page links of which to limit the message (empty: no limit) |
Returns
- The ID of the site message created
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add a new site message.
*
* @param SHORT_TEXT $title The title
* @param LONG_TEXT $message The message
* @param ID_TEXT $type The message type
* @set inform notice warn
* @param BINARY $validated Whether this entry is validated
* @param ?TIME $start_date_time The start time (null: not set)
* @param ?TIME $end_date_time The end time (null: not set)
* @param array $groups List of groups of which to limit the message (empty: no limit)
* @param array $page_links List of page links of which to limit the message (empty: no limit)
* @return AUTO_LINK The ID of the site message created
*/
function add_site_message(string $title, string $message, string $type, int $validated = 1, ?int $start_date_time = null, ?int $end_date_time = null, array $groups = [], array $page_links = []) : int
* Add a new site message.
*
* @param SHORT_TEXT $title The title
* @param LONG_TEXT $message The message
* @param ID_TEXT $type The message type
* @set inform notice warn
* @param BINARY $validated Whether this entry is validated
* @param ?TIME $start_date_time The start time (null: not set)
* @param ?TIME $end_date_time The end time (null: not set)
* @param array $groups List of groups of which to limit the message (empty: no limit)
* @param array $page_links List of page links of which to limit the message (empty: no limit)
* @return AUTO_LINK The ID of the site message created
*/
function add_site_message(string $title, string $message, string $type, int $validated = 1, ?int $start_date_time = null, ?int $end_date_time = null, array $groups = [], array $page_links = []) : int