'type',
'operator' => 'in',
'value' => [ static::get_field_type() ],
];
}
/**
* Get field ID.
*
* Retrieve the field type.
*
* @return string Field ID.
*
* @since 1.5.0
* @access public
*/
public function get_id() {
return $this->field['_id'];
}
/**
* Get input type of the field.
*
* The type that appears inside \ tag.
* By default it equals the name of field type, except in select, acceptance etc. which should be overridden.
*
* @return string Field type.
*
* @since 1.5.0
* @access public
*/
public function get_input_type() {
return $this->field['type'];
}
/**
* Get the real name of field type.
*
* @return string Field type.
*
* @since 1.5.0
* @access public
* @static
* @abstract
*/
abstract public static function get_field_type();
/**
* Get field class.
*
* @return string Field class.
*
* @since 1.5.0
* @access public
*/
public function get_class() {
return 'sellkit-field';
}
/**
* Retrieve the list of script dependencies the element requires.
*
* @return array Element scripts dependencies.
*
* @since 1.5.0
* @access public
*/
public function get_script_depends() {
return $this->depended_scripts;
}
/**
* Registers all the scripts defined as element dependencies and enqueues
* them. Use `get_script_depends()` method to add custom script dependencies.
*
* @since 1.5.0
* @access public
* @final
*/
final public function enqueue_scripts() {
foreach ( $this->get_script_depends() as $script ) {
wp_enqueue_script( $script );
}
}
/**
* Retrieve the list of style dependencies the element requires.
*
* @return array Element styles dependencies.
*
* @since 1.5.0
* @access public
*/
public function get_style_depends() {
return $this->depended_styles;
}
/**
* Registers all the styles defined as element dependencies and enqueues
* them. Use `get_style_depends()` method to add custom style dependencies.
*
* @since 1.5.0
* @access public
* @final
*/
final public function enqueue_styles() {
foreach ( $this->get_style_depends() as $style ) {
wp_enqueue_style( $style );
}
}
/**
* Render field label and content.
*
* @param object $widget Widget instance.
* @param array $field Field.
*
* @since 1.5.0
* @access public
*/
public function render( $widget, $field ) {
$this->widget = $widget;
$this->field = $field;
$this->add_field_render_attribute();
$this->add_field_group_render_attribute();
?>