[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-customize-setting.php (summary)

WordPress Customize Setting classes

File Size: 967 lines (28 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 5 files
 wp-includes/customize/class-wp-customize-filter-setting.php
 wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
 wp-includes/customize/class-wp-customize-header-image-setting.php
 wp-includes/customize/class-wp-customize-background-image-setting.php
 wp-includes/customize/class-wp-customize-nav-menu-setting.php

Defines 1 class

WP_Customize_Setting:: (26 methods):
  __construct()
  id_data()
  aggregate_multidimensional()
  reset_aggregated_multidimensionals()
  is_current_blog_previewed()
  preview()
  _clear_aggregated_multidimensional_preview_applied_flag()
  _preview_filter()
  _multidimensional_preview_filter()
  save()
  post_value()
  sanitize()
  validate()
  get_root_value()
  set_root_value()
  update()
  _update_theme_mod()
  _update_option()
  value()
  js_value()
  json()
  check_capabilities()
  multidimensional()
  multidimensional_replace()
  multidimensional_get()
  multidimensional_isset()


Class: WP_Customize_Setting  - X-Ref

Customize Setting class.

Handles saving and sanitizing of settings.

__construct( $manager, $id, $args = array()   X-Ref
Constructor.

Any supplied $args override class property defaults.

since: 3.4.0
param: WP_Customize_Manager $manager
param: string               $id      An specific ID of the setting. Can be a
param: array                $args    Setting arguments.

id_data()   X-Ref
Get parsed ID data for multidimensional setting.

return: array {
since: 4.4.0

aggregate_multidimensional()   X-Ref
Set up the setting for aggregated multidimensional values.

When a multidimensional setting gets aggregated, all of its preview and update
calls get combined into one call, greatly improving performance.

since: 4.4.0

reset_aggregated_multidimensionals()   X-Ref
Reset `$aggregated_multidimensionals` static variable.

This is intended only for use by unit tests.

since: 4.5.0

is_current_blog_previewed()   X-Ref
Return true if the current site is not the same as the previewed site.

return: bool If preview() has been called.
since: 4.2.0

preview()   X-Ref
Add filters to supply the setting's value when accessed.

If the setting already has a pre-existing value and there is no incoming
post value for the setting, then this method will short-circuit since
there is no change to preview.

return: bool False when preview short-circuits due no change needing to be previewed.
since: 3.4.0
since: 4.4.0 Added boolean return value.

_clear_aggregated_multidimensional_preview_applied_flag()   X-Ref
Clear out the previewed-applied flag for a multidimensional-aggregated value whenever its post value is updated.

This ensures that the new value will get sanitized and used the next time
that `WP_Customize_Setting::_multidimensional_preview_filter()`
is called for this setting.

since: 4.4.0

_preview_filter( $original )   X-Ref
Callback function to filter non-multidimensional theme mods and options.

If switch_to_blog() was called after the preview() method, and the current
site is now not the same site, then this method does a no-op and returns
the original value.

return: mixed New or old value.
since: 3.4.0
param: mixed $original Old value.

_multidimensional_preview_filter( $original )   X-Ref
Callback function to filter multidimensional theme mods and options.

For all multidimensional settings of a given type, the preview filter for
the first setting previewed will be used to apply the values for the others.

return: mixed New or old value.
since: 4.4.0
param: mixed $original Original root value.

save()   X-Ref
Checks user capabilities and theme supports, and then saves
the value of the setting.

return: false|void False if cap check fails or value isn't set or is invalid.
since: 3.4.0

post_value( $default = null )   X-Ref
Fetch and sanitize the $_POST value for the setting.

During a save request prior to save, post_value() provides the new value while value() does not.

return: mixed The default value on failure, otherwise the sanitized and validated value.
since: 3.4.0
param: mixed $default A default value which is used as a fallback. Default is null.

sanitize( $value )   X-Ref
Sanitize an input.

return: string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid.
since: 3.4.0
param: string|array $value    The value to sanitize.

validate( $value )   X-Ref
Validates an input.

return: true|WP_Error True if the input was validated, otherwise WP_Error.
since: 4.6.0
param: mixed $value Value to validate.

get_root_value( $default = null )   X-Ref
Get the root value for a setting, especially for multidimensional ones.

return: mixed
since: 4.4.0
param: mixed $default Value to return if root does not exist.

set_root_value( $value )   X-Ref
Set the root value for a setting, especially for multidimensional ones.

return: bool Whether the multidimensional root was updated successfully.
since: 4.4.0
param: mixed $value Value to set as root of multidimensional setting.

update( $value )   X-Ref
Save the value of the setting, using the related API.

return: bool The result of saving the value.
since: 3.4.0
param: mixed $value The value to update.

_update_theme_mod()   X-Ref
Deprecated method.

since: 3.4.0

_update_option()   X-Ref
Deprecated method.

since: 3.4.0

value()   X-Ref
Fetch the value of the setting.

return: mixed The value.
since: 3.4.0

js_value()   X-Ref
Sanitize the setting's value for use in JavaScript.

return: mixed The requested escaped value.
since: 3.4.0

json()   X-Ref
Retrieves the data to export to the client via JSON.

return: array Array of parameters passed to JavaScript.
since: 4.6.0

check_capabilities()   X-Ref
Validate user capabilities whether the theme supports the setting.

return: bool False if theme doesn't support the setting or user can't change setting, otherwise true.
since: 3.4.0

multidimensional( &$root, $keys, $create = false )   X-Ref
Multidimensional helper function.

return: array|void Keys are 'root', 'node', and 'key'.
since: 3.4.0
param: $root
param: $keys
param: bool $create Default is false.

multidimensional_replace( $root, $keys, $value )   X-Ref
Will attempt to replace a specific value in a multidimensional array.

return: mixed
since: 3.4.0
param: $root
param: $keys
param: mixed $value The value to update.

multidimensional_get( $root, $keys, $default = null )   X-Ref
Will attempt to fetch a specific value from a multidimensional array.

return: mixed The requested value or the default value.
since: 3.4.0
param: $root
param: $keys
param: mixed $default A default value which is used as a fallback. Default is null.

multidimensional_isset( $root, $keys )   X-Ref
Will attempt to check if a specific value in a multidimensional array is set.

return: bool True if value is set, false if not.
since: 3.4.0
param: $root
param: $keys



Generated: Fri Aug 23 01:00:03 2019 Cross-referenced by PHPXref 0.7.1