Completed
Pull Request — master (#822)
by Zack
23:55 queued 20:40
created
includes/extensions/edit-entry/class-edit-entry-admin.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     function load() {
26 26
 
27
-        if( !is_admin() ) {
27
+        if ( ! is_admin() ) {
28 28
             return;
29 29
         }
30 30
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         add_filter( 'gravityview_template_edit_link_options', array( $this, 'edit_link_field_options' ), 10, 5 );
39 39
 
40 40
         // add tooltips
41
-        add_filter( 'gravityview_tooltips', array( $this, 'tooltips') );
41
+        add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) );
42 42
 
43 43
         // custom fields' options for zone EDIT
44 44
         add_filter( 'gravityview_template_field_options', array( $this, 'field_options' ), 10, 5 );
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
      */
53 53
     function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) {
54 54
 
55
-        if( $zone !== 'edit' ) {
55
+        if ( $zone !== 'edit' ) {
56 56
 
57
-            $entry_default_fields['edit_link'] = array(
58
-                'label' => __('Edit Entry', 'gravityview'),
57
+            $entry_default_fields[ 'edit_link' ] = array(
58
+                'label' => __( 'Edit Entry', 'gravityview' ),
59 59
                 'type' => 'edit_link',
60
-                'desc'	=> __('A link to edit the entry. Visible based on View settings.', 'gravityview'),
60
+                'desc'	=> __( 'A link to edit the entry. Visible based on View settings.', 'gravityview' ),
61 61
             );
62 62
 
63 63
         }
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
         $caps = $visibility_caps;
82 82
 
83 83
         // If we're configuring fields in the edit context, we want a limited selection
84
-        if( $context === 'edit' ) {
84
+        if ( $context === 'edit' ) {
85 85
 
86 86
             // Remove other built-in caps.
87
-            unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] );
87
+            unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] );
88 88
 
89
-            $caps['read'] = _x('Entry Creator','User capability', 'gravityview');
89
+            $caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' );
90 90
         }
91 91
 
92 92
         return $caps;
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
     function edit_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
105 105
 
106 106
         // Always a link, never a filter
107
-        unset( $field_options['show_as_link'], $field_options['search_filter'] );
107
+        unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] );
108 108
 
109 109
         // Edit Entry link should only appear to visitors capable of editing entries
110
-        unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
110
+        unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
111 111
 
