Completed
Push — master ( 1e5114...325fc8 )
by Brandon
02:50
created
modules/nar/widgets/class-nar-widgets.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6
-if ( ! class_exists( 'NarWidgets' ) ) {
6
+if ( ! class_exists('NarWidgets')) {
7 7
 
8 8
 	/**
9 9
 	 * NarWidgets class.
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 		 * @param string $iframe_id (default: '')
28 28
 		 * @return void
29 29
 		 */
30
-		public function nar_iframe_id( $iframe_id = '' ) {
30
+		public function nar_iframe_id($iframe_id = '') {
31 31
 
32
-			if ( '' !== $iframe_id  ) {
33
-				return sanitize_html_class( $iframe_id ) . '-iframe';
32
+			if ('' !== $iframe_id) {
33
+				return sanitize_html_class($iframe_id) . '-iframe';
34 34
 			}
35 35
 
36 36
 		}
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 		 * @param string $widget_name (default: '')
43 43
 		 * @return void
44 44
 		 */
45
-		public function nar_iframe_class( $widget_name = '' ) {
45
+		public function nar_iframe_class($widget_name = '') {
46 46
 
47
-			if ( '' !== $widget_name ) {
48
-				return 'nar nar-iframe nar-' . sanitize_html_class( $widget_name ) . '-iframe';
47
+			if ('' !== $widget_name) {
48
+				return 'nar nar-iframe nar-' . sanitize_html_class($widget_name) . '-iframe';
49 49
 			} else {
50 50
 				return 'nar nar-iframe';
51 51
 			}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		 */
61 61
 		public function get_mvp_program_widget() {
62 62
 
63
-			echo '<iframe frameborder="0" id="'. nar_iframe_id() .'" class="'. $this->zillow_iframe_class( 'mvp-program' ) .'" title="'. __('NAR MVP Program.', 're-pro') .'" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300"  height="250"></iframe>';
63
+			echo '<iframe frameborder="0" id="' . nar_iframe_id() . '" class="' . $this->zillow_iframe_class('mvp-program') . '" title="' . __('NAR MVP Program.', 're-pro') . '" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300"  height="250"></iframe>';
64 64
 		}
65 65
 
66 66
 		/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 			// wp_enqueue_script( 'nar-message', 'http://www.realtor.org/sites/all/themes/rotheme/js/narmessage.js', 'jquery', null, true);
75 75
 
76
-			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'home-ownership-matters' ) .'"  title="'. __('NAR Home Hownership Matters.', 're-pro') .'"  src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>';
76
+			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('home-ownership-matters') . '"  title="' . __('NAR Home Hownership Matters.', 're-pro') . '"  src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>';
77 77
 		}
78 78
 
79 79
 		/**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		 * @return void
84 84
 		 */
85 85
 		public function get_code_of_ethics_widget() {
86
-			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'code-of-ethics' ) .'" title="'. __('NAR Code of Ethics.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>';
86
+			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('code-of-ethics') . '" title="' . __('NAR Code of Ethics.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>';
87 87
 		}
88 88
 
89 89
 		/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		 * @return void
94 94
 		 */
95 95
 		public function get_nar_conf_expo_widget() {
96
-			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'conference-expo' ) .'" title="'. __('NAR Conferences and Expos.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>';
96
+			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('conference-expo') . '" title="' . __('NAR Conferences and Expos.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>';
97 97
 		}
98 98
 
99 99
 	}
Please login to merge, or discard this patch.
modules/modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Google maps.
4
-require_once( 'google-maps/gmaps.php' );
4
+require_once('google-maps/gmaps.php');
5 5
 
6 6
 // Equal Housing.
7
-require_once( 'equal-housing/equal-housing.php' );
7
+require_once('equal-housing/equal-housing.php');
8 8
 
9 9
 // Zillow.
10
-require_once( 'zillow/zillow.php' );
10
+require_once('zillow/zillow.php');
11 11
 
12
-require_once( 'trulia/trulia.php' );
12
+require_once('trulia/trulia.php');
13 13
 
14
-require_once( 'inman/inman.php' );
14
+require_once('inman/inman.php');
15 15
 
16
-require_once( 'homes-com/homes-com.php' );
16
+require_once('homes-com/homes-com.php');
17 17
 
18 18
 
19
-require_once( 'streetadvisor/streetadvisor.php' );
19
+require_once('streetadvisor/streetadvisor.php');
20 20
 
21
-require_once( 'greatschools/greatschools.php' );
21
+require_once('greatschools/greatschools.php');
Please login to merge, or discard this patch.
modules/zillow/zillow-helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 
7 7
 /**
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 function get_zillow_mandatory_disclaimer() {
15 15
 	echo '<p class="zillow-disclaimer">';
16
-	echo '<span>' . __( '© Zillow, Inc., 2006-', 're-pro') . date("Y") .'. Use is subject to <a href="https://www.zillow.com/corp/Terms.htm" title="'. __( 'Terms of Use', 're-pro') .'" target="_blank" rel="nofollow">'. __( 'Terms of Use', 're-pro') .'</a>.</span><br />
17
-<span><a href="https://www.zillow.com/wikipages/What-is-a-Zestimate/" title="'. __( 'What\'s a Zestimate?', 're-pro') .'" target="_blank" rel="nofollow">'. __( 'What\'s a Zestimate?', 're-pro') .'</a></span>';
16
+	echo '<span>' . __('© Zillow, Inc., 2006-', 're-pro') . date("Y") . '. Use is subject to <a href="https://www.zillow.com/corp/Terms.htm" title="' . __('Terms of Use', 're-pro') . '" target="_blank" rel="nofollow">' . __('Terms of Use', 're-pro') . '</a>.</span><br />
17
+<span><a href="https://www.zillow.com/wikipages/What-is-a-Zestimate/" title="'. __('What\'s a Zestimate?', 're-pro') . '" target="_blank" rel="nofollow">' . __('What\'s a Zestimate?', 're-pro') . '</a></span>';
18 18
 	echo '</p>';
19 19
 }
Please login to merge, or discard this patch.
modules/zillow/widgets/class-mortgage-calc-widget.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Mortgage Calculator Widget (https://www.zillow.com/webtools/widgets/MortgageCalculatorWidget.htm)
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 		parent::__construct(
28 28
 			'zillow_mortgage_calc_widget',
29
-			__( 'Zillow Mortgage Calculator', 're-pro' ),
29
+			__('Zillow Mortgage Calculator', 're-pro'),
30 30
 			array(
31
-				'description' => __( 'Display Mortgage Calculator from Zillow.', 're-pro' ),
31
+				'description' => __('Display Mortgage Calculator from Zillow.', 're-pro'),
32 32
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-mortgage-calculator',
33 33
 				'customize_selective_refresh' => true,
34 34
 			)
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 	 * @param mixed $instance Instance.
44 44
 	 * @return void
45 45
 	 */
46
-	public function widget( $args, $instance ) {
46
+	public function widget($args, $instance) {
47 47
 
48
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
49
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
50
-		$orientation = ! empty( $instance['orientation'] ) ? $instance['orientation'] : '';
48
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
49
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
50
+		$orientation = ! empty($instance['orientation']) ? $instance['orientation'] : '';
51 51
 
52
-		if ( 'verticalWidget' === $orientation ) {
52
+		if ('verticalWidget' === $orientation) {
53 53
 			$height = '470';
54 54
 			$width = '200';
55 55
 		} else {
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 
60 60
 		echo $args['before_widget'];
61 61
 
62
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
62
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
63 63
 
64 64
 		$zillow_widgets = new ZillowWidgets();
65 65
 
66
-		return $zillow_widgets->get_mortgage_calc_widget( $iframe_id, $orientation );
66
+		return $zillow_widgets->get_mortgage_calc_widget($iframe_id, $orientation);
67 67
 
68 68
 
69 69
 		echo $args['after_widget'];
@@ -76,30 +76,30 @@  discard block
 block discarded – undo
76 76
 	 * @param mixed $instance Instance.
77 77
 	 * @return void
78 78
 	 */
79
-	public function form( $instance ) {
79
+	public function form($instance) {
80 80
 
81 81
 		// Set default values.
82
-		$instance = wp_parse_args( (array) $instance, array(
82
+		$instance = wp_parse_args((array) $instance, array(
83 83
 			'title' => '',
84 84
 			'orientation' => 'verticalWidget',
85 85
 		));
86 86
 
87 87
 		// Retrieve an existing value from the database.
88
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
89
-		$orientation = ! empty( $instance['orientation'] ) ? $instance['orientation'] : '';
88
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
89
+		$orientation = ! empty($instance['orientation']) ? $instance['orientation'] : '';
90 90
 
91 91
 		// Title.
92 92
 		echo '<p>';
93
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
94
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
93
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
94
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
95 95
 		echo '</p>';
96 96
 
97 97
 		// Orientation.
98 98
 		echo '<p>';
99
-		echo '	<label for="' . $this->get_field_id( 'orientation' ) . '" class="title-label">' . __( 'Orientation:', 're-pro' ) . '</label>';
100
-		echo '<select id="' . $this->get_field_id( 'orientation' ) . '" name="' . $this->get_field_name( 'orientation' ) . '" class="widefat">';
101
-	    echo '<option value="verticalWidget"'. selected( $orientation, 'verticalWidget' ) .'>'. __( 'Vertical', 're-pro' ) .'</option>';
102
-	    echo '<option value="horizontalWidget"'. selected( $orientation, 'horizontalWidget' ) .'>'. __( 'Horizontal', 're-pro' ) .'</option>';
99
+		echo '	<label for="' . $this->get_field_id('orientation') . '" class="title-label">' . __('Orientation:', 're-pro') . '</label>';
100
+		echo '<select id="' . $this->get_field_id('orientation') . '" name="' . $this->get_field_name('orientation') . '" class="widefat">';
101
+	    echo '<option value="verticalWidget"' . selected($orientation, 'verticalWidget') . '>' . __('Vertical', 're-pro') . '</option>';
102
+	    echo '<option value="horizontalWidget"' . selected($orientation, 'horizontalWidget') . '>' . __('Horizontal', 're-pro') . '</option>';
103 103
 		echo '</select>';
104 104
 		echo '</p>';
105 105
 
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
 	 * @param mixed $old_instance Old Instance.
114 114
 	 * @return $instance
115 115
 	 */
116
-	public function update( $new_instance, $old_instance ) {
116
+	public function update($new_instance, $old_instance) {
117 117
 
118 118
 		$instance = $old_instance;
119 119
 
120
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
121
-		$instance['orientation'] = ! empty( $new_instance['orientation'] ) ? strip_tags( $new_instance['orientation'] ) : '';
120
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
121
+		$instance['orientation'] = ! empty($new_instance['orientation']) ? strip_tags($new_instance['orientation']) : '';
122 122
 
123 123
 		return $instance;
124 124
 	}
Please login to merge, or discard this patch.
modules/zillow/widgets/class-affordability-calc-widget.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Affordability Calculator Widget (https://www.zillow.com/webtools/widgets/AffordabilityCalculatorWidget.htm)
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 		parent::__construct(
29 29
 			'zillow_affordability_calc_widget',
30
-			__( 'Zillow Affordability Calculator', 're-pro' ),
30
+			__('Zillow Affordability Calculator', 're-pro'),
31 31
 			array(
32
-				'description' => __( 'Display an Affordability Calculator from Zillow.', 're-pro' ),
32
+				'description' => __('Display an Affordability Calculator from Zillow.', 're-pro'),
33 33
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-affordability-calculator',
34 34
 				'customize_selective_refresh' => true,
35 35
 			)
@@ -44,18 +44,18 @@  discard block
 block discarded – undo
44 44
 	 * @param mixed $instance Instance.
45 45
 	 * @return void
46 46
 	 */
47
-	public function widget( $args, $instance ) {
47
+	public function widget($args, $instance) {
48 48
 
49
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
50
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
49
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
50
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
51 51
 
52 52
 		echo $args['before_widget'];
53 53
 
54
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
54
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
55 55
 
56 56
 		$zillow_widgets = new ZillowWidgets();
57 57
 
58
-		return $zillow_widgets->get_affordability_calc_widget( $iframe_id );
58
+		return $zillow_widgets->get_affordability_calc_widget($iframe_id);
59 59
 
60 60
 
61 61
 		echo $args['after_widget'];
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 	 * @param mixed $instance Instance.
69 69
 	 * @return void
70 70
 	 */
71
-	public function form( $instance ) {
71
+	public function form($instance) {
72 72
 
73 73
 		// Set default values.
74
-		$instance = wp_parse_args( (array) $instance, array(
74
+		$instance = wp_parse_args((array) $instance, array(
75 75
 			'title' => '',
76 76
 			'screenname' => '',
77 77
 			'region' => '',
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 		));
81 81
 
82 82
 		// Retrieve an existing value from the database.
83
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
83
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
84 84
 
85 85
 		// Title.
86 86
 		echo '<p>';
87
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
88
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
87
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
88
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
89 89
 		echo '</p>';
90 90
 
91 91
 	}
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	 * @param mixed $old_instance Old Instance.
99 99
 	 * @return $instance
100 100
 	 */
101
-	public function update( $new_instance, $old_instance ) {
101
+	public function update($new_instance, $old_instance) {
102 102
 
103 103
 		$instance = $old_instance;
104 104
 
105
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
105
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
106 106
 
107 107
 		return $instance;
108 108
 	}
Please login to merge, or discard this patch.
modules/zillow/widgets/class-large-search-box.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Large Search Box Widget (http://www.zillow.com/webtools/widgets/ZillowLargeSearchBox.htm)
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 		parent::__construct(
29 29
 			'zillow_large_search_box',
30
-			__( 'Zillow Large Search Box', 're-pro' ),
30
+			__('Zillow Large Search Box', 're-pro'),
31 31
 			array(
32
-				'description' => __( 'Display a Large Search Box from Zillow.', 're-pro' ),
32
+				'description' => __('Display a Large Search Box from Zillow.', 're-pro'),
33 33
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-search-box',
34 34
 				'customize_selective_refresh' => true,
35 35
 			)
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 	 * @param mixed $instance Instance.
45 45
 	 * @return void
46 46
 	 */
47
-	public function widget( $args, $instance ) {
47
+	public function widget($args, $instance) {
48 48
 
49
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
50
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
51
-		$type = ! empty( $instance['type'] ) ? $instance['type'] : '';
52
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
53
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
54
-		$home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : '';
55
-		$home_val_info = ( $home_val_info ) ? 'no' : 'yes';
49
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
50
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
51
+		$type = ! empty($instance['type']) ? $instance['type'] : '';
52
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
53
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
54
+		$home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : '';
55
+		$home_val_info = ($home_val_info) ? 'no' : 'yes';
56 56
 
57 57
 
58 58
 		echo $args['before_widget'];
59 59
 
60
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
60
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
61 61
 
62 62
 		$zillow_widgets = new ZillowWidgets();
63 63
 
64
- 		$zillow_widgets->get_lg_zillow_search_widget( $iframe_id, $screenname, 'iframe', $location, $home_val_info );
64
+ 		$zillow_widgets->get_lg_zillow_search_widget($iframe_id, $screenname, 'iframe', $location, $home_val_info);
65 65
 
66 66
 		echo $args['after_widget'];
67 67
 	}
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	 * @param mixed $instance Instance.
74 74
 	 * @return void
75 75
 	 */
76
-	public function form( $instance ) {
76
+	public function form($instance) {
77 77
 
78 78
 		// Set default values.
79
-		$instance = wp_parse_args( (array) $instance, array(
79
+		$instance = wp_parse_args((array) $instance, array(
80 80
 			'title' => '',
81 81
 			'type' => 'iframe',
82 82
 			'screenname' => '',
@@ -85,34 +85,34 @@  discard block
 block discarded – undo
85 85
 		));
86 86
 
87 87
 		// Retrieve an existing value from the database.
88
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
89
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
90
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
91
-		$home_val_info = ! empty( $instance['home_val_info'] ) ? $instance['home_val_info'] : 0;
88
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
89
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
90
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
91
+		$home_val_info = ! empty($instance['home_val_info']) ? $instance['home_val_info'] : 0;
92 92
 
93 93
 
94 94
 		// Title.
95 95
 		echo '<p>';
96
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
97
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
96
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
97
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
98 98
 		echo '</p>';
99 99
 
100 100
 		// Zillow Screenname.
101 101
 		echo '<p>';
102
-		echo '	<label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>';
103
-		echo '	<input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname  . '" class="widefat">';
102
+		echo '	<label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>';
103
+		echo '	<input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">';
104 104
 		echo '</p>';
105 105
 
106 106
 		// Location.
107 107
 		echo '<p>';
108
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
109
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location  . '" class="widefat">';
108
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
109
+		echo '	<input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
110 110
 		echo '</p>';
111 111
 
112 112
 		// Home Value Info
113 113
 		echo '<p>';
114
-		echo '<input value="1" type="checkbox"' . checked( esc_attr( $home_val_info ), 1, false ) . 'id="' . esc_attr( $this->get_field_id( 'home_val_info' ) ) . '" name="' . esc_attr( $this->get_field_name( 'home_val_info' ) ) . '" />';
115
-		echo '<label for="' . $this->get_field_id( 'home_val_info' ) . '">Hide home value information</label>';
114
+		echo '<input value="1" type="checkbox"' . checked(esc_attr($home_val_info), 1, false) . 'id="' . esc_attr($this->get_field_id('home_val_info')) . '" name="' . esc_attr($this->get_field_name('home_val_info')) . '" />';
115
+		echo '<label for="' . $this->get_field_id('home_val_info') . '">Hide home value information</label>';
116 116
 		echo '</p>';
117 117
 
118 118
 
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 	 * @param mixed $old_instance Old Instance.
127 127
 	 * @return $instance
128 128
 	 */
129
-	public function update( $new_instance, $old_instance ) {
129
+	public function update($new_instance, $old_instance) {
130 130
 
131 131
 		$instance = $old_instance;
132 132
 
133
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
134
-		$instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : '';
135
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
136
-		$instance['home_val_info'] = ! empty( $new_instance['home_val_info'] ) ? strip_tags( $new_instance['home_val_info'] ) : 0;
133
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
134
+		$instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : '';
135
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
136
+		$instance['home_val_info'] = ! empty($new_instance['home_val_info']) ? strip_tags($new_instance['home_val_info']) : 0;
137 137
 
138 138
 
139 139
 		return $instance;
@@ -148,6 +148,6 @@  discard block
 block discarded – undo
148 148
  */
149 149
 function repro_zillow_search_box_widget() {
150 150
 
151
-	register_widget( 'ZillowLargeSearchBox' );
151
+	register_widget('ZillowLargeSearchBox');
152 152
 }
153
-add_action( 'widgets_init', 'repro_zillow_search_box_widget' );
153
+add_action('widgets_init', 'repro_zillow_search_box_widget');
Please login to merge, or discard this patch.
modules/zillow/widgets/class-listings-widget.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Listings Widget (https://www.zillow.com/webtools/widgets/MyListingsWidget.htm)
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 		parent::__construct(
29 29
 			'zillow_listings_widget',
30
-			__( 'Zillow Listings', 're-pro' ),
30
+			__('Zillow Listings', 're-pro'),
31 31
 			array(
32
-				'description' => __( 'Display your active listings from Zillow.', 're-pro' ),
32
+				'description' => __('Display your active listings from Zillow.', 're-pro'),
33 33
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-my-listings',
34 34
 				'customize_selective_refresh' => true,
35 35
 			)
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 	 * @param mixed $instance Instance.
45 45
 	 * @return void
46 46
 	 */
47
-	public function widget( $args, $instance ) {
47
+	public function widget($args, $instance) {
48 48
 
49
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
50
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
51
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
52
-		$zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : '';
53
-		$format = ! empty( $instance['format'] ) ? $instance['format'] : '';
49
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
50
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
51
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
52
+		$zuid = ! empty($instance['zuid']) ? $instance['zuid'] : '';
53
+		$format = ! empty($instance['format']) ? $instance['format'] : '';
54 54
 
55 55
 		echo $args['before_widget'];
56 56
 
57
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
57
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
58 58
 
59 59
 		$zillow_widgets = new ZillowWidgets();
60 60
 
61
-		return $zillow_widgets->get_listings_widget( $iframe_id, $zuid );
61
+		return $zillow_widgets->get_listings_widget($iframe_id, $zuid);
62 62
 
63 63
 		echo $args['after_widget'];
64 64
 	}
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
 	 * @param mixed $instance Instance.
71 71
 	 * @return void
72 72
 	 */
73
-	public function form( $instance ) {
73
+	public function form($instance) {
74 74
 
75 75
 		// Set default values.
76
-		$instance = wp_parse_args( (array) $instance, array(
76
+		$instance = wp_parse_args((array) $instance, array(
77 77
 			'title' => '',
78 78
 			'screenname' => '',
79 79
 			'zuid' => '',
@@ -81,27 +81,27 @@  discard block
 block discarded – undo
81 81
 		));
82 82
 
83 83
 		// Retrieve an existing value from the database.
84
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
85
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
86
-		$zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : '';
87
-		$format = ! empty( $instance['format'] ) ? $instance['format'] : 'format';
84
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
85
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
86
+		$zuid = ! empty($instance['zuid']) ? $instance['zuid'] : '';
87
+		$format = ! empty($instance['format']) ? $instance['format'] : 'format';
88 88
 
89 89
 		// Title.
90 90
 		echo '<p>';
91
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
92
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
91
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
92
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
93 93
 		echo '</p>';
94 94
 
95 95
 		// Zillow Screenname.
96 96
 		echo '<p>';
97
-		echo '	<label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>';
98
-		echo '	<input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname  . '" class="widefat">';
97
+		echo '	<label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>';
98
+		echo '	<input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">';
99 99
 		echo '</p>';
100 100
 
101 101
 		// Zillow User ID.
102 102
 		echo '<p>';
103
-		echo '	<label for="' . $this->get_field_id( 'zuid' ) . '" class="title-label">' . __( 'Zillow User ID:', 're-pro' ) . '</label>';
104
-		echo '	<input id="' . $this->get_field_id( 'zuid' ) . '" name="' . $this->get_field_name( 'zuid' ) . '" value="' . $zuid  . '" class="widefat">';
103
+		echo '	<label for="' . $this->get_field_id('zuid') . '" class="title-label">' . __('Zillow User ID:', 're-pro') . '</label>';
104
+		echo '	<input id="' . $this->get_field_id('zuid') . '" name="' . $this->get_field_name('zuid') . '" value="' . $zuid . '" class="widefat">';
105 105
 		echo '</p>';
106 106
 
107 107
 	}
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 	 * @param mixed $old_instance Old Instance.
115 115
 	 * @return $instance
116 116
 	 */
117
-	public function update( $new_instance, $old_instance ) {
117
+	public function update($new_instance, $old_instance) {
118 118
 
119 119
 		$instance = $old_instance;
120 120
 
121
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
122
-		$instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : '';
123
-		$instance['zuid'] = ! empty( $new_instance['zuid'] ) ? strip_tags( $new_instance['zuid'] ) : '';
124
-		$instance['format'] = ! empty( $new_instance['format'] ) ? strip_tags( $new_instance['format'] ) : '';
125
-		$instance['zmod'] = ! empty( $new_instance['zmod'] ) ? strip_tags( $new_instance['zmod'] ) : '';
121
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
122
+		$instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : '';
123
+		$instance['zuid'] = ! empty($new_instance['zuid']) ? strip_tags($new_instance['zuid']) : '';
124
+		$instance['format'] = ! empty($new_instance['format']) ? strip_tags($new_instance['format']) : '';
125
+		$instance['zmod'] = ! empty($new_instance['zmod']) ? strip_tags($new_instance['zmod']) : '';
126 126
 
127 127
 		return $instance;
128 128
 	}
Please login to merge, or discard this patch.
modules/zillow/widgets/class-mortgage-rate-widget.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Mortgage Rate Widget (https://www.zillow.com/webtools/widgets/MortgageRateWidget.htm)
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 		parent::__construct(
29 29
 			'zillow_mortgage_rate_widget',
30
-			__( 'Zillow Mortgage Rate Table', 're-pro' ),
30
+			__('Zillow Mortgage Rate Table', 're-pro'),
31 31
 			array(
32
-				'description' => __( 'Display a Mortgage Rate Table from Zillow.', 're-pro' ),
32
+				'description' => __('Display a Mortgage Rate Table from Zillow.', 're-pro'),
33 33
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-mortgage-rate-table',
34 34
 				'customize_selective_refresh' => true,
35 35
 			)
@@ -44,23 +44,23 @@  discard block
 block discarded – undo
44 44
 	 * @param mixed $instance Instance.
45 45
 	 * @return void
46 46
 	 */
47
-	public function widget( $args, $instance ) {
47
+	public function widget($args, $instance) {
48 48
 
49
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
50
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
51
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
52
-		$region = ! empty( $instance['region'] ) ? $instance['region'] : '';
53
-		$textcolor = ! empty( $instance['textcolor'] ) ? $instance['textcolor'] : '';
49
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
50
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
51
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
52
+		$region = ! empty($instance['region']) ? $instance['region'] : '';
53
+		$textcolor = ! empty($instance['textcolor']) ? $instance['textcolor'] : '';
54 54
 
55 55
 		echo $args['before_widget'];
56 56
 
57
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
57
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
58 58
 
59 59
 
60 60
 
61 61
 		$zillow_widgets = new ZillowWidgets();
62 62
 
63
-		return $zillow_widgets->get_mortgage_rate_table_widget( $iframe_id, $textcolor, $screenname, $region );
63
+		return $zillow_widgets->get_mortgage_rate_table_widget($iframe_id, $textcolor, $screenname, $region);
64 64
 
65 65
 		echo $args['after_widget'];
66 66
 	}
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 	 * @param mixed $instance Instance.
73 73
 	 * @return void
74 74
 	 */
75
-	public function form( $instance ) {
75
+	public function form($instance) {
76 76
 
77 77
 		// Set default values.
78
-		$instance = wp_parse_args( (array) $instance, array(
78
+		$instance = wp_parse_args((array) $instance, array(
79 79
 			'title' => '',
80 80
 			'screenname' => '',
81 81
 			'region' => '',
@@ -84,89 +84,89 @@  discard block
 block discarded – undo
84 84
 		));
85 85
 
86 86
 		// Retrieve an existing value from the database.
87
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
88
-		$screenname = ! empty( $instance['screenname'] ) ? $instance['screenname'] : '';
89
-		$textcolor = ! empty( $instance['textcolor'] ) ? $instance['textcolor'] : '';
90
-		$region = ! empty( $instance['region'] ) ? $instance['region'] : '';
91
-		$zuid = ! empty( $instance['zuid'] ) ? $instance['zuid'] : '';
87
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
88
+		$screenname = ! empty($instance['screenname']) ? $instance['screenname'] : '';
89
+		$textcolor = ! empty($instance['textcolor']) ? $instance['textcolor'] : '';
90
+		$region = ! empty($instance['region']) ? $instance['region'] : '';
91
+		$zuid = ! empty($instance['zuid']) ? $instance['zuid'] : '';
92 92
 
93 93
 		// Title.
94 94
 		echo '<p>';
95
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
96
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
95
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
96
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
97 97
 		echo '</p>';
98 98
 
99 99
 		// Zillow Screenname.
100 100
 		echo '<p>';
101
-		echo '	<label for="' . $this->get_field_id( 'screenname' ) . '" class="title-label">' . __( 'Zillow Screenname:', 're-pro' ) . '</label>';
102
-		echo '	<input id="' . $this->get_field_id( 'screenname' ) . '" name="' . $this->get_field_name( 'screenname' ) . '" value="' . $screenname  . '" class="widefat">';
101
+		echo '	<label for="' . $this->get_field_id('screenname') . '" class="title-label">' . __('Zillow Screenname:', 're-pro') . '</label>';
102
+		echo '	<input id="' . $this->get_field_id('screenname') . '" name="' . $this->get_field_name('screenname') . '" value="' . $screenname . '" class="widefat">';
103 103
 		echo '</p>';
104 104
 
105 105
 		// Select a State.
106 106
 		echo '<p>';
107
-		echo '	<label for="' . $this->get_field_id( 'region' ) . '" class="title-label">' . __( 'Region:', 're-pro' ) . '</label>';
108
-		echo '<select id="' . $this->get_field_id( 'region' ) . '" name="' . $this->get_field_name( 'region' ) . '" class="widefat">';
109
-	    echo '<option value="102001"'. selected( $region, 102001 ) .'>'. __( 'United States', 're-pro' ) .'</option>';
110
-	    echo '<option value="3"'. selected( $region, 3 ) .'>Alaska</option>';
111
-	    echo '<option value="4"'. selected( $region, 4 ) .'>Alabama</option>';
112
-	    echo '<option value="6"'. selected( $region, 6 ) .'>Arkansas</option>';
113
-	    echo '<option value="8"'. selected( $region, 8 ) .'>Arizona</option>';
114
-	    echo '<option value="9"'. selected( $region, 9 ) .'>California</option>';
115
-	    echo '<option value="10"'. selected( $region, 10 ) .'>Colorado</option>';
116
-	    echo '<option value="11"'. selected( $region, 11 ) .'>Connecticut</option>';
117
-	    echo '<option value="13"'. selected( $region, 13 ) .'>Delaware</option>';
118
-	    echo '<option value="14"'. selected( $region, 14 ) .'>Florida</option>';
119
-	    echo '<option value="16"'. selected( $region, 16 ) .'>Georgia</option>';
120
-	    echo '<option value="18"'. selected( $region, 18 ) .'>Hawaii</option>';
121
-	    echo '<option value="19"'. selected( $region, 19 ) .'>Iowa</option>';
122
-	    echo '<option value="20"'. selected( $region, 20 ) .'>Idaho</option>';
123
-	    echo '<option value="21"'. selected( $region, 21 ) .'>Illinois</option>';
124
-	    echo '<option value="22"'. selected( $region, 22 ) .'>Indiana</option>';
125
-	    echo '<option value="23"'. selected( $region, 23 ) .'>Kansas</option>';
126
-	    echo '<option value="24"'. selected( $region, 24 ) .'>Kentucky</option>';
127
-	    echo '<option value="25"'. selected( $region, 25 ) .'>Louisiana</option>';
128
-	    echo '<option value="26"'. selected( $region, 26 ) .'>Massachusetts</option>';
129
-	    echo '<option value="27"'. selected( $region, 27 ) .'>Maryland</option>';
130
-	    echo '<option value="28"'. selected( $region, 28 ) .'>Maine</option>';
131
-	    echo '<option value="30"'. selected( $region, 30 ) .'>Michigan</option>';
132
-	    echo '<option value="31"'. selected( $region, 31 ) .'>Minnesota</option>';
133
-	    echo '<option value="32"'. selected( $region, 32 ) .'>Missouri</option>';
134
-	    echo '<option value="34"'. selected( $region, 34 ) .'>Mississippi</option>';
135
-	    echo '<option value="35"'. selected( $region, 35 ) .'>Montana</option>';
136
-	    echo '<option value="36"'. selected( $region, 36 ) .'>North Carolina</option>';
137
-	    echo '<option value="37"'. selected( $region, 37 ) .'>North Dakota</option>';
138
-	    echo '<option value="38"'. selected( $region, 38 ) .'>Nebraska</option>';
139
-	    echo '<option value="39"'. selected( $region, 39 ) .'>New Hampshire</option>';
140
-	    echo '<option value="40"'. selected( $region, 40 ) .'>New Jersey</option>';
141
-	    echo '<option value="41"'. selected( $region, 41 ) .'>New Mexico</option>';
142
-	    echo '<option value="42"'. selected( $region, 42 ) .'>Nevada</option>';
143
-	    echo '<option value="43"'. selected( $region, 43 ) .'>New York</option>';
144
-	    echo '<option value="44"'. selected( $region, 44 ) .'>Ohio</option>';
145
-	    echo '<option value="45"'. selected( $region, 45 ) .'>Oklahoma</option>';
146
-	    echo '<option value="46"'. selected( $region, 46 ) .'>Oregon</option>';
147
-	    echo '<option value="47"'. selected( $region, 47 ) .'>Pennsylvania</option>';
148
-	    echo '<option value="48"'. selected( $region, 48 ) .'>Puerto Rico</option>';
149
-	    echo '<option value="50"'. selected( $region, 50 ) .'>Rhode Island</option>';
150
-	    echo '<option value="51"'. selected( $region, 51 ) .'>South Carolina</option>';
151
-	    echo '<option value="52"'. selected( $region, 52 ) .'>South Dakota</option>';
152
-	    echo '<option value="53"'. selected( $region, 53 ) .'>Tennessee</option>';
153
-	    echo '<option value="54"'. selected( $region, 54 ) .'>Texas</option>';
154
-	    echo '<option value="55"'. selected( $region, 55 ) .'>Utah</option>';
155
-	    echo '<option value="56"'. selected( $region, 56 ) .'>Virginia</option>';
156
-	    echo '<option value="57"'. selected( $region, 57 ) .'>Virgin Islands</option>';
157
-	    echo '<option value="58"'. selected( $region, 58 ) .'>Vermont</option>';
158
-	    echo '<option value="59"'. selected( $region, 59 ) .'>Washington</option>';
159
-	    echo '<option value="12"'. selected( $region, 12 ) .'>Washington, DC</option>';
160
-	    echo '<option value="60"'. selected( $region, 60 ) .'>Wisconsin</option>';
161
-	    echo '<option value="61"'. selected( $region, 61 ) .'>West Virginia</option>';
162
-	    echo '<option value="62"'. selected( $region, 62 ) .'>Wyoming</option>';
107
+		echo '	<label for="' . $this->get_field_id('region') . '" class="title-label">' . __('Region:', 're-pro') . '</label>';
108
+		echo '<select id="' . $this->get_field_id('region') . '" name="' . $this->get_field_name('region') . '" class="widefat">';
109
+	    echo '<option value="102001"' . selected($region, 102001) . '>' . __('United States', 're-pro') . '</option>';
110
+	    echo '<option value="3"' . selected($region, 3) . '>Alaska</option>';
111
+	    echo '<option value="4"' . selected($region, 4) . '>Alabama</option>';
112
+	    echo '<option value="6"' . selected($region, 6) . '>Arkansas</option>';
113
+	    echo '<option value="8"' . selected($region, 8) . '>Arizona</option>';
114
+	    echo '<option value="9"' . selected($region, 9) . '>California</option>';
115
+	    echo '<option value="10"' . selected($region, 10) . '>Colorado</option>';
116
+	    echo '<option value="11"' . selected($region, 11) . '>Connecticut</option>';
117
+	    echo '<option value="13"' . selected($region, 13) . '>Delaware</option>';
118
+	    echo '<option value="14"' . selected($region, 14) . '>Florida</option>';
119
+	    echo '<option value="16"' . selected($region, 16) . '>Georgia</option>';
120
+	    echo '<option value="18"' . selected($region, 18) . '>Hawaii</option>';
121
+	    echo '<option value="19"' . selected($region, 19) . '>Iowa</option>';
122
+	    echo '<option value="20"' . selected($region, 20) . '>Idaho</option>';
123
+	    echo '<option value="21"' . selected($region, 21) . '>Illinois</option>';
124
+	    echo '<option value="22"' . selected($region, 22) . '>Indiana</option>';
125
+	    echo '<option value="23"' . selected($region, 23) . '>Kansas</option>';
126
+	    echo '<option value="24"' . selected($region, 24) . '>Kentucky</option>';
127
+	    echo '<option value="25"' . selected($region, 25) . '>Louisiana</option>';
128
+	    echo '<option value="26"' . selected($region, 26) . '>Massachusetts</option>';
129
+	    echo '<option value="27"' . selected($region, 27) . '>Maryland</option>';
130
+	    echo '<option value="28"' . selected($region, 28) . '>Maine</option>';
131
+	    echo '<option value="30"' . selected($region, 30) . '>Michigan</option>';
132
+	    echo '<option value="31"' . selected($region, 31) . '>Minnesota</option>';
133
+	    echo '<option value="32"' . selected($region, 32) . '>Missouri</option>';
134
+	    echo '<option value="34"' . selected($region, 34) . '>Mississippi</option>';
135
+	    echo '<option value="35"' . selected($region, 35) . '>Montana</option>';
136
+	    echo '<option value="36"' . selected($region, 36) . '>North Carolina</option>';
137
+	    echo '<option value="37"' . selected($region, 37) . '>North Dakota</option>';
138
+	    echo '<option value="38"' . selected($region, 38) . '>Nebraska</option>';
139
+	    echo '<option value="39"' . selected($region, 39) . '>New Hampshire</option>';
140
+	    echo '<option value="40"' . selected($region, 40) . '>New Jersey</option>';
141
+	    echo '<option value="41"' . selected($region, 41) . '>New Mexico</option>';
142
+	    echo '<option value="42"' . selected($region, 42) . '>Nevada</option>';
143
+	    echo '<option value="43"' . selected($region, 43) . '>New York</option>';
144
+	    echo '<option value="44"' . selected($region, 44) . '>Ohio</option>';
145
+	    echo '<option value="45"' . selected($region, 45) . '>Oklahoma</option>';
146
+	    echo '<option value="46"' . selected($region, 46) . '>Oregon</option>';
147
+	    echo '<option value="47"' . selected($region, 47) . '>Pennsylvania</option>';
148
+	    echo '<option value="48"' . selected($region, 48) . '>Puerto Rico</option>';
149
+	    echo '<option value="50"' . selected($region, 50) . '>Rhode Island</option>';
150
+	    echo '<option value="51"' . selected($region, 51) . '>South Carolina</option>';
151
+	    echo '<option value="52"' . selected($region, 52) . '>South Dakota</option>';
152
+	    echo '<option value="53"' . selected($region, 53) . '>Tennessee</option>';
153
+	    echo '<option value="54"' . selected($region, 54) . '>Texas</option>';
154
+	    echo '<option value="55"' . selected($region, 55) . '>Utah</option>';
155
+	    echo '<option value="56"' . selected($region, 56) . '>Virginia</option>';
156
+	    echo '<option value="57"' . selected($region, 57) . '>Virgin Islands</option>';
157
+	    echo '<option value="58"' . selected($region, 58) . '>Vermont</option>';
158
+	    echo '<option value="59"' . selected($region, 59) . '>Washington</option>';
159
+	    echo '<option value="12"' . selected($region, 12) . '>Washington, DC</option>';
160
+	    echo '<option value="60"' . selected($region, 60) . '>Wisconsin</option>';
161
+	    echo '<option value="61"' . selected($region, 61) . '>West Virginia</option>';
162
+	    echo '<option value="62"' . selected($region, 62) . '>Wyoming</option>';
163 163
 		echo '</select>';
164 164
 		echo '</p>';
165 165
 
166 166
 		// Text Color
167 167
 		echo '<p>';
168
-		echo '	<label for="' . $this->get_field_id( 'textcolor' ) . '" class="title-label">' . __( 'Text Color:', 're-pro' ) . '</label>';
169
-		echo '	<input id="' . $this->get_field_id( 'textcolor' ) . '" name="' . $this->get_field_name( 'textcolor' ) . '" value="' . $textcolor  . '" class="widefat">';
168
+		echo '	<label for="' . $this->get_field_id('textcolor') . '" class="title-label">' . __('Text Color:', 're-pro') . '</label>';
169
+		echo '	<input id="' . $this->get_field_id('textcolor') . '" name="' . $this->get_field_name('textcolor') . '" value="' . $textcolor . '" class="widefat">';
170 170
 		echo '</p>';
171 171
 
172 172
 	}
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	 * @param mixed $old_instance Old Instance.
180 180
 	 * @return $instance
181 181
 	 */
182
-	public function update( $new_instance, $old_instance ) {
182
+	public function update($new_instance, $old_instance) {
183 183
 
184 184
 		$instance = $old_instance;
185 185
 
186
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
187
-		$instance['screenname'] = ! empty( $new_instance['screenname'] ) ? strip_tags( $new_instance['screenname'] ) : '';
188
-		$instance['region'] = ! empty( $new_instance['region'] ) ? strip_tags( $new_instance['region'] ) : '';
189
-		$instance['textcolor'] = ! empty( $new_instance['textcolor'] ) ? strip_tags( $new_instance['textcolor'] ) : '';
186
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
187
+		$instance['screenname'] = ! empty($new_instance['screenname']) ? strip_tags($new_instance['screenname']) : '';
188
+		$instance['region'] = ! empty($new_instance['region']) ? strip_tags($new_instance['region']) : '';
189
+		$instance['textcolor'] = ! empty($new_instance['textcolor']) ? strip_tags($new_instance['textcolor']) : '';
190 190
 
191 191
 		return $instance;
192 192
 	}
Please login to merge, or discard this patch.
modules/zillow/widgets/class-expensive-homes-widget.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Exit if accessed directly. */
4
-if ( ! defined( 'ABSPATH' ) ) { exit; }
4
+if ( ! defined('ABSPATH')) { exit; }
5 5
 
6 6
 /**
7 7
  * Zillow Expensive Homes Widget (https://www.zillow.com/webtools/widgets/MostExpensiveHomes.htm)
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
 		parent::__construct(
29 29
 			'zillow_expensive_homes_widget',
30
-			__( 'Zillow Most Expensive Homes', 're-pro' ),
30
+			__('Zillow Most Expensive Homes', 're-pro'),
31 31
 			array(
32
-				'description' => __( 'Display the most expensive homes from Zillow.', 're-pro' ),
32
+				'description' => __('Display the most expensive homes from Zillow.', 're-pro'),
33 33
 				'classname'   => 're-pro re-pro-widget zillow-widget zillow-widget-expensive-homes',
34 34
 				'customize_selective_refresh' => true,
35 35
 			)
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
 	 * @param mixed $instance Instance.
45 45
 	 * @return void
46 46
 	 */
47
-	public function widget( $args, $instance ) {
47
+	public function widget($args, $instance) {
48 48
 
49
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
50
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
51
-		$type = ! empty( $instance['type'] ) ? $instance['type'] : '';
52
-		$size = ! empty( $instance['size'] ) ? $instance['size'] : '';
53
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
49
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
50
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
51
+		$type = ! empty($instance['type']) ? $instance['type'] : '';
52
+		$size = ! empty($instance['size']) ? $instance['size'] : '';
53
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
54 54
 
55 55
 		echo $args['before_widget'];
56 56
 
57
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
57
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
58 58
 
59 59
 
60 60
 		$zillow_widgets = new ZillowWidgets();
61 61
 
62
-		$zillow_widgets->get_expensive_homes_widget( $iframe_id, $location, 'iframe', 'wide' );
62
+		$zillow_widgets->get_expensive_homes_widget($iframe_id, $location, 'iframe', 'wide');
63 63
 
64 64
 		echo $args['after_widget'];
65 65
 	}
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 	 * @param mixed $instance Instance.
72 72
 	 * @return void
73 73
 	 */
74
-	public function form( $instance ) {
74
+	public function form($instance) {
75 75
 
76 76
 		// Set default values.
77
-		$instance = wp_parse_args( (array) $instance, array(
77
+		$instance = wp_parse_args((array) $instance, array(
78 78
 			'title' => '',
79 79
 			'type' => 'iframe',
80 80
 			'size' => 'wide',
@@ -82,19 +82,19 @@  discard block
 block discarded – undo
82 82
 		));
83 83
 
84 84
 		// Retrieve an existing value from the database.
85
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
86
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
85
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
86
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
87 87
 
88 88
 		// Title.
89 89
 		echo '<p>';
90
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
91
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
90
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
91
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
92 92
 		echo '</p>';
93 93
 
94 94
 		// Location.
95 95
 		echo '<p>';
96
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
97
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" placeholder="El Segundo, CA" name="' . $this->get_field_name( 'location' ) . '" value="' . $location  . '" class="widefat">';
96
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
97
+		echo '	<input id="' . $this->get_field_id('location') . '" placeholder="El Segundo, CA" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
98 98
 		echo '</p>';
99 99
 
100 100
 	}
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
 	 * @param mixed $old_instance Old Instance.
108 108
 	 * @return $instance
109 109
 	 */
110
-	public function update( $new_instance, $old_instance ) {
110
+	public function update($new_instance, $old_instance) {
111 111
 
112 112
 		$instance = $old_instance;
113 113
 
114
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
115
-		$instance['type'] = ! empty( $new_instance['type'] ) ? strip_tags( $new_instance['type'] ) : '';
116
-		$instance['size'] = ! empty( $new_instance['size'] ) ? strip_tags( $new_instance['size'] ) : '';
117
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
114
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
115
+		$instance['type'] = ! empty($new_instance['type']) ? strip_tags($new_instance['type']) : '';
116
+		$instance['size'] = ! empty($new_instance['size']) ? strip_tags($new_instance['size']) : '';
117
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
118 118
 
119 119
 		return $instance;
120 120
 	}
@@ -128,6 +128,6 @@  discard block
 block discarded – undo
128 128
  */
129 129
 function repro_zillow_expensive_homes_widget() {
130 130
 
131
-	register_widget( 'ZillowExpensiveHomesWidget' );
131
+	register_widget('ZillowExpensiveHomesWidget');
132 132
 }
133
-add_action( 'widgets_init', 'repro_zillow_expensive_homes_widget' );
133
+add_action('widgets_init', 'repro_zillow_expensive_homes_widget');
Please login to merge, or discard this patch.