Completed
Pull Request — develop (#1770)
by Zack
18:54
created
future/includes/class-gv-collection-entry.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 
105 105
 		/** Call all lazy callbacks. */
106 106
 		foreach ( $this->callbacks as $callback ) {
107
-			if ( $callback[0] != 'count' ) {
107
+			if ( $callback[ 0 ] != 'count' ) {
108 108
 				continue;
109 109
 			}
110 110
 
111
-			$total += $callback[1]( $this->filters );
111
+			$total += $callback[ 1 ]( $this->filters );
112 112
 		}
113 113
 
114 114
 		if ( ! $total ) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 		foreach ( $this->all() as $entry ) {
150 150
 			$entry = $entry->as_entry();
151
-			$result[] = Utils::get( $entry, $key, null );
151
+			$result[ ] = Utils::get( $entry, $key, null );
152 152
 		}
153 153
 
154 154
 		return $result;
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
 
207 207
 		/** Call all lazy callbacks. */
208 208
 		foreach ( $this->callbacks as $i => $callback ) {
209
-			if ( $callback[0] != 'fetch' ) {
209
+			if ( $callback[ 0 ] != 'fetch' ) {
210 210
 				continue;
211 211
 			}
212 212
 
213
-			$this->merge( $callback[1]( $this->filters, $this->sorts, $offset ) );
213
+			$this->merge( $callback[ 1 ]( $this->filters, $this->sorts, $offset ) );
214 214
 		}
215 215
 
216 216
 		$this->fetched = parent::count();
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 			return;
367 367
 		}
368 368
 
369
-		$this->callbacks []= array( $type, $callback );
369
+		$this->callbacks [ ] = array( $type, $callback );
370 370
 	}
371 371
 
372 372
 	/**
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-page-size.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 	/**
78 78
 	 * Render the page size widget
79
-     *
79
+	 *
80 80
 	 * @param array $widget_args The Widget shortcode args.
81 81
 	 * @param string $content The content.
82 82
 	 * @param string|\GV\Template_Context $context The context, if available.
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 						<?php } ?>
118 118
                     </select>
119 119
                     <input type="submit" value="Submit" style="visibility: hidden; position: absolute;" /><?php
120
-                    if( ! empty( $_GET ) ) {
121
-                        $get = $_GET;
122
-                        unset( $get['page_size'] );
123
-	                    foreach ( $get as $key => $value ) {
120
+					if( ! empty( $_GET ) ) {
121
+						$get = $_GET;
122
+						unset( $get['page_size'] );
123
+						foreach ( $get as $key => $value ) {
124 124
 							if ( is_array( $value ) ) {
125 125
 								foreach ( $value as $_key => $_value ) {
126 126
 									printf( '<input type="hidden" name="%s[%s]" value="%s" />', esc_attr( $key ), esc_attr( $_key ), esc_attr( $_value ) );
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 							} else {
129 129
 								printf( '<input type="hidden" name="%s" value="%s" />', esc_attr( $key ), esc_attr( $value ) );
130 130
 							}
131
-	                    }
132
-                    }
133
-                    ?>
131
+						}
132
+					}
133
+					?>
134 134
                 </div>
135 135
             </form>
136 136
         </div>
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$default_size = 25;
50 50
 
51 51
 		if ( $context instanceof \GV\Template_Context ) {
52
-			$default_size = (int) $context->view->settings->get( 'page_size' );
52
+			$default_size = (int)$context->view->settings->get( 'page_size' );
53 53
 		}
54 54
 
55 55
 		$sizes = array( 10, 25, $default_size, 50, 100 );
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 		$page_sizes = array();
62 62
 		foreach ( $sizes as $size ) {
63
-			$page_sizes [] = array(
63
+			$page_sizes [ ] = array(
64 64
 				'value' => $size,
65 65
 				'text'  => $size
66 66
 			);
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public function render_frontend( $widget_args, $content = '', $context = null ) {
87 87
 
88
-		if( ! $this->pre_render_frontend() ) {
88
+		if ( ! $this->pre_render_frontend() ) {
89 89
 			return;
90 90
 		}
91 91
 
92
-		$page_size = (int) \GV\Utils::_GET( 'page_size', $context->view->settings->get( 'page_size' ) );
92
+		$page_size = (int)\GV\Utils::_GET( 'page_size', $context->view->settings->get( 'page_size' ) );
93 93
 
94 94
 		$settings = shortcode_atts( array(
95 95
 			'label'   => __( 'Page Size', 'gk-gravityview' ),
@@ -108,20 +108,20 @@  discard block
 block discarded – undo
108 108
         <div class="gv-widget-page-size">
109 109
             <form method="get" action="<?php echo esc_url( add_query_arg( array() ) ); ?>" onchange="this.submit();">
110 110
                 <div>
111
-                    <?php if( ! empty( $settings['label'] ) ) { ?>
112
-                    <label for="gv-page_size"><?php echo esc_html( $settings['label'] ); ?></label>
111
+                    <?php if ( ! empty( $settings[ 'label' ] ) ) { ?>
112
+                    <label for="gv-page_size"><?php echo esc_html( $settings[ 'label' ] ); ?></label>
113 113
                     <?php } ?>
114 114
                     <select name="page_size" id="gv-page_size">
115
-                        <option value=""><?php echo esc_html( $settings['default_choice_text'] ); ?></option>
115
+                        <option value=""><?php echo esc_html( $settings[ 'default_choice_text' ] ); ?></option>
116 116
 						<?php
117
-						foreach ( $settings['choices'] as $choice ) { ?>
118
-                            <option value='<?php echo esc_attr( $choice['value'] ); ?>'<?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $page_size ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
117
+						foreach ( $settings[ 'choices' ] as $choice ) { ?>
118
+                            <option value='<?php echo esc_attr( $choice[ 'value' ] ); ?>'<?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $page_size ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option>
119 119
 						<?php } ?>
120 120
                     </select>
121 121
                     <input type="submit" value="Submit" style="visibility: hidden; position: absolute;" /><?php
122
-                    if( ! empty( $_GET ) ) {
122
+                    if ( ! empty( $_GET ) ) {
123 123
                         $get = $_GET;
124
-                        unset( $get['page_size'] );
124
+                        unset( $get[ 'page_size' ] );
125 125
 	                    foreach ( $get as $key => $value ) {
126 126
 							if ( is_array( $value ) ) {
127 127
 								foreach ( $value as $_key => $_value ) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		}
161 161
 
162 162
 		// Already overridden
163
-		if ( (int) $page_size === (int) $view->settings->get( 'page_size' ) ) {
163
+		if ( (int)$page_size === (int)$view->settings->get( 'page_size' ) ) {
164 164
 			return;
165 165
 		}
166 166
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			'view' => $view,
169 169
 		) );
170 170
 
171
-		if ( ! in_array( (int) $page_size, wp_list_pluck( self::get_page_sizes( $context ), 'value' ), true ) ) {
171
+		if ( ! in_array( (int)$page_size, wp_list_pluck( self::get_page_sizes( $context ), 'value' ), true ) ) {
172 172
 			gravityview()->log->warning( 'The passed page size is not allowed: {page_size}. Not modifying result.', array( 'page_size' => $page_size ) );
173 173
 			return;
174 174
 		}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-excerpt.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@
 block discarded – undo
24 24
 
25 25
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
26 26
 
27
-		unset( $field_options['show_as_link'] );
27
+		unset( $field_options[ 'show_as_link' ] );
28 28
 
29
-		if( 'edit' === $context ) {
29
+		if ( 'edit' === $context ) {
30 30
 			return $field_options;
31 31
 		}
32 32
 
33
-		$this->add_field_support('dynamic_data', $field_options );
33
+		$this->add_field_support( 'dynamic_data', $field_options );
34 34
 
35 35
 		return $field_options;
36 36
 	}
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
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
 
29 29
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
30 30
 
31
-		if( 'edit' === $context ) {
31
+		if ( 'edit' === $context ) {
32 32
 			return $field_options;
33 33
 		}
34 34
 
35
-		$this->add_field_support('link_to_post', $field_options );
35
+		$this->add_field_support( 'link_to_post', $field_options );
36 36
 
37
-		$this->add_field_support('dynamic_data', $field_options );
37
+		$this->add_field_support( 'dynamic_data', $field_options );
38 38
 
39 39
 		return $field_options;
40 40
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-date-created.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 
36 36
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
37 37
 
38
-		if( 'edit' === $context ) {
38
+		if ( 'edit' === $context ) {
39 39
 			return $field_options;
40 40
 		}
41 41
 
42
-		$this->add_field_support('date_display', $field_options );
42
+		$this->add_field_support( 'date_display', $field_options );
43 43
 
44 44
 		return $field_options;
45 45
 	}
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 	public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) {
62 62
 
63 63
 		/** Overridden by a template. */
64
-		if( ! empty( $field['field_path'] ) ) { return $output; }
64
+		if ( ! empty( $field[ 'field_path' ] ) ) { return $output; }
65 65
 
66
-		return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
66
+		return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
67 67
 	}
