um_trim_string()
um_trim_string(string $s, int $length = 20) : string
Trim string by char length
Parameters
| string | $s | |
| int | $length |
Make public functions without class creation
um_fetch_user( $user_id) : mixed
Sets a specific user and prepares profile data and user permissions and makes them accessible.
| $user_id | (required) A user ID is required. This is the user's ID that you wish to set/retrieve |
um_maybe_unserialize(string $data) : mixed
Unserializes data if it is serialized, with security precautions.
This method checks if the given data is serialized and unserializes it while disallowing deserialization of objects to prevent potential security risks.
| string | $data | The data that may be serialized. |
The unserialized data if it was serialized, or the original data if not.
um_is_amp(bool $check_theme_support = true) : bool
Check whether the current page is in AMP mode or not.
We need to check for specific functions, as there is no special AMP header.
| bool | $check_theme_support | Whether theme support should be checked. Defaults to true. |
um_safe_redirect(string $url) : mixed
UM safe redirect. By default, you can be redirected only to WordPress installation Home URL. Fallback URL is wp-admin URL.
But it can be changed through filters and extended by UM Setting "Allowed hosts for safe redirect (one host per line)" and filter um_wp_safe_redirect_fallback.
| string | $url | redirect URL. |