PHP 클래스 The_SEO_Framework\Site_Options

Handles Site Options for the plugin.
부터: 2.7.1
상속: extends Sanitize
파일 보기 프로젝트 열기: sybrew/the-seo-framework

공개 프로퍼티들

프로퍼티 타입 설명
$seo_settings_page_slug Hold the SEO Settings Page ID for this plugin.

보호된 프로퍼티들

프로퍼티 타입 설명
$o_plugin_updated Holds the update option.
$settings_field Site Settings field.

공개 메소드들

메소드 설명
fb_locales ( ) : array Returns Facebook locales array values.
get_all_options ( string $setting = null ) : array Return current option array.
get_default_option ( string $key, boolean $use_cache = true ) : mixed Return Default SEO options from the SEO options array.
get_default_settings ( string $key, string $setting = '', boolean $use_cache = true ) : integer | boolean | string Get the default of any of the The SEO Framework settings.
get_default_site_options ( ) : array Holds default site options.
get_option ( string $key, boolean $use_cache = true ) : mixed Return SEO options from the SEO options database.
get_site_option ( string $key, boolean $use_cache = true ) : mixed Return SEO options from the SEO options database.
get_user_id ( ) : integer Sets up user ID and returns it if user is found.
get_user_meta ( integer $user_id, string $key = THE_SEO_FRAMEWORK_USER_OPTIONS, boolean $use_cache = true ) : array Fetches The SEO Framework usermeta.
get_user_option ( integer $user_id, string $option, mixed $default = null ) : mixed Fetches user SEO user meta data by name.
get_warned_settings ( string $key, string $setting = '', boolean $use_cache = true ) : integer Get the warned setting of any of the The SEO Framework settings.
get_warned_site_options ( ) : array Holds warned site options array.
language_keys ( ) : array Returns Facebook locales array keys.
register_settings ( ) : void Register the database settings for storage.
site_updated_plugin_notice ( ) Echos plugin updated notification.
site_updated_plugin_option ( ) : void Updates option from default options at plugin update.
the_seo_framework_get_option ( string $key, string $setting = null, boolean $use_cache = true ) : mixed Return option from the options table and cache result.
update_settings ( string | array $new = '', string $settings_field = '' ) Allows updating of settings.
update_user_option ( integer $user_id, string $option, mixed $value ) : boolean Updates user SEO option.

보호된 메소드들

메소드 설명
__construct ( ) Constructor, load parent constructor and set up cachable variables.
default_site_options ( array $args = [] ) : array Return the parsed default options array.
pre_output_site_updated_plugin_notice ( ) Determine whether to output update notice directly or on refresh.
update_hidden_options_to_default ( ) Updates special hidden values to default on settings save.
warned_site_options ( array $args = [] ) : array Return the Warned site options. Options which should be 'avoided' return true.

메소드 상세

__construct() 보호된 메소드

Constructor, load parent constructor and set up cachable variables.
protected __construct ( )

default_site_options() 보호된 메소드

Return the parsed default options array.
부터: 2.2.7 Applies filters the_seo_framework_default_site_options : The default site options array.
protected default_site_options ( array $args = [] ) : array
$args array Additional default options to filter.
리턴 array The SEO Framework Options

fb_locales() 공개 메소드

Returns Facebook locales array values.
또한 보기: https://www.facebook.com/translations/FacebookLocales.xml
부터: 2.5.2
public fb_locales ( ) : array
리턴 array Valid Facebook locales

get_all_options() 공개 메소드

Return current option array.
부터: 2.6.0
public get_all_options ( string $setting = null ) : array
$setting string The setting key.
리턴 array Options.

get_default_option() 공개 메소드

Return Default SEO options from the SEO options array.
부터: 2.2.5
public get_default_option ( string $key, boolean $use_cache = true ) : mixed
$key string Option name.
$use_cache boolean Optional. Whether to use the cache value or not. Defaults to true.
리턴 mixed The value of this $key in the database.

get_default_settings() 공개 메소드

Get the default of any of the The SEO Framework settings.
부터: 2.2.4
public get_default_settings ( string $key, string $setting = '', boolean $use_cache = true ) : integer | boolean | string
$key string required The option name
$setting string optional The settings field
$use_cache boolean optional Use the options cache or not. For debugging purposes.
리턴 integer | boolean | string default option int '-1' if option doesn't exist.

get_default_site_options() 공개 메소드

Holds default site options.
부터: 2.6.0
public get_default_site_options ( ) : array
리턴 array Default site options.

get_option() 공개 메소드

Return SEO options from the SEO options database.
부터: 2.2.2
public get_option ( string $key, boolean $use_cache = true ) : mixed
$key string Option name.
$use_cache boolean Optional. Whether to use the cache value or not. Defaults to true.
리턴 mixed The value of this $key in the database.

