Completed
Pull Request — develop (#1656)
by
unknown
17:57
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()->request->is_admin( '', '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.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-yoast-seo.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 		parent::add_hooks();
69 69
 
70
-		if( gravityview()->request->is_admin( '', null ) ) {
70
+		if ( gravityview()->request->is_admin( '', null ) ) {
71 71
 
72 72
 				// Make Yoast metabox go down to the bottom please.
73 73
 			add_filter( 'wpseo_metabox_prio', array( $this, 'return_low' ) );
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	public function disable_content_analysis( $options ) {
94 94
 
95
-		$options['keyword_analysis_active'] = false;
96
-		$options['content_analysis_active'] = false;
95
+		$options[ 'keyword_analysis_active' ] = false;
96
+		$options[ 'content_analysis_active' ] = false;
97 97
 
98 98
 		return $options;
99 99
 	}
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 		global $pagenow;
113 113
 
114 114
 		// New View page
115
-		if( $pagenow === 'post-new.php' ) {
116
-			$options['hideeditbox-gravityview'] = true;
115
+		if ( $pagenow === 'post-new.php' ) {
116
+			$options[ 'hideeditbox-gravityview' ] = true;
117 117
 		}
118 118
 
119 119
 		return $options;
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-no-conflict.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		if( ! is_admin() ) { return; }
21
+		if ( ! is_admin() ) { return; }
22 22
 		
23 23
 		$this->add_hooks();
24 24
 	}
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	private function add_hooks() {
34 34
 		//Hooks for no-conflict functionality
35
-		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000);
36
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9);
35
+		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 );
36
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 );
37 37
 
38
-		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000);
39
-		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11);
40
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1);
41
-		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1);
38
+		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 );
39
+		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 );
40
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 );
41
+		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 );
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function no_conflict_scripts() {
52 52
 		global $wp_scripts;
53 53
 
54
-		if( ! gravityview()->request->is_admin( '', null ) ) {
54
+		if ( ! gravityview()->request->is_admin( '', null ) ) {
55 55
 			return;
56 56
 		}
57 57
 
58 58
 		$no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' );
59 59
 
60
-		if( empty( $no_conflict_mode ) ) {
60
+		if ( empty( $no_conflict_mode ) ) {
61 61
 			return;
62 62
 		}
63 63
 
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
 	function no_conflict_styles() {
111 111
 		global $wp_styles;
112 112
 
113
-		if( ! gravityview()->request->is_admin( '', null ) ) {
113
+		if ( ! gravityview()->request->is_admin( '', null ) ) {
114 114
 			return;
115 115
 		}
116 116
 
117 117
 		// Dequeue other jQuery styles even if no-conflict is off.
118 118
 		// Terrible-looking tabs help no one.
119
-		if( !empty( $wp_styles->registered ) )  {
120
-			foreach ($wp_styles->registered as $key => $style) {
121
-				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
119
+		if ( ! empty( $wp_styles->registered ) ) {
120
+			foreach ( $wp_styles->registered as $key => $style ) {
121
+				if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
123 123
 				}
124 124
 			}
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' );
128 128
 
129 129
 		// If no conflict is off, jQuery will suffice.
130
-		if( empty( $no_conflict_mode ) ) {
130
+		if ( empty( $no_conflict_mode ) ) {
131 131
 			return;
132 132
 		}
133 133
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		/**
155 155
 		 * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here.
156 156
 		 */
157
-		do_action('gravityview_remove_conflicts_after');
157
+		do_action( 'gravityview_remove_conflicts_after' );
158 158
 	}
159 159
 
160 160
 	/**
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
 		//reset queue
180 180
 		$queue = array();
181
-		foreach( $wp_objects->queue as $object ) {
182
-			if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) {
183
-				$queue[] = $object;
181
+		foreach ( $wp_objects->queue as $object ) {
182
+			if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) {
183
+				$queue[ ] = $object;
184 184
 			}
185 185
 		}
186 186
 		$wp_objects->queue = $queue;
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 
190 190
 		//unregistering scripts
191 191
 		$registered = array();
192
-		foreach( $wp_objects->registered as $handle => $script_registration ){
193
-			if( in_array( $handle, $required_objects ) ){
192
+		foreach ( $wp_objects->registered as $handle => $script_registration ) {
193
+			if ( in_array( $handle, $required_objects ) ) {
194 194
 				$registered[ $handle ] = $script_registration;
195 195
 			}
196 196
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @param array $registered [description]
206 206
 	 * @param array $scripts    [description]
207 207
 	 */
208
-	private function add_script_dependencies($registered, $scripts) {
208
+	private function add_script_dependencies( $registered, $scripts ) {
209 209
 
210 210
 		//gets all dependent scripts linked to the $scripts array passed
211 211
 		do {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
215 215
 				foreach ( $deps as $dep ) {
216 216
 					if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
217
-						$dependents[] = $dep;
217
+						$dependents[ ] = $dep;
218 218
 					}
219 219
 				}
220 220
 			}
Please login to merge, or discard this patch.
future/includes/class-gv-request-admin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		 */
39 39
 		$is_page = false;
40 40
 
41
-		if( function_exists( '\get_current_screen' ) || function_exists( 'get_current_screen' ) ) {
41
+		if ( function_exists( '\get_current_screen' ) || function_exists( 'get_current_screen' ) ) {
42 42
 			$current_screen = \get_current_screen();
43 43
 		} else {
44 44
 			$current_screen = false;
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 				$is_page = 'single';
52 52
 			} elseif ( $is_gv_settings = 'gravityview_page_gravityview_settings' === $current_screen->id ) {
53 53
 				$is_page = 'settings';
54
-			} elseif( $is_extensions = 'gravityview_page_gv-admin-installer' === $current_screen->id ) {
54
+			} elseif ( $is_extensions = 'gravityview_page_gv-admin-installer' === $current_screen->id ) {
55 55
 				$is_page = 'downloads';
56
-			} elseif( $is_changelog = 'gravityview_page_gv-changelog' === $current_screen->id ) {
56
+			} elseif ( $is_changelog = 'gravityview_page_gv-changelog' === $current_screen->id ) {
57 57
 				$is_page = 'changelog';
58
-			} elseif( $is_getting_started = 'gravityview_page_gv-getting-started' === $current_screen->id ) {
58
+			} elseif ( $is_getting_started = 'gravityview_page_gv-getting-started' === $current_screen->id ) {
59 59
 				$is_page = 'getting-started';
60
-			} elseif( $is_credits = 'gravityview_page_gv-credits' === $current_screen->id ) {
60
+			} elseif ( $is_credits = 'gravityview_page_gv-credits' === $current_screen->id ) {
61 61
 				$is_page = 'credits';
62 62
 			}
63 63
 		}
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-directory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
 		$KWS_GF_Change_Lead_Creator = new KWS_GF_Change_Lead_Creator;
30 30
 
31 31
 		// Now, no validation is required in the methods; let's hook in.
32
-		remove_action('admin_init', array( $KWS_GF_Change_Lead_Creator, 'set_screen_mode' ) );
32
+		remove_action( 'admin_init', array( $KWS_GF_Change_Lead_Creator, 'set_screen_mode' ) );
33 33
 
34
-		remove_action("gform_entry_info", array( $KWS_GF_Change_Lead_Creator, 'add_select' ), 10 );
34
+		remove_action( "gform_entry_info", array( $KWS_GF_Change_Lead_Creator, 'add_select' ), 10 );
35 35
 
36
-		remove_action("gform_after_update_entry", array( $KWS_GF_Change_Lead_Creator, 'update_entry_creator' ), 10 );
36
+		remove_action( "gform_after_update_entry", array( $KWS_GF_Change_Lead_Creator, 'update_entry_creator' ), 10 );
37 37
 
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
includes/class-gravityview-gfformsmodel.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
 	public static function is_value_match( $field_value, $target_value, $operation = 'is', $source_field = null, $rule = null, $form = null ) {
41 41
 
42 42
 		if ( in_array( $source_field, array( 'date_created', 'date_updated', 'payment_date' ), true ) ) {
43
-			$field_value = is_int( $field_value )? $field_value : strtotime( $field_value );
44
-			$target_value = is_int( $target_value )? $target_value : strtotime( $target_value );
43
+			$field_value = is_int( $field_value ) ? $field_value : strtotime( $field_value );
44
+			$target_value = is_int( $target_value ) ? $target_value : strtotime( $target_value );
45 45
 		}
46 46
 
47 47
 		if ( $source_field instanceof GF_Field && $source_field->type == 'date' ) {
48
-			$field_value = is_int( $field_value )? $field_value : strtotime( $field_value );
49
-			$target_value = is_int( $target_value )? $target_value : strtotime( $target_value );
48
+			$field_value = is_int( $field_value ) ? $field_value : strtotime( $field_value );
49
+			$target_value = is_int( $target_value ) ? $target_value : strtotime( $target_value );
50 50
 		}
51 51
 
52 52
 		if ( in_array( $_operation = str_replace( ' ', '_', trim( $operation ) ), array( 'in', 'not_in' ) ) ) {
53
-			return GVCommon::matches_operation( (array) $field_value, (array) $target_value, $_operation );
53
+			return GVCommon::matches_operation( (array)$field_value, (array)$target_value, $_operation );
54 54
 		}
55 55
 
56 56
 		return parent::is_value_match( $field_value, $target_value, $operation, $source_field, $rule, $form );
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
 
75 75
         $post_data = self::get_post_fields( $form, $entry );
76 76
 
77
-        $media = get_attached_media( 'image', $entry['post_id'] );
77
+        $media = get_attached_media( 'image', $entry[ 'post_id' ] );
78 78
 
79 79
         $post_images = array();
80 80
 
81 81
         foreach ( $media as $media_item ) {
82
-            foreach( (array) $post_data['images'] as $post_data_item ) {
83
-                if(
82
+            foreach ( (array)$post_data[ 'images' ] as $post_data_item ) {
83
+                if (
84 84
                     \GV\Utils::get( $post_data_item, 'title' ) === $media_item->post_title &&
85 85
                     \GV\Utils::get( $post_data_item, 'description' ) === $media_item->post_content &&
86 86
                     \GV\Utils::get( $post_data_item, 'caption' ) === $media_item->post_excerpt
87 87
                 ) {
88
-                    $post_images["{$post_data_item['field_id']}"] = $media_item->ID;
88
+                    $post_images[ "{$post_data_item[ 'field_id' ]}" ] = $media_item->ID;
89 89
                 }
90 90
             }
91 91
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
          * If the method changes to public, use Gravity Forms' method
114 114
          * @todo: If/when the method is public, remove the unneeded copied code.
115 115
          */
116
-        if( $reflection->isPublic() ) {
116
+        if ( $reflection->isPublic() ) {
117 117
             return parent::get_post_fields( $form, $entry );
118 118
         }
119 119
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
          * If the method changes to public, use Gravity Forms' method
141 141
          * @todo: If/when the method is public, remove the unneeded copied code.
142 142
          */
143
-        if( $reflection->isPublic() ) {
143
+        if ( $reflection->isPublic() ) {
144 144
             return parent::copy_post_image( $url, $post_id );
145 145
         }
146 146
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
          * If the method changes to public, use Gravity Forms' method
176 176
          * @todo: If/when the method is public, remove the unneeded copied code.
177 177
          */
178
-        if( $reflection->isPublic() ) {
178
+        if ( $reflection->isPublic() ) {
179 179
             return parent::media_handle_upload( $url, $post_id, $post_data );
180 180
         }
181 181
 
Please login to merge, or discard this patch.
future/includes/class-gv-renderer-view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 		 * This allows us to fake it till we make it.
110 110
 		 */
111 111
 		$parameters = $view->settings->as_atts();
112
-		if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) {
112
+		if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) {
113 113
 			$has_multisort = true;
114
-			$parameters['sort_field'] = reset( $parameters['sort_field'] );
115
-			if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) {
116
-				$parameters['sort_direction'] = reset( $parameters['sort_direction'] );
114
+			$parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] );
115
+			if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) {
116
+				$parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] );
117 117
 			}
118 118
 		}
119 119
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 			'entries' => $entries,
129 129
 			'request' => $request,
130 130
 		), empty( $parameters ) ? array() : array(
131
-			'paging' => $parameters['paging'],
132
-			'sorting' => $parameters['sorting'],
131
+			'paging' => $parameters[ 'paging' ],
132
+			'sorting' => $parameters[ 'sorting' ],
133 133
 		), empty( $post ) ? array() : array(
134 134
 			'post' => $post,
135 135
 		) ) );
Please login to merge, or discard this patch.
future/includes/class-gv-renderer-entry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,16 +58,16 @@
 block discarded – undo
58 58
 		if ( $view->joins ) {
59 59
 			$form_ids = array();
60 60
 			foreach ( $view->joins as $join ) {
61
-				$form_ids[] = $join->join->ID;
62
-				$form_ids[] = $join->join_on->ID;
61
+				$form_ids[ ] = $join->join->ID;
62
+				$form_ids[ ] = $join->join_on->ID;
63 63
 			}
64 64
 			foreach ( $entry->entries as $e ) {
65
-				if ( ! in_array( $e['form_id'], $form_ids ) ) {
65
+				if ( ! in_array( $e[ 'form_id' ], $form_ids ) ) {
66 66
 					gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $e->ID, 'view_id' => $view->ID ) );
67 67
 					return null;
68 68
 				}
69 69
 			}
70
-		} else if ( $view->form && $view->form->ID != $entry['form_id'] ) {
70
+		} else if ( $view->form && $view->form->ID != $entry[ 'form_id' ] ) {
71 71
 			gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $entry->ID, 'view_id' => $view->ID ) );
72 72
 			return null;
73 73
 		}
Please login to merge, or discard this patch.
future/includes/class-gv-entry-multi.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			if ( ! $entry instanceof Entry ) {
45 45
 				continue;
46 46
 			}
47
-			$_entry->entries[ $entry['form_id'] ]  = &$entry;
47
+			$_entry->entries[ $entry[ 'form_id' ] ] = &$entry;
48 48
 		}
49 49
 		return $_entry;
50 50
 	}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
 			foreach ( $this->entries as $entry ) {
67 67
 				$entry = $entry->as_entry();
68
-				$_entry['_multi'][ $entry['form_id'] ] = $entry;
68
+				$_entry[ '_multi' ][ $entry[ 'form_id' ] ] = $entry;
69 69
 			}
70 70
 		}
71 71
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	public function get_permalink( \GV\View $view = null, \GV\Request $request = null, $track_directory = true ) {
88 88
 		$slugs = array();
89 89
 		add_filter( 'gravityview/entry/slug', $callback = function( $slug ) use ( &$slugs ) {
90
-			$slugs[] = $slug;
90
+			$slugs[ ] = $slug;
91 91
 			return implode( ',', $slugs );
92 92
 		}, 10, 1 );
93 93
 
Please login to merge, or discard this patch.