PHP Класс Jetpack_Options, jetpack

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
delete_option ( string | array $names ) : boolean Deletes the given option. May be passed multiple option names as an array.
get_option ( string $name, mixed $default = false ) : mixed Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate.
get_option_and_ensure_autoload ( string $name, mixed $default ) : mixed | void Returns the requested option, and ensures it's autoloaded in the future.
get_option_names ( string $type = 'compact' ) : array Returns an array of option names for a given type.
is_valid ( string $name, string | null $group = null ) : boolean Is the option name valid?
update_option ( string $name, mixed $value, string $autoload = null ) : boolean Updates the single given option. Updates jetpack_options or jetpack_$name as appropriate.
update_options ( array $array ) Updates the multiple given options. Updates jetpack_options and/or jetpack_$name as appropriate.

Приватные методы

Метод Описание
delete_grouped_option ( $group, $names )
get_grouped_option ( $group, $name, $default )
update_grouped_option ( $group, $name, $value )

Описание методов

delete_option() публичный статический Метод

Updates jetpack_options and/or deletes jetpack_$name as appropriate.
public static delete_option ( string | array $names ) : boolean
$names string | array
Результат boolean Was the option successfully deleted?

get_option() публичный статический Метод

Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate.
public static get_option ( string $name, mixed $default = false ) : mixed
$name string Option name
$default mixed (optional)
Результат mixed

get_option_and_ensure_autoload() публичный статический Метод

This does _not_ adjust the prefix in any way (does not prefix jetpack_%)
public static get_option_and_ensure_autoload ( string $name, mixed $default ) : mixed | void
$name string Option name
$default mixed (optional)
Результат mixed | void

get_option_names() публичный статический Метод

Returns an array of option names for a given type.
public static get_option_names ( string $type = 'compact' ) : array
$type string The type of option to return. Defaults to 'compact'.
Результат array

is_valid() публичный статический Метод

Is the option name valid?
public static is_valid ( string $name, string | null $group = null ) : boolean
$name string The name of the option
$group string | null The name of the group that the option is in. Default to null, which will search non_compact.
Результат boolean Is the option name valid?

update_option() публичный статический Метод

Updates the single given option. Updates jetpack_options or jetpack_$name as appropriate.
public static update_option ( string $name, mixed $value, string $autoload = null ) : boolean
$name string Option name
$value mixed Option value
$autoload string If not compact option, allows specifying whether to autoload or not.
Результат boolean Was the option successfully updated?

update_options() публичный статический Метод

Updates the multiple given options. Updates jetpack_options and/or jetpack_$name as appropriate.
public static update_options ( array $array )
$array array array( option name => option value, ... )