get_site_option() 공개 메소드

Return SEO options from the SEO options database.
부터: 2.2.2
public get_site_option ( string $key, boolean $use_cache = true ) : mixed
$key string Option name.
$use_cache boolean Optional. Whether to use the cache value or not. Defaults to true.
리턴 mixed The value of this $key in the database.

get_user_id() 공개 메소드

To be used in AJAX, back-end and front-end.
부터: 2.7.0
public get_user_id ( ) : integer
리턴 integer $user_id : 0 if user is not found.

get_user_meta() 공개 메소드

Fetches The SEO Framework usermeta.
부터: 2.7.0
public get_user_meta ( integer $user_id, string $key = THE_SEO_FRAMEWORK_USER_OPTIONS, boolean $use_cache = true ) : array
$user_id integer The user ID.
$key string The user metadata key. Leave empty to fetch all data.
$use_cache boolean Whether to store and use options from cache.
리턴 array The user SEO meta data.

get_user_option() 공개 메소드

Caches all meta data per $user_id.
부터: 2.7.0
public get_user_option ( integer $user_id, string $option, mixed $default = null ) : mixed
$user_id integer The user ID. When empty, it will try to fetch the current user.
$option string The option name.
$default mixed The default value to return when the data doesn't exist.
리턴 mixed The metadata value.

get_warned_settings() 공개 메소드

Get the warned setting of any of the The SEO Framework settings.
부터: 2.3.4
public get_warned_settings ( string $key, string $setting = '', boolean $use_cache = true ) : integer
$key string required The option name
$setting string optional The settings field
$use_cache boolean optional Use the options cache or not. For debugging purposes.
리턴 integer 0|1 Whether the option is flagged as dangerous for SEO. int '-1' if option doesn't exist.

get_warned_site_options() 공개 메소드

Holds warned site options array.
부터: 2.6.0
public get_warned_site_options ( ) : array
리턴 array $options.

language_keys() 공개 메소드

This is apart from the fb_locales array since there are "duplicated" keys. Use this to compare the numeric key position.
또한 보기: https://www.facebook.com/translations/FacebookLocales.xml
부터: 2.5.2
public language_keys ( ) : array
리턴 array Valid Facebook locale keys

pre_output_site_updated_plugin_notice() 보호된 메소드

Run before headers are sent.
부터: 2.6.0

register_settings() 공개 메소드

Register the database settings for storage.
부터: 2.2.2
public register_settings ( ) : void
리턴 void

site_updated_plugin_notice() 공개 메소드

Echos plugin updated notification.
부터: 2.6.0

site_updated_plugin_option() 공개 메소드

Updates option from default options at plugin update.
부터: 2.6.0
public site_updated_plugin_option ( ) : void
리턴 void early if already has been updated.

the_seo_framework_get_option() 공개 메소드

Values pulled from the database are cached on each request, so a second request for the same value won't cause a second DB interaction.
부터: 2.0.0
public the_seo_framework_get_option ( string $key, string $setting = null, boolean $use_cache = true ) : mixed
$key string Option name.
$setting string Optional. Settings field name. Eventually defaults to null if not passed as an argument.
$use_cache boolean Optional. Whether to use the cache value or not. Default is true.
리턴 mixed The value of this $key in the database.

update_hidden_options_to_default() 보호된 메소드

Updates special hidden values to default on settings save.
부터: 2.6.0

update_settings() 공개 메소드

Allows updating of settings.
부터: 2.7.0
public update_settings ( string | array $new = '', string $settings_field = '' )
$new string | array The new setting(s).
$settings_field string The Settings Field to update. Defaults to The SEO Framework settings field.

update_user_option() 공개 메소드

Updates user SEO option.
부터: 2.7.0
public update_user_option ( integer $user_id, string $option, mixed $value ) : boolean
$user_id integer The user ID.
$option string The user's SEO metadata option.
$value mixed The escaped option value.
리턴 boolean True on success. False on failure.

warned_site_options() 보호된 메소드

Return the Warned site options. Options which should be 'avoided' return true.
부터: 2.3.4 Applies filters 'the_seo_framework_warned_site_options' : array The warned site options array.
protected warned_site_options ( array $args = [] ) : array
$args array Additional warned options to filter.
리턴 array The SEO Framework Warned Options

프로퍼티 상세

$o_plugin_updated 보호되어 있는 프로퍼티

Holds the update option.
부터: 2.6.0
protected $o_plugin_updated

$seo_settings_page_slug 공개적으로 프로퍼티

Hold the SEO Settings Page ID for this plugin.
부터: 2.2.2
부터: 2.70 Renamed var from page_id and made public.
public $seo_settings_page_slug

$settings_field 보호되어 있는 프로퍼티

Site Settings field.
부터: 2.2.2
protected $settings_field