PHP Класс Carbon_Fields\Widget\Widget

Наследование: extends WP_Widget, implements Carbon_Fields\Datastore\Datastore_Interface
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$registered_widget_ids

Защищенные свойства (Protected)

Свойство Тип Описание
$complex_field_names
$custom_fields
$form_options
$print_wrappers
$store_data

Открытые методы

Метод Описание
add_fields ( array $fields ) Append array of fields to the current fields set. All items of the array must be instances of Field and their names should be unique for all Carbon containers.
delete ( Field $field ) Delete the field value(s) from the database.
delete_values ( mixed $field ) Delete complex field value(s) from the database.
form ( array $instance ) Outputs the settings update form.
front_end ( array $args, array $instance ) The actual content of the widget.
load ( Field $field ) Load the field value(s) from the database.
load_values ( mixed $field ) Load complex field value(s) from the database.
save ( Field $field ) Save the field value(s) into the database.
setup ( string $title, string $description, array $fields, string $classname = '' ) Create the widget.
unwrap_complex_field_values ( $instance, $complex_field_names ) Expand complex fields from raw data.
update ( array $new_instance, array $old_instance ) : array Updates a particular instance of a widget.
verify_unique_field_name ( string $name ) Verify widget field names are unique.
verify_unique_widget_id ( string $id ) Verify widget IDs are unique.
widget ( array $args, array $instance ) Echoes the widget content.

Описание методов

add_fields() публичный метод

Append array of fields to the current fields set. All items of the array must be instances of Field and their names should be unique for all Carbon containers.
public add_fields ( array $fields )
$fields array

delete() публичный метод

Delete the field value(s) from the database.
public delete ( Field $field )
$field Carbon_Fields\Field\Field The field to delete.

delete_values() публичный метод

Delete complex field value(s) from the database.
public delete_values ( mixed $field )
$field mixed The field to delete values for.

form() публичный метод

Outputs the settings update form.
public form ( array $instance )
$instance array Current settings.

front_end() публичный метод

Generally should be overriden by the specific widget classes.
public front_end ( array $args, array $instance )
$args array Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
$instance array The settings for the particular instance of the widget.

load() публичный метод

Load the field value(s) from the database.
public load ( Field $field )
$field Carbon_Fields\Field\Field The field to retrieve value for.

load_values() публичный метод

Load complex field value(s) from the database.
public load_values ( mixed $field )
$field mixed The field to load values for.

save() публичный метод

Save the field value(s) into the database.
public save ( Field $field )
$field Carbon_Fields\Field\Field The field to save.

setup() публичный метод

A wrapper around the default WP widget constructor.
public setup ( string $title, string $description, array $fields, string $classname = '' )
$title string Widget name
$description string Widget description
$fields array Array of fields
$classname string String of CSS classes

unwrap_complex_field_values() публичный статический метод

Expand complex fields from raw data.
public static unwrap_complex_field_values ( $instance, $complex_field_names )

update() публичный метод

Updates a particular instance of a widget.
public update ( array $new_instance, array $old_instance ) : array
$new_instance array New settings for this instance as input by the user via WP_Widget::form().
$old_instance array Old settings for this instance.
Результат array Settings to save or bool false to cancel saving.

verify_unique_field_name() публичный метод

Verify widget field names are unique.
public verify_unique_field_name ( string $name )
$name string Field name

verify_unique_widget_id() публичный метод

Verify widget IDs are unique.
public verify_unique_widget_id ( string $id )
$id string Widget ID

widget() публичный метод

Sub-classes can over-ride this method to generate their widget code but it is best to override front_end().
public widget ( array $args, array $instance )
$args array Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
$instance array The settings for the particular instance of the widget.

Описание свойств

$complex_field_names защищенное свойство

protected $complex_field_names

$custom_fields защищенное свойство

protected $custom_fields

$form_options защищенное свойство

protected $form_options

$print_wrappers защищенное свойство

protected $print_wrappers

$registered_widget_ids публичное статическое свойство

public static $registered_widget_ids

$store_data защищенное свойство

protected $store_data