choices = ( isset( $args['choices'] ) ) ? $args['choices'] : array();
parent::__construct( $manager, $id, $args );
}
/**
* Pass data to the JS via JSON.
*
* @since 1.0.0
*/
public function to_json() {
parent::to_json();
$this->json['value'] = $this->value();
$this->json['link'] = $this->get_link();
$this->json['id'] = $this->id;
$this->json['choices'] = wp_parse_args(
$this->choices, array(
'min' => '0',
'max' => '100',
'step' => '1',
)
);
}
/**
* Render content.
*
* @since 1.0.0
*/
public function render_content() {}
/**
* Content template.
*
* @since 1.0.0
*/
public function content_template() {
?>
<# if ( data.label ) { #>
{{ data.label }}
<# } #>
<# if ( data.description ) { #>
{{{ data.description }}}
<# } #>
{{ data.value }}