Completed
Pull Request — master (#836)
by Zack
18:58
created
future/includes/class-gv-view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 		$supports = array( 'title', 'revisions' );
36 36
 
37 37
 		if ( $is_hierarchical ) {
38
-			$supports[] = 'page-attributes';
38
+			$supports[ ] = 'page-attributes';
39 39
 		}
40 40
 
41 41
 		/**
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-transaction-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	var $is_numeric = true;
16 16
 
17
-	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with'  );
17
+	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' );
18 18
 
19 19
 	var $group = 'pricing';
20 20
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-checkbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
46 46
 
47 47
 		// It's not the parent field; it's an input
48
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
48
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
49 49
 
50
-			if( $this->is_choice_value_enabled() ) {
50
+			if ( $this->is_choice_value_enabled() ) {
51 51
 
52 52
 				$desc = esc_html__( 'This input has a label and a value. What should be displayed?', 'gravityview' );
53 53
 				$default = 'value';
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 				);
66 66
 			}
67 67
 
68
-			$field_options['choice_display'] = array(
68
+			$field_options[ 'choice_display' ] = array(
69 69
 				'type'    => 'radio',
70 70
 				'class'   => 'vertical',
71 71
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-product.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) {
51 51
 
52
-		if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
52
+		if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
53 53
 			return;
54 54
 		}
55 55
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 * @see GVCommon::entry_has_transaction_data()
102 102
 		 * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine.
103 103
 		 */
104
-		$hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
104
+		$hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
105 105
 
106 106
 		return $hide_product_fields;
107 107
 	}
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 	// hold widget View options
52 52
 	private $widget_options;
53 53
 
