allowed = apply_filters( 'epsilon_upsell_control_display', true ); parent::__construct( $manager, $id, $args ); $manager->register_control_type( 'Epsilon_Control_Upsell' ); } /** * */ public function json() { $json = parent::json(); /** * Provide a fallback for the label */ $json['label'] = ! empty( $this->label ) ? $this->label : __( 'See what\'s in the PRO version', 'epsilon-framework' ); /** * Buttons */ $json['button_text'] = $this->button_text; $json['button_url'] = $this->button_url; $json['second_button_text'] = $this->second_button_text; $json['second_button_url'] = $this->second_button_url; /** * Misc */ $json['separator'] = $this->separator; $json['allowed'] = $this->allowed; $arr = array(); $i = 0; foreach ( $this->options as $option ) { $arr[ $i ]['option'] = $option; $i ++; } $i = 0; foreach ( $this->requirements as $help ) { $arr[ $i ]['help'] = $help; $i ++; } $json['options'] = $arr; $json['id'] = $this->id; $json['link'] = $this->get_link(); $json['value'] = $this->value(); return $json; } /** * */ public function content_template() { //@formatter:off ?> <# if ( data.allowed ) { #>
{{{ data.label }}}
<# if ( data.options ) { #> <# } #>
<# if ( data.button_text && data.button_url ) { #> {{ data.button_text }} <# } #> <# if ( data.separator ) { #> {{ data.separator }} <# } #> <# if ( data.second_button_text && data.second_button_url ) { #> {{data.second_button_text }} <# } #>
<# } #>