Function __global->_create_media_template_parameters
Definitions
sources/media_renderer.php
- Turn standardised media parameters into standardised media template parameters.
- 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 | mixed | No | No | required parameter | N/A | N/A | The URL |
| $attributes | array | No | No | required parameter | N/A | N/A | Attributes (Any combination of: thumb_url, width, height, length, filename, mime_type, description, filesize, framed, wysiwyg_editable, num_downloads, click_url, thumb) |
| $as_admin | boolean | No | No | False | N/A | N/A | Whether there are admin privileges, to render dangerous media types |
| $source_member | ?MEMBER | No | No | Null | N/A | N/A | Member to run as (null: current member) |
| $prefer_natural_size | boolean | No | No | False | N/A | N/A | Let the media size itself rather than detecting a size |
| $url_direct_filesystem | ?URLPATH | No | No | Null | N/A | N/A | Direct URL (not via a script) (null: just use the normal URL) |
Returns
- Template-ready parameters
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Turn standardised media parameters into standardised media template parameters.
*
* @param mixed $url The URL
* @param array $attributes Attributes (Any combination of: thumb_url, width, height, length, filename, mime_type, description, filesize, framed, wysiwyg_editable, num_downloads, click_url, thumb)
* @param boolean $as_admin Whether there are admin privileges, to render dangerous media types
* @param ?MEMBER $source_member Member to run as (null: current member)
* @param boolean $prefer_natural_size Let the media size itself rather than detecting a size
* @param ?URLPATH $url_direct_filesystem Direct URL (not via a script) (null: just use the normal URL)
* @return array Template-ready parameters
*/
function _create_media_template_parameters($url, array $attributes, bool $as_admin = false, ?int $source_member = null, bool $prefer_natural_size = false, ?string $url_direct_filesystem = null) : array
* Turn standardised media parameters into standardised media template parameters.
*
* @param mixed $url The URL
* @param array $attributes Attributes (Any combination of: thumb_url, width, height, length, filename, mime_type, description, filesize, framed, wysiwyg_editable, num_downloads, click_url, thumb)
* @param boolean $as_admin Whether there are admin privileges, to render dangerous media types
* @param ?MEMBER $source_member Member to run as (null: current member)
* @param boolean $prefer_natural_size Let the media size itself rather than detecting a size
* @param ?URLPATH $url_direct_filesystem Direct URL (not via a script) (null: just use the normal URL)
* @return array Template-ready parameters
*/
function _create_media_template_parameters($url, array $attributes, bool $as_admin = false, ?int $source_member = null, bool $prefer_natural_size = false, ?string $url_direct_filesystem = null) : array

