Function __global->do_image_thumb
Definitions
sources/images.php
- Get the Tempcode for an image thumbnail.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
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 image thumbnail |
| $caption | mixed | No | No | Blank (empty string) | N/A | N/A | The caption for the thumbnail, provided in plain-text format or as HTML via do_lang_tempcode/protect_from_escaping (string or Tempcode) |
| $js_tooltip | boolean | No | No | False | N/A | N/A | Whether to use a JS tooltip. Forcibly set to true if you pass Tempcode |
| $is_thumbnail_already | boolean | No | No | True | N/A | N/A | Whether already a thumbnail (if not, function will make one) |
| $width | ?integer | No | No | Null | N/A | N/A | Thumbnail width to use (null: default) |
| $height | ?integer | No | No | Null | N/A | N/A | Thumbnail height to use (null: default) |
| $only_make_smaller | boolean | No | No | False | N/A | N/A | Whether to apply a 'never make the image bigger' rule for thumbnail creation (would affect very small images) |
Returns
- The thumbnail
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the Tempcode for an image thumbnail.
*
* @param URLPATH $url The URL to the image thumbnail
* @param mixed $caption The caption for the thumbnail, provided in plain-text format or as HTML via do_lang_tempcode/protect_from_escaping (string or Tempcode)
* @param boolean $js_tooltip Whether to use a JS tooltip. Forcibly set to true if you pass Tempcode
* @param boolean $is_thumbnail_already Whether already a thumbnail (if not, function will make one)
* @param ?integer $width Thumbnail width to use (null: default)
* @param ?integer $height Thumbnail height to use (null: default)
* @param boolean $only_make_smaller Whether to apply a 'never make the image bigger' rule for thumbnail creation (would affect very small images)
* @return Tempcode The thumbnail
*/
function do_image_thumb(string $url, $caption = '', bool $js_tooltip = false, bool $is_thumbnail_already = true, ?int $width = null, ?int $height = null, bool $only_make_smaller = false) : object
* Get the Tempcode for an image thumbnail.
*
* @param URLPATH $url The URL to the image thumbnail
* @param mixed $caption The caption for the thumbnail, provided in plain-text format or as HTML via do_lang_tempcode/protect_from_escaping (string or Tempcode)
* @param boolean $js_tooltip Whether to use a JS tooltip. Forcibly set to true if you pass Tempcode
* @param boolean $is_thumbnail_already Whether already a thumbnail (if not, function will make one)
* @param ?integer $width Thumbnail width to use (null: default)
* @param ?integer $height Thumbnail height to use (null: default)
* @param boolean $only_make_smaller Whether to apply a 'never make the image bigger' rule for thumbnail creation (would affect very small images)
* @return Tempcode The thumbnail
*/
function do_image_thumb(string $url, $caption = '', bool $js_tooltip = false, bool $is_thumbnail_already = true, ?int $width = null, ?int $height = null, bool $only_make_smaller = false) : object

