Function __global->add_gallery_media_wrap
Definitions
sources/galleries2.php
- Take a file in the gallery uploads directory, and add it to a gallery.Intended for bulk operations, where many mixed media files are imported with common settings and other settings derived from metadata/defaults.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$url | URLPATH | No | No | required parameter | N/A | N/A | The URL to the file (must be a URL relative to the base URL) |
$_cat | ID_TEXT | No | No | required parameter | N/A | N/A | The gallery to add to |
$member_id | MEMBER | No | No | required parameter | N/A | N/A | The ID of the member adding gallery media |
$allow_rating | integer | No | No | required parameter | N/A | N/A | Post param indicating whether or not ratings should be allowed |
$allow_comments_reviews | integer | No | No | required parameter | N/A | N/A | Post param combination indicating whether to allow comments or reviews |
$allow_trackbacks | integer | No | No | required parameter | N/A | N/A | Post param indicating whether or not to allow trackbacks |
$watermark | boolean | No | No | required parameter | N/A | N/A | Whether or not to apply the gallery's watermarks to the file if it is an image |
$notes | string | No | No | required parameter | N/A | N/A | Staff notes provided for this entry |
$privacy_level | ID_TEXT | No | No | required parameter | N/A | N/A | Level of privacy set for this content |
$additional_access | array | No | No | required parameter | N/A | N/A | Array of additional members who should have access to this content |
$filename | ?string | No | No | Null | N/A | N/A | The filename (null: derive from $url) |
$time | ?TIME | No | No | Null | N/A | N/A | Timestamp to use (null: now) |
$fallback_title | string | No | No | Blank (empty string) | N/A | N/A | The fallback title to use if a title is required but we could not get one (blank: none) |
Returns
- A pair: The media type, The media ID (null: error)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Take a file in the gallery uploads directory, and add it to a gallery.Intended for bulk operations, where many mixed media files are imported with common settings and other settings derived from metadata/defaults.
*
* @param URLPATH $url The URL to the file (must be a URL relative to the base URL)
* @param ID_TEXT $_cat The gallery to add to
* @param MEMBER $member_id The ID of the member adding gallery media
* @param integer $allow_rating Post param indicating whether or not ratings should be allowed
* @param integer $allow_comments_reviews Post param combination indicating whether to allow comments or reviews
* @param integer $allow_trackbacks Post param indicating whether or not to allow trackbacks
* @param boolean $watermark Whether or not to apply the gallery's watermarks to the file if it is an image
* @param string $notes Staff notes provided for this entry
* @param ID_TEXT $privacy_level Level of privacy set for this content
* @param array $additional_access Array of additional members who should have access to this content
* @param ?string $filename The filename (null: derive from $url)
* @param ?TIME $time Timestamp to use (null: now)
* @param string $fallback_title The fallback title to use if a title is required but we could not get one (blank: none)
* @return ?array A pair: The media type, The media ID (null: error)
*/
function add_gallery_media_wrap(string $url, string $_cat, int $member_id, int $allow_rating, int $allow_comments_reviews, int $allow_trackbacks, bool $watermark, string $notes, string $privacy_level, array $additional_access, ?string $filename = null, ?int $time = null, string $fallback_title = '') : ?array
* Take a file in the gallery uploads directory, and add it to a gallery.Intended for bulk operations, where many mixed media files are imported with common settings and other settings derived from metadata/defaults.
*
* @param URLPATH $url The URL to the file (must be a URL relative to the base URL)
* @param ID_TEXT $_cat The gallery to add to
* @param MEMBER $member_id The ID of the member adding gallery media
* @param integer $allow_rating Post param indicating whether or not ratings should be allowed
* @param integer $allow_comments_reviews Post param combination indicating whether to allow comments or reviews
* @param integer $allow_trackbacks Post param indicating whether or not to allow trackbacks
* @param boolean $watermark Whether or not to apply the gallery's watermarks to the file if it is an image
* @param string $notes Staff notes provided for this entry
* @param ID_TEXT $privacy_level Level of privacy set for this content
* @param array $additional_access Array of additional members who should have access to this content
* @param ?string $filename The filename (null: derive from $url)
* @param ?TIME $time Timestamp to use (null: now)
* @param string $fallback_title The fallback title to use if a title is required but we could not get one (blank: none)
* @return ?array A pair: The media type, The media ID (null: error)
*/
function add_gallery_media_wrap(string $url, string $_cat, int $member_id, int $allow_rating, int $allow_comments_reviews, int $allow_trackbacks, bool $watermark, string $notes, string $privacy_level, array $additional_access, ?string $filename = null, ?int $time = null, string $fallback_title = '') : ?array