[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

WordPress Customize Setting classes

File Size: 983 lines (30 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 5 files
 wp-includes/customize/class-wp-customize-background-image-setting.php
 wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
 wp-includes/customize/class-wp-customize-nav-menu-setting.php
 wp-includes/customize/class-wp-customize-filter-setting.php
 wp-includes/customize/class-wp-customize-header-image-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 Customizer bootstrap instance.
param: string               $id      A specific ID of the setting.
param: array                $args    {

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

since: 4.4.0
return: array {

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.

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

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.

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

_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.

since: 3.4.0
return: mixed New or old value.
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.

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

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

since: 3.4.0
return: void|false Void on success, false if cap check fails

post_value( $default_value = 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.

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

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

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

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

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

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

since: 4.4.0
return: mixed
param: mixed $default_value 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.

since: 4.4.0
return: bool Whether the multidimensional root was updated successfully.
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.

since: 3.4.0
return: bool The result of saving the value.
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.

since: 3.4.0
return: mixed The value.

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

since: 3.4.0
return: mixed The requested escaped value.

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

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

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

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

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

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

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

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

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

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

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

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



Generated: Fri Mar 29 01:00:02 2024 Cross-referenced by PHPXref 0.7.1