Function __global->find_theme_image
Definitions
sources/themes.php
- Find the URL to the theme image of the specified ID. It searches various priorities, including language and theme overrides.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $id | ID_TEXT | No | No | required parameter | N/A | N/A | The theme image ID |
| $silent_fail | boolean | No | No | False | N/A | N/A | Whether to silently fail (i.e. not give out an error message when a theme image cannot be found) |
| $leave_local | boolean | No | No | False | N/A | N/A | Whether to leave URLs as relative local URLs |
| $theme | ?ID_TEXT | No | No | Null | N/A | N/A | The theme to search in (null: users current theme) |
| $lang | ?LANGUAGE_NAME | No | No | Null | N/A | N/A | The language to search for (null: users current language) |
| $db | ?object | No | No | Null | N/A | N/A | The database to use (null: site database) |
| $pure_only | boolean | No | No | False | N/A | N/A | Whether to only search the default 'images' filesystem |
Returns
- The URL found (blank: not found)
- Type: URLPATH
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find the URL to the theme image of the specified ID. It searches various priorities, including language and theme overrides.
*
* @param ID_TEXT $id The theme image ID
* @param boolean $silent_fail Whether to silently fail (i.e. not give out an error message when a theme image cannot be found)
* @param boolean $leave_local Whether to leave URLs as relative local URLs
* @param ?ID_TEXT $theme The theme to search in (null: users current theme)
* @param ?LANGUAGE_NAME $lang The language to search for (null: users current language)
* @param ?object $db The database to use (null: site database)
* @param boolean $pure_only Whether to only search the default 'images' filesystem
* @return URLPATH The URL found (blank: not found)
*/
function find_theme_image(string $id, bool $silent_fail = false, bool $leave_local = false, ?string $theme = null, ?string $lang = null, ?object $db = null, bool $pure_only = false) : string
* Find the URL to the theme image of the specified ID. It searches various priorities, including language and theme overrides.
*
* @param ID_TEXT $id The theme image ID
* @param boolean $silent_fail Whether to silently fail (i.e. not give out an error message when a theme image cannot be found)
* @param boolean $leave_local Whether to leave URLs as relative local URLs
* @param ?ID_TEXT $theme The theme to search in (null: users current theme)
* @param ?LANGUAGE_NAME $lang The language to search for (null: users current language)
* @param ?object $db The database to use (null: site database)
* @param boolean $pure_only Whether to only search the default 'images' filesystem
* @return URLPATH The URL found (blank: not found)
*/
function find_theme_image(string $id, bool $silent_fail = false, bool $leave_local = false, ?string $theme = null, ?string $lang = null, ?object $db = null, bool $pure_only = false) : string