68 68
 
69 69
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return string Original text if {date_created} isn't found. Otherwise, replaced text.
83 83
 	 */
84
-	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
84
+	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
85 85
 
86 86
 		$return = $text;
87 87
 
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
 		foreach ( $matches as $match ) {
92 92
 
93
-			$full_tag          = $match[0];
94
-			$property          = $match[1];
93
+			$full_tag          = $match[ 0 ];
94
+			$property          = $match[ 1 ];
95 95
 
96 96
 			$formatted_date = GravityView_Merge_Tags::format_date( $date_created, $property );
97 97
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-section.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
 
42 42
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
43 43
 
44
-		unset ( $field_options['search_filter'], $field_options['show_as_link'] );
44
+		unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] );
45 45
 
46 46
 		// Set the default CSS class to gv-section, which applies a border and top/bottom margin
47
-		$field_options['custom_class']['value'] = 'gv-section';
47
+		$field_options[ 'custom_class' ][ 'value' ] = 'gv-section';
48 48
 
49 49
 		return $field_options;
50 50
 	}
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
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
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-post-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
33 33
 
34
-		$this->add_field_support('link_to_post', $field_options );
34
+		$this->add_field_support( 'link_to_post', $field_options );
35 35
 
36 36
 		return $field_options;
37 37
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-email.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@
 block discarded – undo
28 28
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
29 29
 
30 30
 		// It makes no sense to use this as the link.
31
-		unset( $field_options['show_as_link'] );
31
+		unset( $field_options[ 'show_as_link' ] );
32 32
 
33
-		if( 'edit' === $context ) {
33
+		if ( 'edit' === $context ) {
34 34
 			return $field_options;
35 35
 		}
36 36
 
Please login to merge, or discard this patch.