WP_Widget_SLPExp
extends WP_Widget
in package
Class WP_Widget_SLP
Extend the WP Widget Class with some common SLP methods.
To Use:
- configure_widget_properties() in your extended class
- configure_widget_settings() in your extended class
- create a class.
.ui.php file with the user interface render_widget($args,$instance) method.
Tags
Table of Contents
Properties
- $addon : mixed
- $control_options : mixed
- $settings : mixed
- $slplus : mixed
- $description_admin : mixed
- $slug : mixed
- $title_admin : mixed
- $title_ui : mixed
- $ui : mixed
- $ui_class_name : mixed
Methods
- __construct() : mixed
- Creates a widget and registers it with WordPress.
- create_string_docs_link() : string
- Create a hypertext link to the widget pack support docs.
- create_string_widget_checkbox() : string
- Generates an HTML string for a checkbox widget with a label.
- create_string_widget_input() : string
- Creates an HTML string for a text input widget.
- create_ui_object() : mixed
- Create and attach the UI object for this widget
- form() : mixed
- Render the admin interface widget form.
- update() : array<string|int, mixed>
- Sanitize widget form values as they are saved.
- widget() : mixed
- Front-end display of widget.
- configure_widget_properties() : mixed
- Set the properties for this widget. Things like the admin box title, description, etc.
- configure_widget_settings() : mixed
- Set the settings for this widget. The stuff the user fills out in the admin forms.
- set_global_settings() : mixed
- Set default global properties for the widget.
- set_property_values() : mixed
- Set the instance properties based on settings and default values.
Properties
$addon
public
mixed
$addon
$control_options
public
mixed
$control_options
= array()
$settings
public
mixed
$settings
= array()
$slplus
public
mixed
$slplus
$description_admin
protected
mixed
$description_admin
$slug
protected
mixed
$slug
$title_admin
protected
mixed
$title_admin
$title_ui
protected
mixed
$title_ui
$ui
protected
mixed
$ui
$ui_class_name
protected
mixed
$ui_class_name
= ''
Methods
__construct()
Creates a widget and registers it with WordPress.
public
__construct() : mixed
create_string_docs_link()
Create a hypertext link to the widget pack support docs.
public
create_string_docs_link() : string
Return values
stringcreate_string_widget_checkbox()
Generates an HTML string for a checkbox widget with a label.
public
create_string_widget_checkbox(string $field_slug, string $label, bool $value) : string
Parameters
- $field_slug : string
-
The slug identifier for the field.
- $label : string
-
The text label associated with the checkbox.
- $value : bool
-
The current value of the checkbox, where true indicates checked.
Return values
string —The generated HTML for the checkbox widget with its label.
create_string_widget_input()
Creates an HTML string for a text input widget.
public
create_string_widget_input(string $field_slug, string $label, string $value) : string
Parameters
- $field_slug : string
-
The unique identifier for the input field.
- $label : string
-
The label text for the input field.
- $value : string
-
The value to populate the input field with.
Return values
string —The HTML string for the text input widget.
create_ui_object()
Create and attach the UI object for this widget
public
create_ui_object([string $slug = null ]) : mixed
Parameters
- $slug : string = null
form()
Render the admin interface widget form.
public
form(array<string|int, mixed> $instance) : mixed
Parameters
- $instance : array<string|int, mixed>
update()
Sanitize widget form values as they are saved.
public
update(array<string|int, mixed> $new_instance, array<string|int, mixed> $old_instance) : array<string|int, mixed>
Parameters
- $new_instance : array<string|int, mixed>
-
Values just sent to be saved.
- $old_instance : array<string|int, mixed>
-
Previously saved values from database.
Tags
Return values
array<string|int, mixed> —Updated safe values to be saved.
widget()
Front-end display of widget.
public
widget(array<string|int, mixed> $args, array<string|int, mixed> $instance) : mixed
Parameters
- $args : array<string|int, mixed>
-
Widget arguments.
- $instance : array<string|int, mixed>
-
Saved values from database.
Tags
configure_widget_properties()
Set the properties for this widget. Things like the admin box title, description, etc.
protected
configure_widget_properties() : mixed
OVERRIDE in extension.
configure_widget_settings()
Set the settings for this widget. The stuff the user fills out in the admin forms.
protected
configure_widget_settings() : mixed
OVERRIDE in extension.
set_global_settings()
Set default global properties for the widget.
private
set_global_settings() : mixed
set_property_values()
Set the instance properties based on settings and default values.
private
set_property_values(mixed &$instance) : mixed
Parameters
- $instance : mixed