Function __global->add_download_category

Definitions

sources/downloads2.php

  • Add a download category.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$category SHORT_TEXT No No required parameter N/A N/A The name of the download category
$parent_id ?AUTO_LINK No No required parameter N/A N/A The parent download category (null: this is a root category)
$description LONG_TEXT No No required parameter N/A N/A A description
$notes LONG_TEXT No No Blank (empty string) N/A N/A Hidden notes pertaining to this download category
$rep_image URLPATH No No Blank (empty string) N/A N/A The representative image for the category (blank: none)
$id ?AUTO_LINK No No Null N/A N/A Force an ID (null: don't force an ID)
$add_time ?TIME No No Null N/A N/A Add time (null: now)
$meta_keywords ?SHORT_TEXT No No Blank (empty string) N/A N/A Meta keywords for this resource (null: do not edit) (blank: implicit)
$meta_description ?LONG_TEXT No No Blank (empty string) N/A N/A Meta description for this resource (null: do not edit) (blank: implicit)

Returns

  • The ID of the newly added download category
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a download category.
 *
 * @param  SHORT_TEXT $category The name of the download category
 * @param  ?AUTO_LINK $parent_id The parent download category (null: this is a root category)
 * @param  LONG_TEXT $description A description
 * @param  LONG_TEXT $notes Hidden notes pertaining to this download category
 * @param  URLPATH $rep_image The representative image for the category (blank: none)
 * @param  ?AUTO_LINK $id Force an ID (null: don't force an ID)
 * @param  ?TIME $add_time Add time (null: now)
 * @param  ?SHORT_TEXT $meta_keywords Meta keywords for this resource (null: do not edit) (blank: implicit)
 * @param  ?LONG_TEXT $meta_description Meta description for this resource (null: do not edit) (blank: implicit)
 * @return AUTO_LINK The ID of the newly added download category
 */

function add_download_category(string $category, ?int $parent_id, string $description, string $notes = '', string $rep_image = '', ?int $id = null, ?int $add_time = null, ?string $meta_keywords = '', ?string $meta_description = '') : int