Documentation

CommonUserSettingsTrait uses trait:short

Trait common user settings helper methods.

Tags
since
4.0.8

Table of Contents

Methods

get()  : string|bool
Gets (and persists) a string to the user (settings) metadata.
is()  : bool
Gets (and persists) a checkbox to the user (settings) metadata.
hardReloadAfterSaveIfBodyHasClass()  : mixed
Reload the current document if the `body` has a given class. This allows you e.g. to only reload in Media Library view instead of while editing a post.
reloadAfterSave()  : mixed
Reload the current selected folder after the metadata is successfully saved.

Methods

get()

Gets (and persists) a string to the user (settings) metadata.

protected static get(string $meta[, bool $persist = null ]) : string|bool
Parameters
$meta : string

The meta key

$persist : bool = null

If setted it will be updated or deleted

Return values
string|bool

is()

Gets (and persists) a checkbox to the user (settings) metadata.

protected static is(string $meta[, bool $persist = null ]) : bool
Parameters
$meta : string

The meta key

$persist : bool = null

If setted it will be updated or deleted

Return values
bool

hardReloadAfterSaveIfBodyHasClass()

Reload the current document if the `body` has a given class. This allows you e.g. to only reload in Media Library view instead of while editing a post.

private hardReloadAfterSaveIfBodyHasClass(array<string|int, string> &$response, string $class) : mixed
Parameters
$response : array<string|int, string>
$class : string

reloadAfterSave()

Reload the current selected folder after the metadata is successfully saved.

private reloadAfterSave(array<string|int, string> &$response) : mixed
Parameters
$response : array<string|int, string>
On this page

Search results