Completed
Pull Request — master (#605)
by Zack
05:45
created
templates/list-body.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
  * @action `gravityview_list_body_before` Tap in before the entry loop has been displayed
15 15
  * @param GravityView_View $this The GravityView_View instance
16 16
  */
17
-do_action( 'gravityview_list_body_before', $this );
17
+do_action('gravityview_list_body_before', $this);
18 18
 
19 19
 // There are no entries.
20
-if( ! $this->getTotalEntries() ) {
20
+if (!$this->getTotalEntries()) {
21 21
 
22 22
 	?>
23 23
 	<div class="gv-list-view gv-no-results">
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 } else {
31 31
 
32 32
 	// There are entries. Loop through them.
33
-	foreach ( $this->getEntries() as $entry ) {
33
+	foreach ($this->getEntries() as $entry) {
34 34
 
35
-		$this->setCurrentEntry( $entry );
35
+		$this->setCurrentEntry($entry);
36 36
 
37 37
 	?>
38 38
 
39
-		<div id="gv_list_<?php echo $entry['id']; ?>" class="<?php echo esc_attr( apply_filters( 'gravityview_entry_class', 'gv-list-view', $entry, $this ) ); ?>">
39
+		<div id="gv_list_<?php echo $entry['id']; ?>" class="<?php echo esc_attr(apply_filters('gravityview_entry_class', 'gv-list-view', $entry, $this)); ?>">
40 40
 
41 41
 		<?php
42 42
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		 * @param array $entry Gravity Forms Entry array
46 46
 		 * @param GravityView_View $this The GravityView_View instance
47 47
 		 */
48
-		do_action( 'gravityview_entry_before', $entry, $this );
48
+		do_action('gravityview_entry_before', $entry, $this);
49 49
 
50 50
 		?>
51 51
 
52
-		<?php if ( $this->getField('directory_list-title') || $this->getField('directory_list-subtitle') ) { ?>
52
+		<?php if ($this->getField('directory_list-title') || $this->getField('directory_list-subtitle')) { ?>
53 53
 
54 54
 			<?php
55 55
 
@@ -58,33 +58,33 @@  discard block
 block discarded – undo
58 58
 			 * @param array $entry Gravity Forms Entry array
59 59
 			 * @param GravityView_View $this The GravityView_View instance
60 60
 			 */
61
-			do_action( 'gravityview_entry_title_before', $entry, $this );
61
+			do_action('gravityview_entry_title_before', $entry, $this);
62 62
 
63 63
 			?>
64 64
 			<div class="gv-list-view-title">
65 65
 
66
-				<?php if ( $this->getField('directory_list-title') ) {
66
+				<?php if ($this->getField('directory_list-title')) {
67 67
 					$i          = 0;
68 68
 					$title_args = array(
69 69
 						'entry'      => $entry,
70 70
 						'form'       => $this->getForm(),
71
-						'hide_empty' => $this->getAtts( 'hide_empty' ),
71
+						'hide_empty' => $this->getAtts('hide_empty'),
72 72
 					);
73 73
 
74
-					foreach ( $this->getField( 'directory_list-title' ) as $field ) {
74
+					foreach ($this->getField('directory_list-title') as $field) {
75 75
 						$title_args['field'] = $field;
76 76
 
77 77
 						// The first field in the title zone is the main
78
-						if ( $i == 0 ) {
78
+						if ($i == 0) {
79 79
 							$title_args['markup'] = '<h3 id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</h3>';
80
-							echo gravityview_field_output( $title_args );
81
-							unset( $title_args['markup'] );
80
+							echo gravityview_field_output($title_args);
81
+							unset($title_args['markup']);
82 82
 						} else {
83 83
 							$title_args['wpautop'] = true;
84
-							echo gravityview_field_output( $title_args );
84
+							echo gravityview_field_output($title_args);
85 85
 						}
86 86
 
87
-						$i ++;
87
+						$i++;
88 88
 					}
89 89
 				}
90 90
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			 * @param array $entry Gravity Forms Entry array
103 103
 			 * @param GravityView_View $this The GravityView_View instance
104 104
 			 */
105
-			do_action( 'gravityview_entry_title_after', $entry, $this );
105
+			do_action('gravityview_entry_title_after', $entry, $this);
106 106
 
107 107
 			?>
108 108
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 				 * @param array $entry Gravity Forms Entry array
118 118
 				 * @param GravityView_View $this The GravityView_View instance
119 119
 				 */
120
-				do_action( 'gravityview_entry_content_before', $entry, $this );
120
+				do_action('gravityview_entry_content_before', $entry, $this);
121 121
 
122 122
 				$this->renderZone('image', 'wrapper_class="gv-grid-col-1-3 gv-list-view-content-image"');
123 123
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 				 * @param array $entry Gravity Forms Entry array
138 138
 				 * @param GravityView_View $this The GravityView_View instance
139 139
 				 */
140
-				do_action( 'gravityview_entry_content_after', $entry, $this );
140
+				do_action('gravityview_entry_content_after', $entry, $this);
141 141
 
142 142
 			?>
143 143
 
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 		<?php
147 147
 
148 148
 		// Is the footer configured?
149
-		if ( $this->getField('directory_list-footer-left') || $this->getField('directory_list-footer-right') ) {
149
+		if ($this->getField('directory_list-footer-left') || $this->getField('directory_list-footer-right')) {
150 150
 
151 151
 			/**
152 152
 			 * @action `gravityview_entry_footer_before` Tap in before the footer wrapper
153 153
 			 * @param array $entry Gravity Forms Entry array
154 154
 			 * @param GravityView_View $this The GravityView_View instance
155 155
 			 */
156
-			do_action( 'gravityview_entry_footer_before', $entry, $this );
156
+			do_action('gravityview_entry_footer_before', $entry, $this);
157 157
 
158 158
 			?>
159 159
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 			 * @param array $entry Gravity Forms Entry array
175 175
 			 * @param GravityView_View $this The GravityView_View instance
176 176
 			 */
177
-			do_action( 'gravityview_entry_footer_after', $entry, $this );
177
+			do_action('gravityview_entry_footer_after', $entry, $this);
178 178
 
179 179
 		} // End if footer is configured
180 180
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		 * @param array $entry Gravity Forms Entry array
185 185
 		 * @param GravityView_View $this The GravityView_View instance
186 186
 		 */
187
-		do_action( 'gravityview_entry_after', $entry, $this );
187
+		do_action('gravityview_entry_after', $entry, $this);
188 188
 
189 189
 		?>
190 190
 
@@ -198,4 +198,4 @@  discard block
 block discarded – undo
198 198
  * @action `gravityview_list_body_after` Tap in after the entry loop has been displayed
199 199
  * @param GravityView_View $this The GravityView_View instance
200 200
  */
201
-do_action( 'gravityview_list_body_after', $this );
201
+do_action('gravityview_list_body_after', $this);
Please login to merge, or discard this patch.
templates/list-single.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,31 +12,31 @@  discard block
 block discarded – undo
12 12
 
13 13
 <div class="gv-container gv-list-single-container gv-list-container">
14 14
 	<p class="gv-back-link"><?php echo gravityview_back_link(); ?></p>
15
-	<?php foreach ( $this->getEntries() as $entry ) {
16
-		$this->setCurrentEntry( $entry );
15
+	<?php foreach ($this->getEntries() as $entry) {
16
+		$this->setCurrentEntry($entry);
17 17
 	?>
18 18
 
19 19
 		<div id="gv_list_<?php echo $entry['id']; ?>" class="gv-list-view">
20 20
 	<?php
21 21
 
22
-	if ( $this->getFields( 'single_list-title' ) || $this->getFields( 'single_list-subtitle' ) ) { ?>
22
+	if ($this->getFields('single_list-title') || $this->getFields('single_list-subtitle')) { ?>
23 23
 		<div class="gv-list-view-title">
24 24
 		<?php
25
-		if ( $fields = $this->getFields( 'single_list-title' ) ) {
25
+		if ($fields = $this->getFields('single_list-title')) {
26 26
 			$i = 0;
27 27
 			$title_args = array(
28 28
 				'entry' => $entry,
29 29
 				'form' => $this->form,
30 30
 				'hide_empty' => $this->atts['hide_empty'],
31 31
 			);
32
-			foreach ( $fields as $field ) {
32
+			foreach ($fields as $field) {
33 33
 				$title_args['field'] = $field;
34
-				if ( 0 === $i ) {
34
+				if (0 === $i) {
35 35
 					$title_args['markup'] = '<h3 id="{{ field_id }}" class="{{class}}">{{label}}{{value}}</h3>';
36
-					echo gravityview_field_output( $title_args );
36
+					echo gravityview_field_output($title_args);
37 37
 				} else {
38 38
 					$title_args['wpautop'] = true;
39
-					echo gravityview_field_output( $title_args );
39
+					echo gravityview_field_output($title_args);
40 40
 				}
41 41
 				$i++;
42 42
 			}
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 			?>
76 76
 		</div>
77 77
 
78
-		<?php if ( $this->getFields( 'single_list-footer-left' ) || $this->getFields( 'single_list-footer-right' ) ) { ?>
78
+		<?php if ($this->getFields('single_list-footer-left') || $this->getFields('single_list-footer-right')) { ?>
79 79
 			<div class="gv-grid gv-list-view-footer">
80 80
 				<div class="gv-grid-col-1-2 gv-left">
81
-					<?php $this->renderZone( 'footer-left' ); ?>
81
+					<?php $this->renderZone('footer-left'); ?>
82 82
 				</div>
83 83
 
84 84
 				<div class="gv-grid-col-1-2 gv-right">
85
-					<?php $this->renderZone( 'footer-right' ); ?>
85
+					<?php $this->renderZone('footer-right'); ?>
86 86
 				</div>
87 87
 			</div>
88 88
 		<?php } ?>
Please login to merge, or discard this patch.
templates/table-body.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@  discard block
 block discarded – undo
11 11
 	<tbody>
12 12
 		<?php
13 13
 
14
-		do_action('gravityview_table_body_before', $this );
14
+		do_action('gravityview_table_body_before', $this);
15 15
 
16
-		if( 0 === $this->getTotalEntries() ) {
16
+		if (0 === $this->getTotalEntries()) {
17 17
 
18 18
 			$directory_table_columns = $this->getFields('directory_table-columns');
19 19
 			?>
20 20
 			<tr>
21
-				<?php do_action('gravityview_table_tr_before', $this ); ?>
22
-				<td colspan="<?php echo $directory_table_columns ? sizeof( $directory_table_columns ) : ''; ?>" class="gv-no-results">
21
+				<?php do_action('gravityview_table_tr_before', $this); ?>
22
+				<td colspan="<?php echo $directory_table_columns ? sizeof($directory_table_columns) : ''; ?>" class="gv-no-results">
23 23
 					<?php echo gv_no_results(); ?>
24 24
 				</td>
25
-				<?php do_action('gravityview_table_tr_after', $this ); ?>
25
+				<?php do_action('gravityview_table_tr_after', $this); ?>
26 26
 			</tr>
27 27
 		<?php
28 28
 		} else {
29 29
 
30
-			foreach( $this->getEntries() as $entry ) :
30
+			foreach ($this->getEntries() as $entry) :
31 31
 
32
-				$this->setCurrentEntry( $entry );
32
+				$this->setCurrentEntry($entry);
33 33
 
34 34
 				// Add `alt` class to alternate rows
35
-				$alt = empty( $alt ) ? 'alt' : '';
35
+				$alt = empty($alt) ? 'alt' : '';
36 36
 
37 37
 				/**
38 38
 				 * @filter `gravityview_entry_class` Modify the class applied to the entry row
@@ -40,18 +40,18 @@  discard block
 block discarded – undo
40 40
 				 * @param array $entry Current entry being displayed
41 41
 				 * @param GravityView_View $this Current GravityView_View object
42 42
 				 */
43
-				$class = apply_filters( 'gravityview_entry_class', $alt, $entry, $this );
43
+				$class = apply_filters('gravityview_entry_class', $alt, $entry, $this);
44 44
 		?>
45
-				<tr<?php echo ' class="'.esc_attr( $class ).'"'; ?>>
45
+				<tr<?php echo ' class="'.esc_attr($class).'"'; ?>>
46 46
 		<?php
47
-					do_action('gravityview_table_cells_before', $this );
47
+					do_action('gravityview_table_cells_before', $this);
48 48
 
49
-					$this->renderZone( 'columns', array(
49
+					$this->renderZone('columns', array(
50 50
 						'markup' => '<td id="{{ field_id }}" class="{{class}}">{{value}}</td>',
51 51
 						'hide_empty' => false, // Always show <td>
52 52
 					));
53 53
 
54
-					do_action('gravityview_table_cells_after', $this );
54
+					do_action('gravityview_table_cells_after', $this);
55 55
 		?>
56 56
 				</tr>
57 57
 			<?php
@@ -59,6 +59,6 @@  discard block
 block discarded – undo
59 59
 
60 60
 		}
61 61
 
62
-		do_action('gravityview_table_body_after', $this );
62
+		do_action('gravityview_table_body_after', $this);
63 63
 	?>
64 64
 	</tbody>
Please login to merge, or discard this patch.
templates/table-footer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 		<tr>
13 13
 			<?php
14 14
 
15
-			$this->renderZone( 'columns', array(
15
+			$this->renderZone('columns', array(
16 16
 				'markup' => '<th id="{{ field_id }}" class="{{class}}">{{label}}</th>',
17 17
 				'hide_empty' => false, // Always show <th>
18 18
 			));
Please login to merge, or discard this patch.
templates/table-header.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 				// Make sure this wasn't overridden by search
20 20
 				$this->setTemplatePartSlug('table');
21 21
 
22
-				$this->renderZone( 'columns', array(
22
+				$this->renderZone('columns', array(
23 23
 					'markup' => '<th id="{{ field_id }}" class="{{class}}" style="{{width:style}}">{{label}}</th>',
24 24
 					'hide_empty' => false, // Always show <th>
25 25
 				));
Please login to merge, or discard this patch.
templates/table-single.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 <div class="gv-table-view gv-container gv-table-single-container">
16 16
 	<table class="gv-table-view-content">
17
-		<?php if( $this->getFields('single_table-columns') ) { ?>
17
+		<?php if ($this->getFields('single_table-columns')) { ?>
18 18
 			<thead>
19 19
 				<?php gravityview_header(); ?>
20 20
 			</thead>
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 							<td>{{value}}</td>
28 28
 						</tr>';
29 29
 
30
-					$this->renderZone( 'columns', array(
30
+					$this->renderZone('columns', array(
31 31
 						'markup' => $markup,
32 32
 					));
33 33
 			?>
Please login to merge, or discard this patch.
uninstall.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // If uninstall not called from WordPress, then exit
13
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
+if (!defined('WP_UNINSTALL_PLUGIN')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 	public function __construct() {
26 26
 
27 27
 		/** @define "$file_path" "./" */
28
-		$file_path = plugin_dir_path( __FILE__ );
28
+		$file_path = plugin_dir_path(__FILE__);
29 29
 
30
-		include_once $file_path . 'includes/class-gravityview-roles-capabilities.php';
30
+		include_once $file_path.'includes/class-gravityview-roles-capabilities.php';
31 31
 
32 32
 		/**
33 33
 		 * Only delete content and settings if "Delete on Uninstall?" setting is "Permanently Delete"
34 34
 		 */
35 35
 		$delete = $this->get_delete_setting();
36 36
 
37
-		if( GravityView_Roles_Capabilities::has_cap( 'gravityview_uninstall' ) && 'delete' === $delete ) {
37
+		if (GravityView_Roles_Capabilities::has_cap('gravityview_uninstall') && 'delete' === $delete) {
38 38
 			$this->fire_everything();
39 39
 		}
40 40
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	private function get_delete_setting() {
50 50
 
51
-		$settings = get_option( $this->settings_name, array() );
51
+		$settings = get_option($this->settings_name, array());
52 52
 
53
-		return isset( $settings[ 'delete-on-uninstall' ] ) ? $settings[ 'delete-on-uninstall' ] : null;
53
+		return isset($settings['delete-on-uninstall']) ? $settings['delete-on-uninstall'] : null;
54 54
 	}
55 55
 
56 56
 	/**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	private function delete_entry_meta() {
76 76
 		global $wpdb;
77 77
 
78
-		$meta_table = class_exists( 'GFFormsModel' ) ? GFFormsModel::get_lead_meta_table_name() : $wpdb->prefix . 'rg_lead_meta';
78
+		$meta_table = class_exists('GFFormsModel') ? GFFormsModel::get_lead_meta_table_name() : $wpdb->prefix.'rg_lead_meta';
79 79
 
80 80
 		$sql = "
81 81
 			DELETE FROM $meta_table
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			);
85 85
 		";
86 86
 
87
-		$wpdb->query( $sql );
87
+		$wpdb->query($sql);
88 88
 	}
89 89
 
90 90
 	/**
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
 	private function delete_entry_notes() {
96 96
 		global $wpdb;
97 97
 
98
-		$notes_table = class_exists( 'GFFormsModel' ) ? GFFormsModel::get_lead_notes_table_name() : $wpdb->prefix . 'rg_lead_notes';
98
+		$notes_table = class_exists('GFFormsModel') ? GFFormsModel::get_lead_notes_table_name() : $wpdb->prefix.'rg_lead_notes';
99 99
 
100 100
 		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
101 101
 		$approved = __('Approved the Entry for GravityView', 'gravityview');
102 102
 
103
-		$sql = $wpdb->prepare( "
103
+		$sql = $wpdb->prepare("
104 104
 			DELETE FROM $notes_table
105 105
             WHERE (
106 106
                 `note_type` = 'gravityview' OR
107 107
 				`value` = %s OR
108 108
 				`value` = %s
109 109
             );
110
-        ", $approved, $disapproved );
110
+        ", $approved, $disapproved);
111 111
 
112
-		$wpdb->query( $sql );
112
+		$wpdb->query($sql);
113 113
 	}
114 114
 
115 115
 	/**
@@ -128,16 +128,16 @@  discard block
 block discarded – undo
128 128
 	 */
129 129
 	private function delete_posts() {
130 130
 
131
-		$items = get_posts( array(
131
+		$items = get_posts(array(
132 132
 			'post_type' => 'gravityview',
133 133
 			'post_status' => 'any',
134 134
 			'numberposts' => -1,
135 135
 			'fields' => 'ids'
136
-		) );
136
+		));
137 137
 
138
-		if ( $items ) {
139
-			foreach ( $items as $item ) {
140
-				wp_delete_post( $item, true );
138
+		if ($items) {
139
+			foreach ($items as $item) {
140
+				wp_delete_post($item, true);
141 141
 			}
142 142
 		}
143 143
 	}
@@ -149,15 +149,15 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	private function delete_options() {
151 151
 
152
-		delete_option( 'gravityformsaddon_gravityview_app_settings' );
153
-		delete_option( 'gravityformsaddon_gravityview_version' );
154
-		delete_option( 'gravityview_cache_blacklist' );
152
+		delete_option('gravityformsaddon_gravityview_app_settings');
153
+		delete_option('gravityformsaddon_gravityview_version');
154
+		delete_option('gravityview_cache_blacklist');
155 155
 
156
-		delete_transient( 'gravityview_edd-activate_valid' );
157
-		delete_transient( 'gravityview_edd-deactivate_valid' );
158
-		delete_transient( 'gravityview_dismissed_notices' );
156
+		delete_transient('gravityview_edd-activate_valid');
157
+		delete_transient('gravityview_edd-deactivate_valid');
158
+		delete_transient('gravityview_dismissed_notices');
159 159
 
160
-		delete_site_transient( 'gravityview_related_plugins' );
160
+		delete_site_transient('gravityview_related_plugins');
161 161
 	}
162 162
 }
163 163
 
Please login to merge, or discard this patch.
templates/fields/calculation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13
-echo gravityview_get_field_value( $entry, $field_id, $display_value );
13
+echo gravityview_get_field_value($entry, $field_id, $display_value);
Please login to merge, or discard this patch.
includes/class-admin-add-shortcode.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 /** If this file is called directly, abort. */
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if (!defined('ABSPATH')) {
16 16
 	die;
17 17
 }
18 18
 
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 	function __construct() {
22 22
 
23
-			add_action( 'media_buttons', array( $this, 'add_shortcode_button'), 30);
23
+			add_action('media_buttons', array($this, 'add_shortcode_button'), 30);
24 24
 
25
-			add_action( 'admin_footer',	array( $this, 'add_shortcode_popup') );
25
+			add_action('admin_footer', array($this, 'add_shortcode_popup'));
26 26
 
27 27
 			// adding styles and scripts
28
-			add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
28
+			add_action('admin_enqueue_scripts', array($this, 'add_scripts_and_styles'));
29 29
 
30 30
 			// ajax - populate sort fields based on the selected view
31
-			add_action( 'wp_ajax_gv_sortable_fields', array( $this, 'get_sortable_fields' ) );
31
+			add_action('wp_ajax_gv_sortable_fields', array($this, 'get_sortable_fields'));
32 32
 	}
33 33
 
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	function is_post_editor_screen() {
42 42
 		global $current_screen, $pagenow;
43
-		return !empty( $current_screen->post_type ) && 'gravityview' != $current_screen->post_type && in_array( $pagenow , array( 'post.php' , 'post-new.php' ) );
43
+		return !empty($current_screen->post_type) && 'gravityview' != $current_screen->post_type && in_array($pagenow, array('post.php', 'post-new.php'));
44 44
 	}
45 45
 
46 46
 
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 		/**
56 56
 		 * @since 1.15.3
57 57
 		 */
58
-		if( ! GVCommon::has_cap( array( 'publish_gravityviews' ) ) ) {
58
+		if (!GVCommon::has_cap(array('publish_gravityviews'))) {
59 59
 			return;
60 60
 		}
61 61
 
62
-		if( !$this->is_post_editor_screen() ) {
62
+		if (!$this->is_post_editor_screen()) {
63 63
 			return;
64 64
 		}
65 65
 		?>
66
-		<a href="#TB_inline?width=480&amp;inlineId=select_gravityview_view&amp;width=600&amp;height=800" class="thickbox button gform_media_link" id="add_gravityview" title="<?php esc_attr_e("Insert View", 'gravityview'); ?>"><span class="icon gv-icon-astronaut-head"></span><?php esc_html_e( 'Add View', 'gravityview' ); ?></a>
66
+		<a href="#TB_inline?width=480&amp;inlineId=select_gravityview_view&amp;width=600&amp;height=800" class="thickbox button gform_media_link" id="add_gravityview" title="<?php esc_attr_e("Insert View", 'gravityview'); ?>"><span class="icon gv-icon-astronaut-head"></span><?php esc_html_e('Add View', 'gravityview'); ?></a>
67 67
 		<?php
68 68
 
69 69
 	}
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
 	function add_shortcode_popup() {
80 80
 		global $post;
81 81
 
82
-		if( !$this->is_post_editor_screen() ) {
82
+		if (!$this->is_post_editor_screen()) {
83 83
 			return;
84 84
 		}
85 85
 
86 86
 		$post_type = get_post_type_object($post->post_type);
87 87
 
88
-		$views = get_posts( array('post_type' => 'gravityview', 'posts_per_page' => -1 ) );
88
+		$views = get_posts(array('post_type' => 'gravityview', 'posts_per_page' => -1));
89 89
 
90 90
 		// If there are no views set up yet, we get outta here.
91
-		if( empty( $views ) ) {
92
-			echo '<div id="select_gravityview_view"><div class="wrap">'. GravityView_Post_Types::no_views_text() .'</div></div>';
91
+		if (empty($views)) {
92
+			echo '<div id="select_gravityview_view"><div class="wrap">'.GravityView_Post_Types::no_views_text().'</div></div>';
93 93
 			return;
94 94
 		}
95 95
 
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 			<form action="#" method="get" id="select_gravityview_view_form">
99 99
 				<div class="wrap">
100 100
 
101
-					<h2 class=""><?php esc_html_e( 'Embed a View', 'gravityview' ); ?></h2>
102
-					<p class="subtitle"><?php printf( esc_attr ( __( 'Use this form to embed a View into this %s. %sLearn more about using shortcodes.%s', 'gravityview') ), $post_type->labels->singular_name, '<a href="http://gravityview.co/support/documentation/202934188/" target="_blank">', '</a>' ); ?></p>
101
+					<h2 class=""><?php esc_html_e('Embed a View', 'gravityview'); ?></h2>
102
+					<p class="subtitle"><?php printf(esc_attr(__('Use this form to embed a View into this %s. %sLearn more about using shortcodes.%s', 'gravityview')), $post_type->labels->singular_name, '<a href="http://gravityview.co/support/documentation/202934188/" target="_blank">', '</a>'); ?></p>
103 103
 
104 104
 					<div>
105
-						<h3><label for="gravityview_id"><?php esc_html_e( 'Select a View', 'gravityview' ); ?></label></h3>
105
+						<h3><label for="gravityview_id"><?php esc_html_e('Select a View', 'gravityview'); ?></label></h3>
106 106
 
107 107
 						<select name="gravityview_id" id="gravityview_id">
108
-							<option value=""><?php esc_html_e( '&mdash; Select a View to Insert &mdash;', 'gravityview' ); ?></option>
108
+							<option value=""><?php esc_html_e('&mdash; Select a View to Insert &mdash;', 'gravityview'); ?></option>
109 109
 							<?php
110
-							foreach( $views as $view ) {
111
-								$title = empty( $view->post_title ) ? __('(no title)', 'gravityview') : $view->post_title;
112
-								echo '<option value="'. $view->ID .'">'. esc_html( sprintf('%s #%d', $title, $view->ID ) ) .'</option>';
110
+							foreach ($views as $view) {
111
+								$title = empty($view->post_title) ? __('(no title)', 'gravityview') : $view->post_title;
112
+								echo '<option value="'.$view->ID.'">'.esc_html(sprintf('%s #%d', $title, $view->ID)).'</option>';
113 113
 							}
114 114
 							?>
115 115
 						</select>
@@ -117,24 +117,24 @@  discard block
 block discarded – undo
117 117
 
118 118
 					<table class="form-table hide-if-js">
119 119
 
120
-						<caption><?php esc_html_e( 'View Settings', 'gravityview' ); ?></caption>
120
+						<caption><?php esc_html_e('View Settings', 'gravityview'); ?></caption>
121 121
 
122 122
 						<?php
123 123
 
124
-						$settings = GravityView_View_Data::get_default_args( true );
124
+						$settings = GravityView_View_Data::get_default_args(true);
125 125
 
126
-						foreach ( $settings as $key => $setting ) {
126
+						foreach ($settings as $key => $setting) {
127 127
 
128
-							if( empty( $setting['show_in_shortcode'] ) ) { continue; }
128
+							if (empty($setting['show_in_shortcode'])) { continue; }
129 129
 
130
-							GravityView_Render_Settings::render_setting_row( $key, array(), NULL, 'gravityview_%s', 'gravityview_%s' );
130
+							GravityView_Render_Settings::render_setting_row($key, array(), NULL, 'gravityview_%s', 'gravityview_%s');
131 131
 						}
132 132
 						?>
133 133
 
134 134
 					</table>
135 135
 
136 136
 					<div class="submit">
137
-						<input type="submit" class="button button-primary button-large alignleft hide-if-js" value="<?php esc_attr_e('Insert View', 'gravityview' ); ?>" id="insert_gravityview_view" />
137
+						<input type="submit" class="button button-primary button-large alignleft hide-if-js" value="<?php esc_attr_e('Insert View', 'gravityview'); ?>" id="insert_gravityview_view" />
138 138
 						<input class="button button-secondary alignright" type="submit" onclick="tb_remove(); return false;" value="<?php esc_attr_e("Cancel", 'gravityview'); ?>" />
139 139
 					</div>
140 140
 
@@ -157,32 +157,32 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	function add_scripts_and_styles() {
159 159
 
160
-		if( ! $this->is_post_editor_screen() ) {
160
+		if (!$this->is_post_editor_screen()) {
161 161
 			return;
162 162
 		}
163 163
 
164
-		wp_enqueue_style( 'dashicons' );
164
+		wp_enqueue_style('dashicons');
165 165
 
166 166
 		// date picker
167
-		wp_enqueue_script( 'jquery-ui-datepicker' );
167
+		wp_enqueue_script('jquery-ui-datepicker');
168 168
 
169 169
 		$protocol = is_ssl() ? 'https://' : 'http://';
170 170
 
171
-		wp_enqueue_style( 'jquery-ui-datepicker', $protocol.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css', array(), GravityView_Plugin::version );
171
+		wp_enqueue_style('jquery-ui-datepicker', $protocol.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css', array(), GravityView_Plugin::version);
172 172
 
173 173
 		//enqueue styles
174
-		wp_register_style( 'gravityview_postedit_styles', plugins_url('assets/css/admin-post-edit.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
175
-		wp_enqueue_style( 'gravityview_postedit_styles' );
174
+		wp_register_style('gravityview_postedit_styles', plugins_url('assets/css/admin-post-edit.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version);
175
+		wp_enqueue_style('gravityview_postedit_styles');
176 176
 
177 177
 		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
178 178
 
179 179
 		// custom js
180
-		wp_register_script( 'gravityview_postedit_scripts',  plugins_url('assets/js/admin-post-edit'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery', 'jquery-ui-datepicker' ), GravityView_Plugin::version );
181
-		wp_enqueue_script( 'gravityview_postedit_scripts' );
180
+		wp_register_script('gravityview_postedit_scripts', plugins_url('assets/js/admin-post-edit'.$script_debug.'.js', GRAVITYVIEW_FILE), array('jquery', 'jquery-ui-datepicker'), GravityView_Plugin::version);
181
+		wp_enqueue_script('gravityview_postedit_scripts');
182 182
 		wp_localize_script('gravityview_postedit_scripts', 'gvGlobals', array(
183
-			'nonce' => wp_create_nonce( 'gravityview_ajaxaddshortcode'),
184
-			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
185
-			'alert_1' => esc_html__( 'Please select a View', 'gravityview'),
183
+			'nonce' => wp_create_nonce('gravityview_ajaxaddshortcode'),
184
+			'loading_text' => esc_html__('Loading&hellip;', 'gravityview'),
185
+			'alert_1' => esc_html__('Please select a View', 'gravityview'),
186 186
 		));
187 187
 
188 188
 	}
@@ -199,27 +199,27 @@  discard block
 block discarded – undo
199 199
 	function get_sortable_fields() {
200 200
 
201 201
 		// Not properly formatted request
202
-		if ( empty( $_POST['viewid'] ) || !is_numeric( $_POST['viewid'] ) ) {
203
-			exit( false );
202
+		if (empty($_POST['viewid']) || !is_numeric($_POST['viewid'])) {
203
+			exit(false);
204 204
 		}
205 205
 
206 206
 		// Not valid request
207
-		if( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxaddshortcode' ) ) {
208
-			exit( false );
207
+		if (empty($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'gravityview_ajaxaddshortcode')) {
208
+			exit(false);
209 209
 		}
210 210
 
211 211
 		$viewid = (int)$_POST['viewid'];
212 212
 
213 213
 		// fetch form id assigned to the view
214
-		$formid = gravityview_get_form_id( $viewid );
214
+		$formid = gravityview_get_form_id($viewid);
215 215
 
216 216
 		// Get the default sort field for the view
217
-		$sort_field = gravityview_get_template_setting( $viewid, 'sort_field' );
217
+		$sort_field = gravityview_get_template_setting($viewid, 'sort_field');
218 218
 
219 219
 		// Generate the output `<option>`s
220
-		$response = gravityview_get_sortable_fields( $formid, $sort_field );
220
+		$response = gravityview_get_sortable_fields($formid, $sort_field);
221 221
 
222
-		exit( $response );
222
+		exit($response);
223 223
 	}
224 224
 
225 225
 }
Please login to merge, or discard this patch.