[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Customize API: WP_Customize_Partial class

File Size: 329 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Customize_Partial:: (6 methods):
  __construct()
  id_data()
  render()
  render_callback()
  json()
  check_capabilities()


Class: WP_Customize_Partial  - X-Ref

Core Customizer class for implementing selective refresh partials.

Representation of a rendered region in the previewed page that gets
selectively refreshed when an associated setting is changed.
This class is analogous of WP_Customize_Control.

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

Supplied `$args` override class property defaults.

If `$args['settings']` is not defined, use the $id as the setting ID.

param: WP_Customize_Selective_Refresh $component Customize Partial Refresh plugin instance.
param: string                         $id        Control ID.
param: array                          $args {
since: 4.5.0

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

return: array {
since: 4.5.0

render( $container_context = array()   X-Ref
Renders the template partial involving the associated settings.

param: array $container_context Optional. Array of context data associated with the target container (placement).
return: string|array|false The rendered partial as a string, raw data array (for client-side JS template),
since: 4.5.0

render_callback( WP_Customize_Partial $partial, $context = array()   X-Ref
Default callback used when invoking WP_Customize_Control::render().

Note that this method may echo the partial *or* return the partial as
a string or array, but not both. Output buffering is performed when this
is called. Subclasses can override this with their specific logic, or they
may provide an 'render_callback' argument to the constructor.

This method may return an HTML string for straight DOM injection, or it
may return an array for supporting Partial JS subclasses to render by
applying to client-side templating.

param: WP_Customize_Partial $partial Partial.
param: array                $context Context.
return: string|array|false
since: 4.5.0

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

return: array Array of parameters passed to the JavaScript.
since: 4.5.0

check_capabilities()   X-Ref
Checks if the user can refresh this partial.

Returns false if the user cannot manipulate one of the associated settings,
or if one of the associated settings does not exist.

return: bool False if user can't edit one of the related settings,
since: 4.5.0



Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1