multisite.php
Table of Contents
- is_net_active() : bool
- Whether the wallets plugin is network-active on a multisite installation.
- maybe_switch_blog() : bool
- Switch to main site/blog to do DB stuff.
- maybe_restore_blog() : bool
- Switch back from blog 1 to the current blog after doing DB stuff.
- add_ds_option() : bool
- Creates a new option/value pair related to the plugin.
- update_ds_option() : bool
- Updates an existing option/value pair related to the plugin, or creates the option.
- get_ds_option() : mixed
- Retrieves an option's value.
- delete_ds_option() : bool
- Deletes an option's value.
- set_ds_transient() : bool
- Sets a transient value to be used as cached data.
- delete_ds_transient() : bool
- Deletes a transient value.
- get_ds_transient() : mixed
- Retrieves cached data that was previously stored in a transient.
- ds_user_can() : mixed
- ds_current_user_can() : mixed
Functions
is_net_active()
Whether the wallets plugin is network-active on a multisite installation.
is_net_active() : bool
Return values
bool —True iff net active on MS.
maybe_switch_blog()
Switch to main site/blog to do DB stuff.
maybe_switch_blog() : bool
This is useful for any function that does DB stuff, and ensures that data is synced between blogs.
Return values
bool —Whether the blog was switched.
maybe_restore_blog()
Switch back from blog 1 to the current blog after doing DB stuff.
maybe_restore_blog() : bool
This is useful for any function that does DB stuff, and ensures that data is synced between blogs.
Return values
bool —Whether the blog was switched back.
add_ds_option()
Creates a new option/value pair related to the plugin.
add_ds_option(string $option, mixed $value) : bool
This delegates to the WordPress function add_option. But if the plugin is network-active on a multisite installation, the option is created on the network's main blog. This ensures that settings are global over all blogs.
Parameters
- $option : string
-
The option name.
- $value : mixed
-
The option value.
Tags
Return values
bool —The result of the wrapped function.
update_ds_option()
Updates an existing option/value pair related to the plugin, or creates the option.
update_ds_option(string $option, mixed $value) : bool
This delegates to the WordPress function update_option. But if the plugin is network-active on a multisite installation, the option is updated on the network's main blog. This ensures that settings are global over all blogs.
Parameters
- $option : string
-
The option name.
- $value : mixed
-
The option value.
Tags
Return values
bool —The result of the wrapped function.
get_ds_option()
Retrieves an option's value.
get_ds_option(string $option[, mixed $default = false ]) : mixed
This delegates to the WordPress function get_option. But if the plugin is network-active on a multisite installation, the option is retrieved from the network's main blog. This ensures that settings are global over all blogs.
Parameters
- $option : string
-
The option name.
- $default : mixed = false
Tags
Return values
mixed —The result of the wrapped function.
delete_ds_option()
Deletes an option's value.
delete_ds_option(string $option) : bool
This delegates to the WordPress function delete_option. But if the plugin is network-active on a multisite installation, the option is deleted from the network's main blog. This ensures that settings are global over all blogs.
Parameters
- $option : string
-
The option name.
Tags
Return values
bool —The result of the wrapped function.
set_ds_transient()
Sets a transient value to be used as cached data.
set_ds_transient(string $transient, mixed $value, int $expiration) : bool
This delegates to the WordPress function set_transient. But if the plugin is network-active on a multisite installation, the transient is saved on the network's main blog. This ensures that cached data are global over all blogs.
Parameters
- $transient : string
-
The transient name.
- $value : mixed
-
The transient value.
- $expiration : int
-
Time until expiration in seconds from now, or 0 for never expires.
Tags
Return values
bool —The result of the wrapped function.
delete_ds_transient()
Deletes a transient value.
delete_ds_transient(string $transient) : bool
This delegates to the WordPress function delete_transient. But if the plugin is network-active on a multisite installation, the transient is deleted from the network's main blog. This ensures that cached data are global over all blogs.
Parameters
- $transient : string
-
The transient name.
Tags
Return values
bool —True if successful, false otherwise.
get_ds_transient()
Retrieves cached data that was previously stored in a transient.
get_ds_transient(string $transient[, mixed $default = false ]) : mixed
This delegates to the WordPress function get_transient. But if the plugin is network-active on a multisite installation, the transient is retrieved from the network's main blog. This ensures that cached data are global over all blogs.
Parameters
- $transient : string
-
The transient name.
- $default : mixed = false
-
The default value to return if transient was not found.
Tags
Return values
mixed —The result of the wrapped function.
ds_user_can()
ds_user_can(mixed $user, string $capability, mixed ...$args) : mixed
Parameters
- $user : mixed
- $capability : string
- $args : mixed
Return values
mixed —ds_current_user_can()
ds_current_user_can(string $capability, mixed ...$args) : mixed
Parameters
- $capability : string
- $args : mixed