Function __global->add_news_category
Definitions
sources/news2.php
- Add a news category of the specified details.
- 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 news category title |
$img | ID_TEXT | No | No | icons/news/general | N/A | N/A | The theme image ID of the picture to use for the news category |
$notes | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | Notes for the news category |
$owner | ?MEMBER | No | No | Null | N/A | N/A | The owner (null: public) |
$id | ?AUTO_LINK | No | No | Null | N/A | N/A | Force an ID (null: don't force an ID) |
Returns
- The ID of our new news category
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add a news category of the specified details.
*
* @param SHORT_TEXT $title The news category title
* @param ID_TEXT $img The theme image ID of the picture to use for the news category
* @param LONG_TEXT $notes Notes for the news category
* @param ?MEMBER $owner The owner (null: public)
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @return AUTO_LINK The ID of our new news category
*/
function add_news_category(string $title, string $img = 'icons/news/general', string $notes = '', ?int $owner = null, ?int $id = null) : int
* Add a news category of the specified details.
*
* @param SHORT_TEXT $title The news category title
* @param ID_TEXT $img The theme image ID of the picture to use for the news category
* @param LONG_TEXT $notes Notes for the news category
* @param ?MEMBER $owner The owner (null: public)
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @return AUTO_LINK The ID of our new news category
*/
function add_news_category(string $title, string $img = 'icons/news/general', string $notes = '', ?int $owner = null, ?int $id = null) : int