PHP 클래스 Jetpack_Options, jetpack

파일 보기 프로젝트 열기: automattic/jetpack 1 사용 예제들

공개 메소드들

메소드 설명
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, ... )