54
-	function __construct( $widget_label , $widget_id , $defaults = array(), $settings = array() ) {
54
+	function __construct( $widget_label, $widget_id, $defaults = array(), $settings = array() ) {
55 55
 
56 56
 
57 57
 		/**
58 58
 		 * The shortcode name is set to the lowercase name of the widget class, unless overridden by the class specifying a different value for $shortcode_name
59 59
 		 * @var string
60 60
 		 */
61
-		$this->shortcode_name = !isset( $this->shortcode_name ) ? strtolower( get_class($this) ) : $this->shortcode_name;
61
+		$this->shortcode_name = ! isset( $this->shortcode_name ) ? strtolower( get_class( $this ) ) : $this->shortcode_name;
62 62
 
63 63
 		$this->widget_label = $widget_label;
64 64
 		$this->widget_id = $widget_id;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$this->settings = wp_parse_args( $settings, $this->settings );
70 70
 
71 71
 		// register widgets to be listed in the View Configuration
72
-		add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget') );
72
+		add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget' ) );
73 73
 
74 74
 		// widget options
75 75
 		add_filter( 'gravityview_template_widget_options', array( $this, 'assign_widget_options' ), 10, 3 );
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 		add_action( "gravityview_render_widget_{$widget_id}", array( $this, 'render_frontend' ), 10, 1 );
79 79
 
80 80
 		// register shortcodes
81
-		add_action( 'wp', array( $this, 'add_shortcode') );
81
+		add_action( 'wp', array( $this, 'add_shortcode' ) );
82 82
 
83 83
 		// Use shortcodes in text widgets.
84
-		add_filter('widget_text', array( $this, 'maybe_do_shortcode' ) );
84
+		add_filter( 'widget_text', array( $this, 'maybe_do_shortcode' ) );
85 85
 	}
86 86
 
87 87
 
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 		 * @param boolean $enable_custom_class False by default. Return true if you want to enable.
100 100
 		 * @param GravityView_Widget $this Current instance of GravityView_Widget
101 101
 		 */
102
-		$enable_custom_class = apply_filters('gravityview/widget/enable_custom_class', false, $this );
102
+		$enable_custom_class = apply_filters( 'gravityview/widget/enable_custom_class', false, $this );
103 103
 
104
-		if( $enable_custom_class ) {
104
+		if ( $enable_custom_class ) {
105 105
 
106
-			$settings['custom_class'] = array(
106
+			$settings[ 'custom_class' ] = array(
107 107
 				'type' => 'text',
108 108
 				'label' => __( 'Custom CSS Class:', 'gravityview' ),
109
-				'desc' => __( 'This class will be added to the widget container', 'gravityview'),
109
+				'desc' => __( 'This class will be added to the widget container', 'gravityview' ),
110 110
 				'value' => '',
111 111
 				'merge_tags' => true,
112 112
 			);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return array|null   Settings array; NULL if not set
129 129
 	 */
130 130
 	public function get_settings() {
131
-		return !empty( $this->settings ) ? $this->settings : NULL;
131
+		return ! empty( $this->settings ) ? $this->settings : NULL;
132 132
 	}
133 133
 
134 134
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	public function get_setting( $key ) {
140 140
 		$setting = NULL;
141 141
 
142
-		if( isset( $this->settings ) && is_array( $this->settings ) ) {
142
+		if ( isset( $this->settings ) && is_array( $this->settings ) ) {
143 143
 			$setting = isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : NULL;
144 144
 		}
145 145
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	function maybe_do_shortcode( $text, $widget = NULL ) {
156 156
 
157
-		if( !empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) {
157
+		if ( ! empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) {
158 158
 			return do_shortcode( $text );
159 159
 		}
160 160
 
@@ -183,26 +183,26 @@  discard block
 block discarded – undo
183 183
 			return;
184 184
 		}
185 185
 
186
-		if( empty( $this->shortcode_name ) ) { return; }
186
+		if ( empty( $this->shortcode_name ) ) { return; }
187 187
 
188 188
 		// If the widget shouldn't output on single entries, don't show it
189
-		if( empty( $this->show_on_single ) && class_exists('GravityView_frontend') && GravityView_frontend::is_single_entry() ) {
190
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class($this)) );
189
+		if ( empty( $this->show_on_single ) && class_exists( 'GravityView_frontend' ) && GravityView_frontend::is_single_entry() ) {
190
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class( $this ) ) );
191 191
 
192 192
 			add_shortcode( $this->shortcode_name, '__return_null' );
193 193
 			return;
194 194
 		}
195 195
 
196 196
 
197
-		if( !has_gravityview_shortcode( $post ) ) {
197
+		if ( ! has_gravityview_shortcode( $post ) ) {
198 198
 
199
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class($this)) );
199
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class( $this ) ) );
200 200
 
201 201
 			add_shortcode( $this->shortcode_name, '__return_null' );
202 202
 			return;
203 203
 		}
204 204
 
205
-		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') );
205
+		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) );
206 206
 	}
207 207
 
208 208
 	/**
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	function register_widget( $widgets ) {
214 214
 		$widgets[ $this->widget_id ] = array(
215
-			'label' => $this->widget_label ,
215
+			'label' => $this->widget_label,
216 216
 			'description' => $this->widget_description,
217 217
 			'subtitle' => $this->widget_subtitle,
218 218
 		);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	public function assign_widget_options( $options = array(), $template = '', $widget = '' ) {
231 231
 
232
-		if( $this->widget_id === $widget ) {
232
+		if ( $this->widget_id === $widget ) {
233 233
 			$options = array_merge( $options, $this->settings );
234 234
 		}
235 235
 
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 	 *
243 243
 	 * @return void
244 244
 	 */
245
-	public function render_frontend( $widget_args, $content = '', $context = '') {
245
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
246 246
 		// to be defined by child class
247
-		if( !$this->pre_render_frontend() ) {
247
+		if ( ! $this->pre_render_frontend() ) {
248 248
 			return;
249 249
 		}
250 250
 	}
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 	public function pre_render_frontend() {
257 257
 		$gravityview_view = GravityView_View::getInstance();
258 258
 
259
-		if( empty( $gravityview_view ) ) {
260
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class($this)) );
259
+		if ( empty( $gravityview_view ) ) {
260
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class( $this ) ) );
261 261
 			return false;
262 262
 		}
263 263
 
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 		 */
269 269
 		$hide_until_search = apply_filters( 'gravityview/widget/hide_until_searched', $gravityview_view->hide_until_searched, $this );
270 270
 
