PluginProbe ʕ •ᴥ•ʔ
Products Compare for WooCommerce / 3.6.2.6
Products Compare for WooCommerce v3.6.2.6
3.6.2.8 3.6.2.7 trunk 1.0.1 1.0.10 1.0.10.1 1.0.11 1.0.11.1 1.0.12 1.0.13 1.0.13.1 1.0.2 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 3.5 3.5.0.1 3.5.0.2 3.5.1 3.5.1.1 3.5.1.2 3.5.1.3 3.5.1.4 3.5.1.5 3.5.1.6 3.5.1.7 3.5.2 3.5.2.1 3.5.2.2 3.5.2.3 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.7.1 3.5.7.2 3.5.7.3 3.5.7.4 3.5.7.5 3.5.7.6 3.5.7.7 3.5.7.8 3.5.7.9 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.2.1 3.6.2.2 3.6.2.3 3.6.2.4 3.6.2.5 3.6.2.6
products-compare-for-woocommerce / berocket / includes / widget.php
products-compare-for-woocommerce / berocket / includes Last commit date
admin 2 months ago custom_post 2 months ago admin_notices.php 2 months ago conditions.php 2 months ago custom_post.php 2 months ago error_notices.php 2 months ago functions.php 2 months ago ico.png 2 months ago information_notices.php 2 months ago libraries.php 2 months ago plugin-variation.php 2 months ago settings_fields.php 2 months ago updater.php 2 months ago widget.php 2 months ago
widget.php
59 lines
1 <?php
2 /**
3 * Widget
4 */
5
6 if ( ! class_exists( 'BeRocket_Widget' ) ) {
7
8 class BeRocket_Widget extends WP_Widget {
9 public static $defaults = array(
10 'title' => '',
11 );
12
13 public function __construct( $name, $normal_name, $description = '' ) {
14 parent::__construct( "berocket_" . $name . "_widget", $normal_name,
15 array( "description" => $description )
16 );
17 }
18
19 /**
20 * WordPress widget
21 */
22 public function widget( $args, $instance ) {
23 $instance = wp_parse_args( (array) $instance, self::$defaults );
24 $options = $args['plugin_class']::get_option();
25
26 set_query_var( 'title', apply_filters( 'ce_widget_title', $instance[ 'title' ] ) );
27 set_query_var( 'args', $args );
28
29 echo $args[ 'before_widget' ];
30 $args['plugin_class']::br_get_template_part( apply_filters( 'berocket_widget_template', 'widget', $args['plugin_class']::info ) );
31 echo $args[ 'after_widget' ];
32 }
33
34 /**
35 * Update widget settings
36 */
37 public function update( $new_instance, $old_instance ) {
38 $instance = $old_instance;
39 $instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
40
41 return $instance;
42 }
43
44 /**
45 * Widget settings form
46 */
47 public function form( $instance ) {
48 $instance = wp_parse_args( (array) $instance, self::$defaults );
49 $title = strip_tags( $instance[ 'title' ] );
50 ?>
51 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input
52 class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
53 name="<?php echo $this->get_field_name( 'title' ); ?>" type="text"
54 value="<?php echo esc_attr( $title ); ?>"/></p>
55 <?php
56 }
57 }
58 }
59