Completed
Pull Request — master (#1071)
by Gennady
22:39 queued 18:23
created
includes/plugin-and-theme-hooks/class-gravityview-theme-hooks-woothemes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 		$gv_page = gravityview_is_admin_page( '', 'single' );
79 79
 
80 80
 		// New View or Edit View page
81
-		if( $gv_page && $pagenow === 'post-new.php' ) {
81
+		if ( $gv_page && $pagenow === 'post-new.php' ) {
82 82
 			remove_meta_box( 'woothemes-settings', 'gravityview', 'normal' );
83 83
 		}
84 84
 	}
Please login to merge, or discard this patch.
includes/class-gravityview-template.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 * @return string                Path to XML file
194 194
 	 */
195 195
 	public function assign_form_xml( $xml = '', $template = '' ) {
196
-		if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_form'] ) && $this->template_id === $template ) {
197
-			return $this->settings['preset_form'];
196
+		if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_form' ] ) && $this->template_id === $template ) {
197
+			return $this->settings[ 'preset_form' ];
198 198
 		}
199 199
 
200 200
 		return $xml;
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 	 * @return string                Path to XML file
208 208
 	 */
209 209
 	public function assign_fields_xml( $xml = '', $template = '' ) {
210
-		if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_fields'] ) && $this->template_id === $template ) {
211
-			return $this->settings['preset_fields'];
210
+		if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_fields' ] ) && $this->template_id === $template ) {
211
+			return $this->settings[ 'preset_fields' ];
212 212
 		}
213 213
 
214 214
 		return $xml;
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function assign_view_slug( $default, $context ) {
228 228
 
229
-		if ( ! empty( $this->settings['slug'] ) ) {
230
-			return $this->settings['slug'];
229
+		if ( ! empty( $this->settings[ 'slug' ] ) ) {
230
+			return $this->settings[ 'slug' ];
231 231
 		}
232 232
 		if ( ! empty( $default ) ) {
233 233
 			return $default;
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 	 * @return void
245 245
 	 */
246 246
 	public function register_styles() {
247
-		if ( ! empty( $this->settings['css_source'] ) ) {
248
-			wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings['css_source'], array(), GravityView_Plugin::version, 'all' );
247
+		if ( ! empty( $this->settings[ 'css_source' ] ) ) {
248
+			wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings[ 'css_source' ], array(), GravityView_Plugin::version, 'all' );
249 249
 		}
250 250
 	}
251 251
 
Please login to merge, or discard this patch.
includes/class-debug-bar.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 	function init() {
22 22
 
23 23
 		$icon = is_admin() ? '<i class="icon gv-icon-astronaut-head"></i>&nbsp;' : NULL;
24
-		$this->title( $icon . __('GravityView', 'gravityview') );
24
+		$this->title( $icon . __( 'GravityView', 'gravityview' ) );
25 25
 	}
26 26
 
27 27
 	function get_warnings() {
28 28
 
29
-		if( is_null( $this->warnings ) ) {
29
+		if ( is_null( $this->warnings ) ) {
30 30
 			$this->warnings = GravityView_Logging::get_errors();
31 31
 		}
32 32
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 	function get_notices() {
37 37
 
38
-		if( is_null( $this->notices ) ) {
38
+		if ( is_null( $this->notices ) ) {
39 39
 			$this->notices = GravityView_Logging::get_notices();
40 40
 		}
41 41
 
@@ -84,27 +84,27 @@  discard block
 block discarded – undo
84 84
 		</style>
85 85
 		<div id='debug-bar-gravityview'>";
86 86
 
87
-		$output .= '<img src="'.plugins_url('assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ).'" class="alignright" alt="" width="100" height="132" />';
87
+		$output .= '<img src="' . plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ) . '" class="alignright" alt="" width="100" height="132" />';
88 88
 
89 89
 
90 90
 		$warnings = $this->get_warnings();
91 91
 		$notices = $this->get_notices();
92 92
 
93
-		if(count($warnings)) {
94
-			$output .= '<h3><span>'.__('Warnings', 'gravityview').'</span></h3>';
93
+		if ( count( $warnings ) ) {
94
+			$output .= '<h3><span>' . __( 'Warnings', 'gravityview' ) . '</span></h3>';
95 95
 			$output .= '<ol>';
96
-			foreach ( $warnings as $key => $notice) {
97
-				if(empty($notice['message'])) { continue; }
98
-				$output .= '<li><a href="#'.sanitize_html_class( 'gv-warning-' . $key ).'">'.strip_tags($notice['message']).'</a></li>';
96
+			foreach ( $warnings as $key => $notice ) {
97
+				if ( empty( $notice[ 'message' ] ) ) { continue; }
98
+				$output .= '<li><a href="#' . sanitize_html_class( 'gv-warning-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>';
99 99
 			}
100 100
 			$output .= '</ol><hr />';
101 101
 		}
102
-		if(count($notices)) {
103
-			$output .= '<h3><span>'.__('Logs', 'gravityview').'</span></h3>';
102
+		if ( count( $notices ) ) {
103
+			$output .= '<h3><span>' . __( 'Logs', 'gravityview' ) . '</span></h3>';
104 104
 			$output .= '<ol>';
105
-			foreach ( $notices as $key => $notice) {
106
-				if(empty($notice['message'])) { continue; }
107
-				$output .= '<li><a href="#'.sanitize_html_class( 'gv-notice-' . $key ).'">'.strip_tags($notice['message']).'</a></li>';
105
+			foreach ( $notices as $key => $notice ) {
106
+				if ( empty( $notice[ 'message' ] ) ) { continue; }
107
+				$output .= '<li><a href="#' . sanitize_html_class( 'gv-notice-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>';
108 108
 			}
109 109
 			$output .= '</ol><hr />';
110 110
 		}
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 		if ( count( $warnings ) ) {
113 113
 			$output .= '<h3>Warnings</h3>';
114 114
 			$output .= '<ol class="debug-bar-php-list">';
115
-			foreach ( $warnings as $key => $notice) { $output .= $this->render_item( $notice, 'gv-warning-'  . $key ); }
115
+			foreach ( $warnings as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-warning-' . $key ); }
116 116
 			$output .= '</ol>';
117 117
 		}
118 118
 
119 119
 		if ( count( $notices ) ) {
120 120
 			$output .= '<h3>Notices</h3>';
121 121
 			$output .= '<ol class="debug-bar-php-list">';
122
-			foreach ( $notices as $key => $notice) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); }
122
+			foreach ( $notices as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); }
123 123
 			$output .= '</ol>';
124 124
 		}
125 125
 
@@ -133,17 +133,17 @@  discard block
 block discarded – undo
133 133
 	 * @param  string|array $item Unescaped
134 134
 	 * @return string       Escaped HTML
135 135
 	 */
136
-	function esc_html_recursive($item) {
137
-		if(is_object($item)) {
138
-			foreach($item as $key => $value) {
139
-				$item->{$key} = $this->esc_html_recursive($value);
136
+	function esc_html_recursive( $item ) {
137
+		if ( is_object( $item ) ) {
138
+			foreach ( $item as $key => $value ) {
139
+				$item->{$key} = $this->esc_html_recursive( $value );
140 140
 			}
141
-		} else if(is_array($item)) {
142
-			foreach($item as $key => $value) {
143
-				$item[$key] = $this->esc_html_recursive($value);
141
+		} else if ( is_array( $item ) ) {
142
+			foreach ( $item as $key => $value ) {
143
+				$item[ $key ] = $this->esc_html_recursive( $value );
144 144
 			}
145 145
 		} else {
146
-			$item = esc_html($item);
146
+			$item = esc_html( $item );
147 147
 		}
148 148
 		return $item;
149 149
 	}
@@ -159,26 +159,26 @@  discard block
 block discarded – undo
159 159
 
160 160
 		$output = '';
161 161
 
162
-		if(!empty($notice['message'])) {
163
-			$output .= '<a id="'.sanitize_html_class( $anchor ).'"></a>';
162
+		if ( ! empty( $notice[ 'message' ] ) ) {
163
+			$output .= '<a id="' . sanitize_html_class( $anchor ) . '"></a>';
164 164
 			$output .= "<li class='debug-bar-php-notice'>";
165 165
 		}
166 166
 
167 167
 		$output .= '<div class="clear"></div>';
168 168
 
169 169
 		// Title
170
-		$output .= '<div class="gravityview-debug-bar-title">'.esc_attr( $notice['message'] ).'</div>';
170
+		$output .= '<div class="gravityview-debug-bar-title">' . esc_attr( $notice[ 'message' ] ) . '</div>';
171 171
 
172 172
 		// Debugging Output
173
-		if( empty( $notice['data'] ) ) {
174
-			if( !is_null( $notice['data'] ) ) {
175
-				$output .= '<em>'._x('Empty', 'Debugging output data is empty.', 'gravityview' ).'</em>';
173
+		if ( empty( $notice[ 'data' ] ) ) {
174
+			if ( ! is_null( $notice[ 'data' ] ) ) {
175
+				$output .= '<em>' . _x( 'Empty', 'Debugging output data is empty.', 'gravityview' ) . '</em>';
176 176
 			}
177 177
 		} else {
178
-			$output .= sprintf( '<pre>%s</pre>', print_r($this->esc_html_recursive( $notice['data'] ), true) );
178
+			$output .= sprintf( '<pre>%s</pre>', print_r( $this->esc_html_recursive( $notice[ 'data' ] ), true ) );
179 179
 		}
180 180
 
181
-		if(!empty($notice['message'])) {
181
+		if ( ! empty( $notice[ 'message' ] ) ) {
182 182
 			$output .= '</li>';
183 183
 		}
184 184
 
Please login to merge, or discard this patch.
includes/default-widgets.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,4 @@
 block discarded – undo
5 5
  * @deprecated 1.7.5
6 6
  */
7 7
 
8
-include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
8
+include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-textarea.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
27 27
 
28
-		if( 'edit' === $context ) {
28
+		if ( 'edit' === $context ) {
29 29
 			return $field_options;
30 30
 		}
31 31
 
32
-		$field_options['trim_words'] = array(
32
+		$field_options[ 'trim_words' ] = array(
33 33
 			'type' => 'number',
34 34
 			'merge_tags' => false,
35 35
 			'value' => null,
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			'tooltip' => __( 'Enter the number of words to be shown. If specified it truncates the text. Leave it blank if you want to show the full text.', 'gravityview' ),
38 38
 		);
39 39
 
40
-        $field_options['make_clickable'] = array(
40
+        $field_options[ 'make_clickable' ] = array(
41 41
             'type' => 'checkbox',
42 42
             'merge_tags' => false,
43 43
             'value' => 0,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
29 29
 
30
-		unset ( $field_options['search_filter'], $field_options['show_as_link'] );
30
+		unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] );
31 31
 
32 32
 		return $field_options;
33 33
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-number.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,17 +28,17 @@
 block discarded – undo
28 28
 
29 29
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
30 30
 
31
-		$field_options['number_format'] = array(
31
+		$field_options[ 'number_format' ] = array(
32 32
 			'type' => 'checkbox',
33 33
 			'label' => __( 'Format number?', 'gravityview' ),
34
-			'desc' => __('Display numbers with thousands separators.', 'gravityview'),
34
+			'desc' => __( 'Display numbers with thousands separators.', 'gravityview' ),
35 35
 			'value' => false,
36 36
 		);
37 37
 
38
-		$field_options['decimals'] = array(
38
+		$field_options[ 'decimals' ] = array(
39 39
 			'type' => 'number',
40 40
 			'label' => __( 'Decimals', 'gravityview' ),
41
-			'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview'),
41
+			'desc' => __( 'Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview' ),
42 42
 			'value' => '',
43 43
 			'merge_tags' => false,
44 44
 		);
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
31 31
 
32
-		$this->add_field_support('link_to_post', $field_options );
32
+		$this->add_field_support( 'link_to_post', $field_options );
33 33
 
34 34
 		return $field_options;
35 35
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-title.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@
 block discarded – undo
25 25
 
26 26
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
27 27
 
28
-		if( 'edit' === $context ) {
28
+		if ( 'edit' === $context ) {
29 29
 			return $field_options;
30 30
 		}
31 31
 
32
-		$this->add_field_support('link_to_post', $field_options );
32
+		$this->add_field_support( 'link_to_post', $field_options );
33 33
 
34
-		$this->add_field_support('dynamic_data', $field_options );
34
+		$this->add_field_support( 'dynamic_data', $field_options );
35 35
 
36 36
 		return $field_options;
37 37
 	}
Please login to merge, or discard this patch.