271
-		if( $hide_until_search ) {
272
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class($this)) );
271
+		if ( $hide_until_search ) {
272
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class( $this ) ) );
273 273
 			return false;
274 274
 		}
275 275
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-multiselect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 * @see GFCommon::get_field_filter_settings Gravity Forms suggests checkboxes should just be "contains"
14 14
 	 * @var array
15 15
 	 */
16
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
16
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
17 17
 
18 18
 	var $is_searchable = true;
19 19
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	var $is_searchable = true;
13 13
 
14
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
14
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
15 15
 
16 16
 	var $_gf_field_class_name = 'GF_Field_Radio';
17 17
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 		// Set the $_field_id var
41 41
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
42 42
 		
43
-		if( $this->is_choice_value_enabled() ) {
44
-			$field_options['choice_display'] = array(
43
+		if ( $this->is_choice_value_enabled() ) {
44
+			$field_options[ 'choice_display' ] = array(
45 45
 				'type'    => 'radio',
46 46
 				'value'   => 'value',
47 47
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-category.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	var $is_searchable = true;
13 13
 
14
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
14
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
15 15
 
16 16
 	var $_gf_field_class_name = 'GF_Field_Post_Category';
17 17
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		$entry = GFAPI::get_entry( $entry_id );
45 45
 		$post_id = rgar( $entry, 'post_id' );
46 46
 
47
-		if( empty( $post_id ) ) {
47
+		if ( empty( $post_id ) ) {
48 48
 			return false;
49 49
 		}
50 50
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		$post_category_fields = GFAPI::get_fields_by_type( $form, 'post_category' );
54 54
 
55
-		if( $post_category_fields ) {
55
+		if ( $post_category_fields ) {
56 56
 
57 57
 			$updated_categories = array();
58 58
 
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @return mixed
121 121
 	 */
122
-	function edit_entry_post_category_choices( $choices, $field, $form_id  ) {
122
+	function edit_entry_post_category_choices( $choices, $field, $form_id ) {
123 123
 
124
-		$entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry();
124
+		$entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry();
125 125
 
126 126
 		// $entry['post_id'] should always be set, but we check to make sure.
127
-		if( $entry && isset( $entry['post_id'] ) && $post_id = $entry['post_id'] ) {
127
+		if ( $entry && isset( $entry[ 'post_id' ] ) && $post_id = $entry[ 'post_id' ] ) {
128 128
 
129 129
 			$post_categories = wp_get_post_categories( $post_id, array( 'fields' => 'ids' ) );
130 130
 
131 131
 			// Always use the live value
132 132
 			foreach ( $choices as &$choice ) {
133
-				$choice['isSelected'] = in_array( $choice['value'], array_values( $post_categories ) );
133
+				$choice[ 'isSelected' ] = in_array( $choice[ 'value' ], array_values( $post_categories ) );
134 134
 			}
135 135
 		}
136 136
 
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 
140 140
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
141 141
 
142
-		if( 'edit' === $context ) {
142
+		if ( 'edit' === $context ) {
143 143
 			return $field_options;
144 144
 		}
145 145
 
146
-		$this->add_field_support('dynamic_data', $field_options );
147
-		$this->add_field_support('link_to_term', $field_options );
146
+		$this->add_field_support( 'dynamic_data', $field_options );
147
+		$this->add_field_support( 'link_to_term', $field_options );
148 148
 
149 149
 		return $field_options;
150 150
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-tags.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 	var $is_searchable = true;
16 16
 
17
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
17
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
18 18
 
19 19
 	var $_gf_field_class_name = 'GF_Field_Post_Tags';
20 20
 
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
29 29
 
30
-		if( 'edit' === $context ) {
30
+		if ( 'edit' === $context ) {
31 31
 			return $field_options;
32 32
 		}
33 33
 
34
-		$this->add_field_support('dynamic_data', $field_options );
35
-		$this->add_field_support('link_to_term', $field_options );
34
+		$this->add_field_support( 'dynamic_data', $field_options );
35
+		$this->add_field_support( 'link_to_term', $field_options );
36 36
 
37 37
 		return $field_options;
38 38
 	}
Please login to merge, or discard this patch.