112
-        $add_option['edit_link'] = array(
112
+        $add_option[ 'edit_link' ] = array(
113 113
             'type' => 'text',
114 114
             'label' => __( 'Edit Link Text', 'gravityview' ),
115 115
             'desc' => NULL,
116
-            'value' => __('Edit Entry', 'gravityview'),
116
+            'value' => __( 'Edit Entry', 'gravityview' ),
117 117
             'merge_tags' => true,
118 118
         );
119 119
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
         $return = $tooltips;
131 131
 
132
-        $return['allow_edit_cap'] = array(
133
-            'title' => __('Limiting Edit Access', 'gravityview'),
134
-            'value' => __('Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview'),
132
+        $return[ 'allow_edit_cap' ] = array(
133
+            'title' => __( 'Limiting Edit Access', 'gravityview' ),
134
+            'value' => __( 'Change this setting if you don\'t want the user who created the entry to be able to edit this field.', 'gravityview' ),
135 135
         );
136 136
 
137 137
         return $return;
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
     function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
150 150
 
151 151
         // We only want to modify the settings for the edit context
152
-        if( 'edit' !== $context ) {
152
+        if ( 'edit' !== $context ) {
153 153
 
154 154
             /**
155 155
              * @since 1.8.4
156 156
              */
157
-            $field_options['new_window'] = array(
157
+            $field_options[ 'new_window' ] = array(
158 158
                 'type' => 'checkbox',
159 159
                 'label' => __( 'Open link in a new tab or window?', 'gravityview' ),
160 160
                 'value' => false,
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         }
165 165
 
166 166
         //  Entry field is only for logged in users
167
-        unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
167
+        unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
168 168
 
169 169
         $add_options = array(
170 170
             'allow_edit_cap' => array(
Please login to merge, or discard this patch.
includes/extensions/edit-entry/partials/inline-javascript.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
 ?><script type="text/javascript">
7 7
 
8 8
 	function DeleteFile(leadId, fieldId, deleteButton){
9
-		if(confirm('<?php echo esc_js( __("Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview') ); ?>')){
9
+		if(confirm('<?php echo esc_js( __( "Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview' ) ); ?>')){
10 10
 			var fileIndex = jQuery(deleteButton).parent().index();
11
-			var mysack = new sack("<?php echo admin_url("admin-ajax.php")?>");
11
+			var mysack = new sack("<?php echo admin_url( "admin-ajax.php" )?>");
12 12
 			mysack.execute = 1;
13 13
 			mysack.method = 'POST';
14 14
 			mysack.setVar( "action", "rg_delete_file" );
15
-			mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce("rg_delete_file") ?>" );
15
+			mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce( "rg_delete_file" ) ?>" );
16 16
 			mysack.setVar( "lead_id", leadId );
17 17
 			mysack.setVar( "field_id", fieldId );
18 18
 			mysack.setVar( "file_index", fileIndex );
19
-			mysack.onError = function() { alert('<?php echo esc_js(__('Ajax error while deleting field.', 'gravityview')) ?>' )};
19
+			mysack.onError = function() { alert('<?php echo esc_js( __( 'Ajax error while deleting field.', 'gravityview' ) ) ?>' )};
20 20
 			mysack.runAJAX();
21 21
 
22 22
 			return true;
Please login to merge, or discard this patch.
includes/extensions/edit-entry/fields/edit_link.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 extract( $gravityview_view->getCurrentField() );
8 8
 
9 9
 // Only show the link to logged-in users.
10
-if( !GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) {
10
+if ( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) {
11 11
 	return;
12 12
 }
13 13
 
14
-$link_text = empty( $field_settings['edit_link'] ) ? __('Edit Entry', 'gravityview') : $field_settings['edit_link'];
14
+$link_text = empty( $field_settings[ 'edit_link' ] ) ? __( 'Edit Entry', 'gravityview' ) : $field_settings[ 'edit_link' ];
15 15
 
16
-$link_atts = empty( $field_settings['new_window'] ) ? '' : 'target="_blank"';
16
+$link_atts = empty( $field_settings[ 'new_window' ] ) ? '' : 'target="_blank"';
17 17
 
18 18
 $output = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) );
19 19
 
Please login to merge, or discard this patch.
includes/extensions/delete-entry/fields/delete_link.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 extract( $gravityview_view->getCurrentField() );
8 8
 
9 9
 // Only show the link to logged-in users with the rigth caps.
10
-if( !GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) {
10
+if ( ! GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) {
11 11
 	return;
12 12
 }
13 13
 
14
-$link_text = empty( $field_settings['delete_link'] ) ? __('Delete Entry', 'gravityview') : $field_settings['delete_link'];
14
+$link_text = empty( $field_settings[ 'delete_link' ] ) ? __( 'Delete Entry', 'gravityview' ) : $field_settings[ 'delete_link' ];
15 15
 
16 16
 $link_text = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) );
17 17
 
Please login to merge, or discard this patch.
includes/class-gravityview-admin-duplicate-view.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 	function __construct() {
16 16
 
17 17
 		// Only run on Admin
18
-		if ( !is_admin() ) {
18
+		if ( ! is_admin() ) {
19 19
 			return;
20 20
 		}
21 21
 
22 22
 		// If the Duplicate Post plugin is active, don't run.
23
-		if( defined('DUPLICATE_POST_CURRENT_VERSION') ) {
23
+		if ( defined( 'DUPLICATE_POST_CURRENT_VERSION' ) ) {
24 24
 			return;
25 25
 		}
26 26
 
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 		global $post;
61 61
 
62 62
 		// We only want to add Clone links to the Edit View metabox
63
-		if( !$this->is_all_views_page() ) {
63
+		if ( ! $this->is_all_views_page() ) {
64 64
 
65
-			if( $duplicate_links = $this->make_duplicate_link_row( array(), $post ) ) {
66
-				$links[] = '<span>' . $duplicate_links['edit_as_new_draft'] . '</span>';
65
+			if ( $duplicate_links = $this->make_duplicate_link_row( array(), $post ) ) {
66
+				$links[ ] = '<span>' . $duplicate_links[ 'edit_as_new_draft' ] . '</span>';
67 67
 			}
68 68
 
69 69
 		}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		 * @param string|null If string, the status to set for the new View. If empty, use existing View status.
120 120
 		 * @param WP_Post $post View being cloned
121 121
 		 */
122
-		$new_view_status = apply_filters('gravityview/duplicate-view/status', $status, $post );
122
+		$new_view_status = apply_filters( 'gravityview/duplicate-view/status', $status, $post );
123 123
 
124 124
 		$new_view = array(
125 125
 			'menu_order'     => $post->menu_order,
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 		 * @param boolean $copy_date Whether the copy the date from the existing View. Default: `false`
143 143
 		 * @param WP_Post $post View being cloned
144 144
 		 */
145
-		$copy_date = apply_filters('gravityview/duplicate-view/copy-date', false, $post );
145
+		$copy_date = apply_filters( 'gravityview/duplicate-view/copy-date', false, $post );
146 146
 
147 147
 		if ( $copy_date ) {
148
-			$new_view['post_date']     = $new_post_date = $post->post_date;
149
-			$new_view['post_date_gmt'] = get_gmt_from_date( $new_post_date );
148
+			$new_view[ 'post_date' ]     = $new_post_date = $post->post_date;
149
+			$new_view[ 'post_date_gmt' ] = get_gmt_from_date( $new_post_date );
150 150
 		}
151 151
 
152 152
 		/**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		 * @param array $new_view Array of settings to be passed to wp_insert_post()
156 156
 		 * @param WP_Post $post View being cloned
157 157
 		 */
158
-		$new_view = apply_filters('gravityview/duplicate-view/new-view', $new_view, $post );
158
+		$new_view = apply_filters( 'gravityview/duplicate-view/new-view', $new_view, $post );
159 159
 
160 160
 		// Magic happens here.
161 161
 		$new_view_id = wp_insert_post( $new_view );
@@ -237,13 +237,13 @@  discard block
 block discarded – undo
237 237
 			$clone_text = __( 'Clone', 'gravityview' );
238 238
 			$clone_title = __( 'Clone this View', 'gravityview' );
239 239
 
240
-			$actions['clone'] = gravityview_get_link( $clone_link, $clone_text, 'title='.$clone_title );
240
+			$actions[ 'clone' ] = gravityview_get_link( $clone_link, $clone_text, 'title=' . $clone_title );
241 241
 
242 242
 			$clone_draft_link = $this->get_clone_view_link( $post->ID );
243 243
 			$clone_draft_text = $this->is_all_views_page() ? __( 'New Draft', 'gravityview' ) : __( 'Clone View', 'gravityview' );
244 244
 			$clone_draft_title = __( 'Copy as a new draft View', 'gravityview' );
245 245
 
246
-			$actions['edit_as_new_draft'] = gravityview_get_link( $clone_draft_link, esc_html( $clone_draft_text ), 'title='.$clone_draft_title );
246
+			$actions[ 'edit_as_new_draft' ] = gravityview_get_link( $clone_draft_link, esc_html( $clone_draft_text ), 'title=' . $clone_draft_title );
247 247
 		}
248 248
 
249 249
 		return $actions;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		}
268 268
 
269 269
 		// Verify the View exists
270
-		if ( !$view = get_post( $id ) ) {
270
+		if ( ! $view = get_post( $id ) ) {
271 271
 			return '';
272 272
 		}
273 273
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		$post_type_object = get_post_type_object( $view->post_type );
283 283
 
284 284
 		/** If there's no gravityview post type for some reason, abort! */
285
-		if ( !$post_type_object ) {
285
+		if ( ! $post_type_object ) {
286 286
 			do_action( 'gravityview_log_error', __METHOD__ . ' No gravityview post type exists when trying to clone the View.', $view );
287 287
 			return '';
288 288
 		}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		 * @param int $view_id View ID
295 295
 		 * @param string $context How to display the link. If "display", the URL is run through esc_html(). Default: `display`
296 296
 		 */
297
-		$clone_view_link = apply_filters( 'gravityview/duplicate-view/get_clone_view_link', admin_url( "admin.php". $action ), $view->ID, $context );
297
+		$clone_view_link = apply_filters( 'gravityview/duplicate-view/get_clone_view_link', admin_url( "admin.php" . $action ), $view->ID, $context );
298 298
 
299 299
 		return $clone_view_link;
300 300
 	}
@@ -321,14 +321,14 @@  discard block
 block discarded – undo
321 321
 	 */
322 322
 	public function save_as_new_view( $status = '' ) {
323 323
 
324
-		if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) ) ) {
324
+		if ( ! ( isset( $_GET[ 'post' ] ) || isset( $_POST[ 'post' ] ) ) ) {
325 325
 			wp_die( __( 'No post to duplicate has been supplied!', 'gravityview' ) );
326 326
 		}
327 327
 
328 328
 		// Get the original post
329
-		$id   = ( isset( $_GET['post'] ) ? $_GET['post'] : $_POST['post'] );
329
+		$id = ( isset( $_GET[ 'post' ] ) ? $_GET[ 'post' ] : $_POST[ 'post' ] );
330 330
 
331
-		if( ! $this->current_user_can_copy( $id ) ) {
331
+		if ( ! $this->current_user_can_copy( $id ) ) {
332 332
 			wp_die( __( 'You don\'t have permission to copy this View.', 'gravityview' ) );
333 333
 		}
334 334
 
Please login to merge, or discard this patch.
includes/class-admin-welcome.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	 * @since 1.0
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_action( 'admin_menu', array( $this, 'admin_menus'), 200 );
37
+		add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 );
38 38
 		add_action( 'admin_head', array( $this, 'admin_head' ) );
39
-		add_action( 'admin_init', array( $this, 'welcome'    ) );
40
-		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 );
39
+		add_action( 'admin_init', array( $this, 'welcome' ) );
40
+		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 );
41 41
 	}
42 42
 
43 43
 	/**
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 		// Add help page to GravityView menu
54 54
 		add_submenu_page(
55 55
 			'edit.php?post_type=gravityview',
56
-			__('GravityView: Getting Started', 'gravityview'),
57
-			__('Getting Started', 'gravityview'),
56
+			__( 'GravityView: Getting Started', 'gravityview' ),
57
+			__( 'Getting Started', 'gravityview' ),
58 58
 			$this->minimum_capability,
59 59
 			'gv-getting-started',
60 60
 			array( $this, 'getting_started_screen' )
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return boolean  $is_page   True: yep; false: nope
89 89
 	 */
90
-	public function is_dashboard_page($is_page = false, $hook = NULL) {
90
+	public function is_dashboard_page( $is_page = false, $hook = NULL ) {
91 91
 		global $plugin_page;
92 92
 
93
-		if($is_page) { return $is_page; }
93
+		if ( $is_page ) { return $is_page; }
94 94
 
95 95
 		return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) );
96 96
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' );
109 109
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' );
110 110
 
111
-		if( !$this->is_dashboard_page() ) { return; }
111
+		if ( ! $this->is_dashboard_page() ) { return; }
112 112
 
113 113
 		?>
114 114
 		<style type="text/css" media="screen">
@@ -141,20 +141,20 @@  discard block
 block discarded – undo
141 141
 		// Don't fetch -beta, etc.
142 142
 		list( $display_version ) = explode( '-', GravityView_Plugin::version );
143 143
 
144
-		$selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
144
+		$selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
145 145
 		?>
146 146
 
147 147
 		<h1><img class="alignleft" src="<?php echo plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ); ?>" width="100" height="132" /><?php printf( esc_html__( 'Welcome to GravityView %s', 'gravityview' ), $display_version ); ?></h1>
148 148
 		<div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div>
149 149
 
150 150
 		<h2 class="nav-tab-wrapper clear">
151
-			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
151
+			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
152 152
 				<?php _e( "Getting Started", 'gravityview' ); ?>
153 153
 			</a>
154
-			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
154
+			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
155 155
 				<?php _e( "List of Changes", 'gravityview' ); ?>
156 156
 			</a>
157
-			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
157
+			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
158 158
 				<?php _e( 'Credits', 'gravityview' ); ?>
159 159
 			</a>
160 160
 		</h2>
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 					<h2>Create a View</h2>
191 191
 
192 192
 					<ol class="ol-decimal">
193
-						<li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views &gt; New View</a></li>
193
+						<li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views &gt; New View</a></li>
194 194
 						<li>If you want to <strong>create a new form</strong>, click the "Start Fresh" button</li>
195 195
 						<li>If you want to <strong>use an existing form&rsquo;s entries</strong>, select from the dropdown.</li>
196 196
 						<li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>.
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 					</ul>
526 526
 
527 527
 					<h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4>
528
-					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
528
+					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
529 529
 				</div>
530 530
 			</div>
531 531
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		global $plugin_page;
566 566
 
567 567
 		// Bail if we're just editing the plugin
568
-		if( $plugin_page === 'plugin-editor.php' ) { return; }
568
+		if ( $plugin_page === 'plugin-editor.php' ) { return; }
569 569
 
570 570
 		// Bail if no activation redirect
571 571
 		if ( ! get_transient( '_gv_activation_redirect' ) ) { return; }
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 		$upgrade = get_option( 'gv_version_upgraded_from' );
577 577
 
578 578
 		// Don't do anything if they've already seen the new version info
579
-		if( $upgrade === GravityView_Plugin::version ) {
579
+		if ( $upgrade === GravityView_Plugin::version ) {
580 580
 			return;
581 581
 		}
582 582
 
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
 		update_option( 'gv_version_upgraded_from', GravityView_Plugin::version );
585 585
 
586 586
 		// Bail if activating from network, or bulk
587
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
587
+		if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; }
588 588
 
589 589
 		// First time install
590
-		if( ! $upgrade ) {
590
+		if ( ! $upgrade ) {
591 591
 			wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit;
592 592
 		}
593 593
 		// Update
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget.php 1 patch
Spacing   +27 added lines, -27 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
 
@@ -176,28 +176,28 @@  discard block
 block discarded – undo
176 176
 	function add_shortcode( $run_on_singular = true ) {
177 177
 		global $post;
178 178
 
179
-		if( GravityView_Plugin::is_admin() ) { return; }
179
+		if ( GravityView_Plugin::is_admin() ) { return; }
180 180
 
181
-		if( empty( $this->shortcode_name ) ) { return; }
181
+		if ( empty( $this->shortcode_name ) ) { return; }
182 182
 
183 183
 		// If the widget shouldn't output on single entries, don't show it
184
-		if( empty( $this->show_on_single ) && class_exists('GravityView_frontend') && GravityView_frontend::is_single_entry() ) {
185
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class($this)) );
184
+		if ( empty( $this->show_on_single ) && class_exists( 'GravityView_frontend' ) && GravityView_frontend::is_single_entry() ) {
185
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class( $this ) ) );
186 186
 
187 187
 			add_shortcode( $this->shortcode_name, '__return_null' );
188 188
 			return;
189 189
 		}
190 190
 
191 191
 
192
-		if( !has_gravityview_shortcode( $post ) ) {
192
+		if ( ! has_gravityview_shortcode( $post ) ) {
193 193
 
194
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class($this)) );
194
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class( $this ) ) );
195 195
 
196 196
 			add_shortcode( $this->shortcode_name, '__return_null' );
197 197
 			return;
198 198
 		}
199 199
 
200
-		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') );
200
+		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) );
201 201
 	}
202 202
 
203 203
 	/**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	function register_widget( $widgets ) {
209 209
 		$widgets[ $this->widget_id ] = array(
210
-			'label' => $this->widget_label ,
210
+			'label' => $this->widget_label,
211 211
 			'description' => $this->widget_description,
212 212
 			'subtitle' => $this->widget_subtitle,
213 213
 		);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function assign_widget_options( $options = array(), $template = '', $widget = '' ) {
226 226
 
227
-		if( $this->widget_id === $widget ) {
227
+		if ( $this->widget_id === $widget ) {
228 228
 			$options = array_merge( $options, $this->settings );
229 229
 		}
230 230
 
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
 	 *
238 238
 	 * @return void
239 239
 	 */
240
-	public function render_frontend( $widget_args, $content = '', $context = '') {
240
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
241 241
 		// to be defined by child class
242
-		if( !$this->pre_render_frontend() ) {
242
+		if ( ! $this->pre_render_frontend() ) {
243 243
 			return;
244 244
 		}
245 245
 	}
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
 	public function pre_render_frontend() {
252 252
 		$gravityview_view = GravityView_View::getInstance();
253 253
 
254
-		if( empty( $gravityview_view ) ) {
255
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class($this)) );
254
+		if ( empty( $gravityview_view ) ) {
255
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class( $this ) ) );
256 256
 			return false;
257 257
 		}
258 258
 
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
 		 */
264 264
 		$hide_until_search = apply_filters( 'gravityview/widget/hide_until_searched', $gravityview_view->hide_until_searched, $this );
265 265
 
266
-		if( $hide_until_search ) {
267
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class($this)) );
266
+		if ( $hide_until_search ) {
267
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class( $this ) ) );
268 268
 			return false;
269 269
 		}
270 270
 
Please login to merge, or discard this patch.
includes/widgets/register-gravityview-widgets.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,15 +20,15 @@
 block discarded – undo
20 20
  */
21 21
 function gravityview_register_gravityview_widgets() {
22 22
 
23
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
23
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
24 24
 
25
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' );
26
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' );
27
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' );
28
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' );
25
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-pagination-info.php' );
26
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-links.php' );
27
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' );
28
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' );
29 29
 
30
-	if( class_exists('GFPolls') ) {
31
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' );
30
+	if ( class_exists( 'GFPolls' ) ) {
31
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' );
32 32
 	}
33 33
 
34 34
 }
Please login to merge, or discard this patch.
includes/widgets/poll/class-gravityview-widget-poll.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	function __construct() {
23 23
 
24
-		$this->widget_description = __('Displays the results of Poll Fields that exist in the form.', 'gravityview' );
24
+		$this->widget_description = __( 'Displays the results of Poll Fields that exist in the form.', 'gravityview' );
25 25
 
26
-		$this->widget_subtitle = sprintf( _x('Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' );
26
+		$this->widget_subtitle = sprintf( _x( 'Note: this will display poll results for %sall form entries%s, not only the entries displayed in the View.', 'The string placeholders are for emphasis HTML', 'gravityview' ), '<em>', '</em>' );
27 27
 
28 28
 		$default_values = array(
29 29
 			'header' => 1,
@@ -32,32 +32,32 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$settings = array(
34 34
 			'percentages' => array(
35
-				'label' => __('Display Percentages', 'gravityview'),
35
+				'label' => __( 'Display Percentages', 'gravityview' ),
36 36
 				'type' => 'checkbox',
37 37
 				'value' => true,
38 38
 				'tooltip' => __( 'Display results percentages as part of results? Supported values are: true, false. Defaults to "true".', 'gravityview' ),
39 39
 			),
40 40
 			'counts' => array(
41
-				'label' => __('Display Counts', 'gravityview'),
41
+				'label' => __( 'Display Counts', 'gravityview' ),
42 42
 				'type' => 'checkbox',
43 43
 				'value' => true,
44 44
 				'tooltip' => __( 'Display number of times each choice has been selected when displaying results? Supported values are: true, false. Defaults to "true".', 'gravityview' ),
45 45
 			),
46 46
 			'style' => array(
47 47
 				'type' => 'select',
48
-				'label' => __('Style', 'gravityview'),
48
+				'label' => __( 'Style', 'gravityview' ),
49 49
 				'tooltip' => __( 'The Polls Add-On currently supports 4 built in styles: red, green, orange, blue. Defaults to "green".', 'gravityview' ),
50 50
 				'value' => 'green',
51 51
 				'choices' => array(
52
-					'green' => __('Green', 'gravityview'),
53
-					'blue' => __('Blue', 'gravityview'),
54
-					'red' => __('Red', 'gravityview'),
55
-					'orange' => __('Orange', 'gravityview'),
52
+					'green' => __( 'Green', 'gravityview' ),
53
+					'blue' => __( 'Blue', 'gravityview' ),
54
+					'red' => __( 'Red', 'gravityview' ),
55
+					'orange' => __( 'Orange', 'gravityview' ),
56 56
 				)
57 57
 			)
58 58
 		);
59 59
 
60
-		parent::__construct( __( 'Poll Results', 'gravityview' ) , 'poll', $default_values, $settings );
60
+		parent::__construct( __( 'Poll Results', 'gravityview' ), 'poll', $default_values, $settings );
61 61
 
62 62
 		// frontend - add template path
63 63
 		add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 
89 89
 		$GFPolls = GFPolls::get_instance();
90 90
 
91
-		wp_enqueue_script('gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array('jquery'), $GFPolls->_version);
91
+		wp_enqueue_script( 'gpoll_js', $GFPolls->get_base_url() . '/js/gpoll.js', array( 'jquery' ), $GFPolls->_version );
92 92
 
93 93
 		$GFPolls->localize_scripts();
94 94
 
95
-		wp_enqueue_style('gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version);
95
+		wp_enqueue_style( 'gpoll_css', $GFPolls->get_base_url() . '/css/gpoll.css', null, $GFPolls->_version );
96 96
 	}
97 97
 
98 98
 	/**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function pre_render_frontend() {
104 104
 
105
-		if( !class_exists('GFPolls') ) {
105
+		if ( ! class_exists( 'GFPolls' ) ) {
106 106
 
107 107
 			$return = false;
108 108
 
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
 	 *
159 159
 	 * @since 1.8
160 160
 	 */
161
-	public function render_frontend( $widget_args, $content = '', $context = '') {
161
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
162 162
 
163
-		if( !$this->pre_render_frontend() ) {
163
+		if ( ! $this->pre_render_frontend() ) {
164 164
 			return;
165 165
 		}
166 166
 
167 167
 		// Make sure the class is loaded in DataTables
168
-		if( !class_exists( 'GFFormDisplay' ) ) {
168
+		if ( ! class_exists( 'GFFormDisplay' ) ) {
169 169
 			include_once( GFCommon::get_base_path() . '/form_display.php' );
170 170
 		}
171 171
 
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
 
174 174
 		$settings = $this->get_frontend_settings( $widget_args );
175 175
 
176
-		$percentages = empty( $settings['percentages'] ) ? 'false' : 'true';
176
+		$percentages = empty( $settings[ 'percentages' ] ) ? 'false' : 'true';
177 177
 
178
-		$counts = empty( $settings['counts'] ) ? 'false' : 'true';
178
+		$counts = empty( $settings[ 'counts' ] ) ? 'false' : 'true';
179 179
 
180
-		if( !empty( $settings['field'] ) ) {
181
-			$merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings['field'], $settings['style'], $percentages, $counts );
180
+		if ( ! empty( $settings[ 'field' ] ) ) {
181
+			$merge_tag = sprintf( '{gpoll: field="%d" style="%s" percentages="%s" counts="%s"}', $settings[ 'field' ], $settings[ 'style' ], $percentages, $counts );
182 182
 		} else {
183
-			$merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings['style'], $percentages, $counts );
183
+			$merge_tag = sprintf( '{all_poll_results: style="%s" percentages="%s" counts="%s"}', $settings[ 'style' ], $percentages, $counts );
184 184
 		}
185 185
 
186 186
 		$gravityview_view = GravityView_View::getInstance();
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 		$gravityview_view->poll_settings = $settings;
191 191
 
192
-		$gravityview_view->render('widget', 'poll', false );
192
+		$gravityview_view->render( 'widget', 'poll', false );
193 193
 
194 194
 	}
195 195
 
Please login to merge, or discard this patch.