Completed
Pull Request — master (#116)
by
unknown
02:26
created
admin/includes/EDD_SL_Plugin_Updater.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 	 * @param array   $_api_data    Optional data to send with API calls.
27 27
 	 * @return void
28 28
 	 */
29
-	function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
30
-		$this->api_url  = trailingslashit( $_api_url );
29
+	function __construct($_api_url, $_plugin_file, $_api_data = null) {
30
+		$this->api_url  = trailingslashit($_api_url);
31 31
 		$this->api_data = $_api_data;
32
-		$this->name     = plugin_basename( $_plugin_file );
33
-		$this->slug     = basename( $_plugin_file, '.php' );
32
+		$this->name     = plugin_basename($_plugin_file);
33
+		$this->slug     = basename($_plugin_file, '.php');
34 34
 		$this->version  = $_api_data['version'];
35 35
 
36 36
 		// Set up hooks.
37 37
 		$this->init();
38
-		add_action( 'admin_init', array( $this, 'show_changelog' ) );
38
+		add_action('admin_init', array($this, 'show_changelog'));
39 39
 	}
40 40
 
41 41
 	/**
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function init() {
49 49
 
50
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
51
-		add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
50
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
51
+		add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
52 52
 
53
-		add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
53
+		add_action('after_plugin_row_'.$this->name, array($this, 'show_update_notification'), 10, 2);
54 54
 	}
55 55
 
56 56
 	/**
@@ -66,34 +66,34 @@  discard block
 block discarded – undo
66 66
 	 * @param array   $_transient_data Update array build by WordPress.
67 67
 	 * @return array Modified update array with custom plugin data.
68 68
 	 */
69
-	function check_update( $_transient_data ) {
69
+	function check_update($_transient_data) {
70 70
 
71 71
 		global $pagenow;
72 72
 
73
-		if ( ! is_object( $_transient_data ) ) {
73
+		if (!is_object($_transient_data)) {
74 74
 			$_transient_data = new stdClass;
75 75
 		}
76 76
 
77
-		if ( 'plugins.php' == $pagenow && is_multisite() ) {
77
+		if ('plugins.php' == $pagenow && is_multisite()) {
78 78
 			return $_transient_data;
79 79
 		}
80 80
 
81
-		if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
81
+		if (empty($_transient_data->response) || empty($_transient_data->response[$this->name])) {
82 82
 
83
-			$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
83
+			$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
84 84
 
85
-			if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
85
+			if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
86 86
 
87 87
 				$this->did_check = true;
88 88
 
89
-				if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
89
+				if (version_compare($this->version, $version_info->new_version, '<')) {
90 90
 
91
-					$_transient_data->response[ $this->name ] = $version_info;
91
+					$_transient_data->response[$this->name] = $version_info;
92 92
 
93 93
 				}
94 94
 
95 95
 				$_transient_data->last_checked = time();
96
-				$_transient_data->checked[ $this->name ] = $this->version;
96
+				$_transient_data->checked[$this->name] = $this->version;
97 97
 
98 98
 			}
99 99
 
@@ -108,84 +108,84 @@  discard block
 block discarded – undo
108 108
 	 * @param string  $file
109 109
 	 * @param array   $plugin
110 110
 	 */
111
-	public function show_update_notification( $file, $plugin ) {
111
+	public function show_update_notification($file, $plugin) {
112 112
 
113
-		if ( ! current_user_can( 'update_plugins' ) ) {
113
+		if (!current_user_can('update_plugins')) {
114 114
 			return;
115 115
 		}
116 116
 
117
-		if ( ! is_multisite() ) {
117
+		if (!is_multisite()) {
118 118
 			return;
119 119
 		}
120 120
 
121
-		if ( $this->name != $file ) {
121
+		if ($this->name != $file) {
122 122
 			return;
123 123
 		}
124 124
 
125 125
 		// Remove our filter on the site transient
126
-		remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
126
+		remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
127 127
 
128
-		$update_cache = get_site_transient( 'update_plugins' );
128
+		$update_cache = get_site_transient('update_plugins');
129 129
 
130
-		if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
130
+		if (!is_object($update_cache) || empty($update_cache->response) || empty($update_cache->response[$this->name])) {
131 131
 
132
-			$cache_key    = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
133
-			$version_info = get_transient( $cache_key );
132
+			$cache_key    = md5('edd_plugin_'.sanitize_key($this->name).'_version_info');
133
+			$version_info = get_transient($cache_key);
134 134
 
135
-			if ( false === $version_info ) {
135
+			if (false === $version_info) {
136 136
 
137
-				$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
137
+				$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
138 138
 
139
-				set_transient( $cache_key, $version_info, 3600 );
139
+				set_transient($cache_key, $version_info, 3600);
140 140
 			}
141 141
 
142 142
 
143
-			if ( ! is_object( $version_info ) ) {
143
+			if (!is_object($version_info)) {
144 144
 				return;
145 145
 			}
146 146
 
147
-			if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
147
+			if (version_compare($this->version, $version_info->new_version, '<')) {
148 148
 
149
-				$update_cache->response[ $this->name ] = $version_info;
149
+				$update_cache->response[$this->name] = $version_info;
150 150
 
151 151
 			}
152 152
 
153 153
 			$update_cache->last_checked = time();
154
-			$update_cache->checked[ $this->name ] = $this->version;
154
+			$update_cache->checked[$this->name] = $this->version;
155 155
 
156
-			set_site_transient( 'update_plugins', $update_cache );
156
+			set_site_transient('update_plugins', $update_cache);
157 157
 
158 158
 		} else {
159 159
 
160
-			$version_info = $update_cache->response[ $this->name ];
160
+			$version_info = $update_cache->response[$this->name];
161 161
 
162 162
 		}
163 163
 
164 164
 		// Restore our filter
165
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
165
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
166 166
 
167
-		if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
167
+		if (!empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
168 168
 
169 169
 			// build a plugin list row, with update notification
170
-			$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
171
-			echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
170
+			$wp_list_table = _get_list_table('WP_Plugins_List_Table');
171
+			echo '<tr class="plugin-update-tr"><td colspan="'.$wp_list_table->get_column_count().'" class="plugin-update colspanchange"><div class="update-message">';
172 172
 
173
-			$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
173
+			$changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin='.$this->name.'&slug='.$this->slug.'&TB_iframe=true&width=772&height=911');
174 174
 
175
-			if ( empty( $version_info->download_link ) ) {
175
+			if (empty($version_info->download_link)) {
176 176
 				printf(
177
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'lasso' ),
178
-					esc_html( $version_info->name ),
179
-					esc_url( $changelog_link ),
180
-					esc_html( $version_info->new_version )
177
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'lasso'),
178
+					esc_html($version_info->name),
179
+					esc_url($changelog_link),
180
+					esc_html($version_info->new_version)
181 181
 				);
182 182
 			} else {
183 183
 				printf(
184
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'lasso' ),
185
-					esc_html( $version_info->name ),
186
-					esc_url( $changelog_link ),
187
-					esc_html( $version_info->new_version ),
188
-					esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
184
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'lasso'),
185
+					esc_html($version_info->name),
186
+					esc_url($changelog_link),
187
+					esc_html($version_info->new_version),
188
+					esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=').$this->name, 'upgrade-plugin_'.$this->name))
189 189
 				);
190 190
 			}
191 191
 
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 	 * @param object  $_args
205 205
 	 * @return object $_data
206 206
 	 */
207
-	function plugins_api_filter( $_data, $_action = '', $_args = null ) {
207
+	function plugins_api_filter($_data, $_action = '', $_args = null) {
208 208
 
209 209
 
210
-		if ( $_action != 'plugin_information' ) {
210
+		if ($_action != 'plugin_information') {
211 211
 
212 212
 			return $_data;
213 213
 
214 214
 		}
215 215
 
216
-		if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
216
+		if (!isset($_args->slug) || ($_args->slug != $this->slug)) {
217 217
 
218 218
 			return $_data;
219 219
 
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
 			)
229 229
 		);
230 230
 
231
-		$api_response = $this->api_request( 'plugin_information', $to_send );
231
+		$api_response = $this->api_request('plugin_information', $to_send);
232 232
 
233
-		if ( false !== $api_response ) {
233
+		if (false !== $api_response) {
234 234
 			$_data = $api_response;
235 235
 		}
236 236
 
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 	 * @param string  $url
246 246
 	 * @return object $array
247 247
 	 */
248
-	function http_request_args( $args, $url ) {
248
+	function http_request_args($args, $url) {
249 249
 		// If it is an https request and we are performing a package download, disable ssl verification
250
-		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
250
+		if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
251 251
 			$args['sslverify'] = false;
252 252
 		}
253 253
 		return $args;
@@ -264,40 +264,40 @@  discard block
 block discarded – undo
264 264
 	 * @param array   $_data   Parameters for the API action.
265 265
 	 * @return false||object
266 266
 	 */
267
-	private function api_request( $_action, $_data ) {
267
+	private function api_request($_action, $_data) {
268 268
 
269 269
 		global $wp_version;
270 270
 
271
-		$data = array_merge( $this->api_data, $_data );
271
+		$data = array_merge($this->api_data, $_data);
272 272
 
273
-		if ( $data['slug'] != $this->slug )
273
+		if ($data['slug'] != $this->slug)
274 274
 			return;
275 275
 
276
-		if ( empty( $data['license'] ) )
276
+		if (empty($data['license']))
277 277
 			return;
278 278
 
279
-		if ( $this->api_url == home_url() ) {
279
+		if ($this->api_url == home_url()) {
280 280
 			return false; // Don't allow a plugin to ping itself
281 281
 		}
282 282
 
283 283
 		$api_params = array(
284 284
 			'edd_action' => 'get_version',
285 285
 			'license'    => $data['license'],
286
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
287
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
286
+			'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
287
+			'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
288 288
 			'slug'       => $data['slug'],
289 289
 			'author'     => $data['author'],
290 290
 			'url'        => home_url()
291 291
 		);
292 292
 
293
-		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
293
+		$request = wp_remote_post($this->api_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
294 294
 
295
-		if ( ! is_wp_error( $request ) ) {
296
-			$request = json_decode( wp_remote_retrieve_body( $request ) );
295
+		if (!is_wp_error($request)) {
296
+			$request = json_decode(wp_remote_retrieve_body($request));
297 297
 		}
298 298
 
299
-		if ( $request && isset( $request->sections ) ) {
300
-			$request->sections = maybe_unserialize( $request->sections );
299
+		if ($request && isset($request->sections)) {
300
+			$request->sections = maybe_unserialize($request->sections);
301 301
 		} else {
302 302
 			$request = false;
303 303
 		}
@@ -308,26 +308,26 @@  discard block
 block discarded – undo
308 308
 	public function show_changelog() {
309 309
 
310 310
 
311
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
311
+		if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
312 312
 			return;
313 313
 		}
314 314
 
315
-		if ( empty( $_REQUEST['plugin'] ) ) {
315
+		if (empty($_REQUEST['plugin'])) {
316 316
 			return;
317 317
 		}
318 318
 
319
-		if ( empty( $_REQUEST['slug'] ) ) {
319
+		if (empty($_REQUEST['slug'])) {
320 320
 			return;
321 321
 		}
322 322
 
323
-		if ( ! current_user_can( 'update_plugins' ) ) {
324
-			wp_die( __( 'You do not have permission to install plugin updates', 'lasso' ), __( 'Error', 'lasso' ), array( 'response' => 403 ) );
323
+		if (!current_user_can('update_plugins')) {
324
+			wp_die(__('You do not have permission to install plugin updates', 'lasso'), __('Error', 'lasso'), array('response' => 403));
325 325
 		}
326 326
 
327
-		$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
327
+		$response = $this->api_request('plugin_latest_version', array('slug' => $_REQUEST['slug']));
328 328
 
329
-		if ( $response && isset( $response->sections['changelog'] ) ) {
330
-			echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
329
+		if ($response && isset($response->sections['changelog'])) {
330
+			echo '<div style="background:#fff;padding:10px;">'.$response->sections['changelog'].'</div>';
331 331
 		}
332 332
 
333 333
 
Please login to merge, or discard this patch.
admin/includes/load_admin.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 
129 129
 	/**
130
-	*	Adds an admin notice reminding the user if their license key has not been saved
131
-	*
132
-	*	@since 0.9.7
133
-	*	@todo make dismissible
134
-	*/
130
+	 *	Adds an admin notice reminding the user if their license key has not been saved
131
+	 *
132
+	 *	@since 0.9.7
133
+	 *	@todo make dismissible
134
+	 */
135 135
 	public function license_nag(){
136 136
 
137 137
 		$screen 	= get_current_screen();
@@ -152,26 +152,26 @@  discard block
 block discarded – undo
152 152
 
153 153
 			if ( empty( $license ) ) {
154 154
 
155
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
155
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
156 156
 
157
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
157
+			} else if ( 'invalid' == $status ){ // license key entered wrong or something
158 158
 
159 159
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
160 160
 
161
-        	} else if ( empty( $status ) ){ // license key saved but not activated
161
+			} else if ( empty( $status ) ){ // license key saved but not activated
162 162
 
163 163
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
164 164
 
165
-        	}
165
+			}
166 166
 		}
167 167
 
168 168
 	}
169 169
 
170 170
 	/**
171
-	*  Process hiding the dimiss
172
-	*
173
-	* @since 0.9.7
174
-	*/
171
+	 *  Process hiding the dimiss
172
+	 *
173
+	 * @since 0.9.7
174
+	 */
175 175
 	public function dismiss_nag() {
176 176
 
177 177
 		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
 		$plugin = lasso::get_instance();
44 44
 		$this->plugin_slug = $plugin->get_plugin_slug();
45 45
 
46
-		add_action( 'admin_head',  			array( $this, 'admin_assets' ) );
47
-		add_action( 'admin_notices', 		array( $this, 'license_nag' ) );
48
-		add_action( 'admin_head', 			array( $this, 'dismiss_nag' ) );
49
-		add_filter( 'plugin_row_meta',    	array( $this, 'plugin_meta' ), 10, 2 );
46
+		add_action('admin_head', array($this, 'admin_assets'));
47
+		add_action('admin_notices', array($this, 'license_nag'));
48
+		add_action('admin_head', array($this, 'dismiss_nag'));
49
+		add_filter('plugin_row_meta', array($this, 'plugin_meta'), 10, 2);
50 50
 
51
-		if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
51
+		if (!class_exists('EDD_SL_Plugin_Updater')) {
52 52
 			include LASSO_DIR.'admin/includes/EDD_SL_Plugin_Updater.php';
53 53
 		}
54 54
 
55
-		if ( !class_exists( 'TGM_Plugin_Activation' ) ) {
55
+		if (!class_exists('TGM_Plugin_Activation')) {
56 56
 			include LASSO_DIR.'admin/includes/class-tgm-plugin-activation.php';
57 57
 		}
58 58
 
59 59
 		new menus\welcome();
60 60
 		new menus\settings();
61 61
 
62
-		if ( !defined( 'LASSO_AGENCY_MODE' ) ) {
62
+		if (!defined('LASSO_AGENCY_MODE')) {
63 63
 			new menus\license();
64 64
 		}
65 65
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	public static function get_instance() {
76 76
 
77 77
 		// If the single instance hasn't been set, set it now.
78
-		if ( null == self::$instance ) {
78
+		if (null == self::$instance) {
79 79
 			self::$instance = new self;
80 80
 		}
81 81
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 			'dashboard_page_lasso-welcome-screen'
98 98
 		);
99 99
 
100
-		foreach ( $pages as $page ) {
101
-			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery' ), LASSO_VERSION, true );
102
-			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
100
+		foreach ($pages as $page) {
101
+			wp_enqueue_script('lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array('jquery'), LASSO_VERSION, true);
102
+			wp_enqueue_style('lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION);
103 103
 		}
104 104
 	}
105 105
 
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
 	 *
113 113
 	 * @return array new array of links for our plugin listing on plugins.php
114 114
 	 */
115
-	public function plugin_meta( $links, $file ) {
115
+	public function plugin_meta($links, $file) {
116 116
 
117
-		if ( strpos( $file, 'lasso.php' ) !== false && !defined( 'LASSO_AGENCY_MODE' ) ) {
117
+		if (strpos($file, 'lasso.php') !== false && !defined('LASSO_AGENCY_MODE')) {
118 118
 
119 119
 			$new_links = array(
120 120
 				'<a href="http://edituswp.com/help" target="_blank">Help</a>'
121 121
 			);
122 122
 
123
-			$links = array_merge( $links, $new_links );
123
+			$links = array_merge($links, $new_links);
124 124
 		}
125 125
 
126 126
 		return $links;
@@ -132,35 +132,35 @@  discard block
 block discarded – undo
132 132
 	*	@since 0.9.7
133 133
 	*	@todo make dismissible
134 134
 	*/
135
-	public function license_nag(){
135
+	public function license_nag() {
136 136
 
137
-		$screen 	= get_current_screen();
138
-		$welcome    = 'toplevel_page_lasso-editor' == $screen->id;
139
-		$license  	= get_option( 'lasso_license_key' );
140
-		$status   	= get_option( 'lasso_license_status' );
137
+		$screen = get_current_screen();
138
+		$welcome = 'toplevel_page_lasso-editor' == $screen->id;
139
+		$license  	= get_option('lasso_license_key');
140
+		$status   	= get_option('lasso_license_status');
141 141
 
142
-		$message_empty    = apply_filters('lasso_empty_license_message','Your license key for support and automatic updates for Editus is missing!');
143
-		$message_invalid  = apply_filters('lasso_invalid_license_message','Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
144
-		$message_inactive  = apply_filters('lasso_inactive_license_message','It looks like your license key has not yet been activated.');
142
+		$message_empty    = apply_filters('lasso_empty_license_message', 'Your license key for support and automatic updates for Editus is missing!');
143
+		$message_invalid  = apply_filters('lasso_invalid_license_message', 'Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.');
144
+		$message_inactive = apply_filters('lasso_inactive_license_message', 'It looks like your license key has not yet been activated.');
145 145
 
146
-		$license_link 	  = sprintf('<a href="%s">Update License</a>', esc_url( add_query_arg( array( 'page' => 'lasso-license' ), admin_url('admin.php') ) ) );
147
-		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url( add_query_arg( 'lasso-notice', 'dismiss' ) ), __('Dismiss this notice.','lasso') );
146
+		$license_link = sprintf('<a href="%s">Update License</a>', esc_url(add_query_arg(array('page' => 'lasso-license'), admin_url('admin.php'))));
147
+		$dismiss_link     = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url(add_query_arg('lasso-notice', 'dismiss')), __('Dismiss this notice.', 'lasso'));
148 148
 
149
-		$not_hidden       = get_user_meta( get_current_user_ID(), 'lasso_license_nag_dismissed', true );
149
+		$not_hidden       = get_user_meta(get_current_user_ID(), 'lasso_license_nag_dismissed', true);
150 150
 
151
-		if ( current_user_can('manage_options') && !$welcome && !defined( 'LASSO_AGENCY_MODE') && !$not_hidden ) {
151
+		if (current_user_can('manage_options') && !$welcome && !defined('LASSO_AGENCY_MODE') && !$not_hidden) {
152 152
 
153
-			if ( empty( $license ) ) {
153
+			if (empty($license)) {
154 154
 
155
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
155
+        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link);
156 156
 
157
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
157
+        	} else if ('invalid' == $status) { // license key entered wrong or something
158 158
 
159
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
159
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link, $dismiss_link);
160 160
 
161
-        	} else if ( empty( $status ) ){ // license key saved but not activated
161
+        	} else if (empty($status)) { // license key saved but not activated
162 162
 
163
-				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
163
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link);
164 164
 
165 165
         	}
166 166
 		}
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
 	*/
175 175
 	public function dismiss_nag() {
176 176
 
177
-		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
178
-			update_user_meta( get_current_user_id(), 'lasso_license_nag_dismissed', 1 );
177
+		if (isset($_GET['lasso-notice']) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options')) {
178
+			update_user_meta(get_current_user_id(), 'lasso_license_nag_dismissed', 1);
179 179
 		}
180 180
 	}
181 181
 }
Please login to merge, or discard this patch.
admin/includes/menus/welcome.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -197,53 +197,53 @@
 block discarded – undo
197 197
 	 */
198 198
 	function required_plugins() {
199 199
 
200
-	    $plugins = array(
201
-
202
-	        array(
203
-	            'name'      => __('WP REST API','lasso'),
204
-	            'slug'      => 'json-rest-api',
205
-	            'required'  => true,
206
-	        ),
207
-
208
-	        array(
209
-	            'name'      => __('Aesop Story Engine','lasso'),
210
-	            'slug'      => 'aesop-story-engine',
211
-	            'required'  => false,
212
-	        ),
213
-
214
-	    );
215
-
216
-	    $config = array(
217
-	        'default_path' => '',                      // Default absolute path to pre-packaged plugins.
218
-	        'menu'         => 'lasso-install-plugins', // Menu slug.
219
-	        'has_notices'  => true,                    // Show admin notices or not.
220
-	        'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
221
-	        'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
222
-	        'is_automatic' => false,                   // Automatically activate plugins after installation or not.
223
-	        'message'      => '',                      // Message to output right before the plugins table.
224
-	        'strings'      => array(
225
-	            'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
226
-	            'menu_title'                      => __( 'Install Plugins', 'lasso' ),
227
-	            'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
228
-	            'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
229
-	            'notice_can_install_required'     => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s).
230
-	            'notice_can_install_recommended'  => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).
231
-	            'notice_cannot_install'           => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).
232
-	            'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
233
-	            'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
234
-	            'notice_cannot_activate'          => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).
235
-	            'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s).
236
-	            'notice_cannot_update'            => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).
237
-	            'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
238
-	            'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
239
-	            'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
240
-	            'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
241
-	            'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
242
-	            'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
243
-	        )
244
-	    );
245
-
246
-	    tgmpa( $plugins, $config );
200
+		$plugins = array(
201
+
202
+			array(
203
+				'name'      => __('WP REST API','lasso'),
204
+				'slug'      => 'json-rest-api',
205
+				'required'  => true,
206
+			),
207
+
208
+			array(
209
+				'name'      => __('Aesop Story Engine','lasso'),
210
+				'slug'      => 'aesop-story-engine',
211
+				'required'  => false,
212
+			),
213
+
214
+		);
215
+
216
+		$config = array(
217
+			'default_path' => '',                      // Default absolute path to pre-packaged plugins.
218
+			'menu'         => 'lasso-install-plugins', // Menu slug.
219
+			'has_notices'  => true,                    // Show admin notices or not.
220
+			'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
221
+			'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
222
+			'is_automatic' => false,                   // Automatically activate plugins after installation or not.
223
+			'message'      => '',                      // Message to output right before the plugins table.
224
+			'strings'      => array(
225
+				'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
226
+				'menu_title'                      => __( 'Install Plugins', 'lasso' ),
227
+				'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
228
+				'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
229
+				'notice_can_install_required'     => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s).
230
+				'notice_can_install_recommended'  => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).
231
+				'notice_cannot_install'           => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).
232
+				'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
233
+				'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
234
+				'notice_cannot_activate'          => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).
235
+				'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s).
236
+				'notice_cannot_update'            => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).
237
+				'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
238
+				'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
239
+				'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
240
+				'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
241
+				'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
242
+				'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
243
+			)
244
+		);
245
+
246
+		tgmpa( $plugins, $config );
247 247
 
248 248
 	}
249 249
 }
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -10,30 +10,30 @@  discard block
 block discarded – undo
10 10
 
11 11
 	function __construct() {
12 12
 
13
-		add_action( 'admin_init',   array( $this, 'redirect' ) );
14
-		add_action( 'admin_menu',   array( $this, 'lasso_welcome' ) );
15
-		add_action( 'network_admin_menu',   array( $this, 'lasso_welcome' ) );  // CHANGED Added hook.
13
+		add_action('admin_init', array($this, 'redirect'));
14
+		add_action('admin_menu', array($this, 'lasso_welcome'));
15
+		add_action('network_admin_menu', array($this, 'lasso_welcome')); // CHANGED Added hook.
16 16
 
17
-		add_action( 'tgmpa_register',  array( $this,'required_plugins' ));
17
+		add_action('tgmpa_register', array($this, 'required_plugins'));
18 18
 
19 19
 	}
20 20
 
21 21
 	function redirect() {
22 22
 
23 23
 		// Bail if no activation redirect
24
-		if ( !get_transient( '_lasso_welcome_redirect' ) ) {
24
+		if (!get_transient('_lasso_welcome_redirect')) {
25 25
 			return;
26 26
 		}
27 27
 
28 28
 		// Delete the redirect transient
29
-		delete_transient( '_lasso_welcome_redirect' );
29
+		delete_transient('_lasso_welcome_redirect');
30 30
 
31 31
 		// Bail if activating from network, or bulk
32
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
32
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
33 33
 			return;
34 34
 		}
35 35
 
36
-		wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) );
36
+		wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php'))));
37 37
 
38 38
 	}
39 39
 
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	function lasso_welcome() {
46 46
 
47 47
 		// CHANGED Removed condition.
48
-		add_menu_page( __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png' );
49
-		add_submenu_page( 'lasso-editor', __( 'Welcome', 'lasso' ), __( 'Status', 'lasso' ), 'manage_options', 'lasso-editor', array( $this, 'welcome' ) );
48
+		add_menu_page(__('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png');
49
+		add_submenu_page('lasso-editor', __('Welcome', 'lasso'), __('Status', 'lasso'), 'manage_options', 'lasso-editor', array($this, 'welcome'));
50 50
 
51 51
 	}
52 52
 
@@ -60,24 +60,24 @@  discard block
 block discarded – undo
60 60
 		?>
61 61
 		  <div class="wrap lasso--welcome">
62 62
 
63
-		  		<?php self::header();?>
63
+		  		<?php self::header(); ?>
64 64
 
65 65
 		  		<ul class="lasso--welcome__steps">
66 66
 
67 67
 		  		<?php // CHANGED Added the is_network_admin condition. ?>
68
-			  		<?php if ( is_network_admin() ) : ?>
68
+			  		<?php if (is_network_admin()) : ?>
69 69
 
70 70
 			  			<li>
71
-			  				<p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p>
71
+			  				<p><?php _e('We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso'); ?></p>
72 72
 			  			</li>
73 73
 
74 74
 			  		<?php else :
75 75
 
76 76
 					$checks = self::lasso_preflight_check();
77 77
 
78
-					if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ):
78
+					if ($checks && !defined('LASSO_AGENCY_MODE')):
79 79
 
80
-						foreach ( (array) $checks as $key => $check ) {
80
+						foreach ((array) $checks as $key => $check) {
81 81
 
82 82
 							echo $check;
83 83
 						}
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 							// pre-flight is go for flight
88 88
 						?>
89 89
 						<li class="success">
90
-							<h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3>
91
-							<?php if ( lasso_get_supported_theme_class() ) { ?>
92
-							<p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p>
90
+							<h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3>
91
+							<?php if (lasso_get_supported_theme_class()) { ?>
92
+							<p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p>
93 93
 							<?php } ?>
94
-			  				<p><?php _e( 'Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso' );?></p>
94
+			  				<p><?php _e('Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso'); ?></p>
95 95
 			  			</li>
96 96
 			  			<?php
97 97
 			  			endif;
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
 
114 114
 	  		<div class="lasso--welcome__top">
115 115
 
116
-	  			<img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>">
117
-	    		<h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1>
118
-	    		<p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p>
116
+	  			<img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>">
117
+	    		<h1><?php _e('Welcome to Editus', 'lasso'); ?></h1>
118
+	    		<p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p>
119 119
 
120
-	    		<?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?>
120
+	    		<?php if (!defined('LASSO_AGENCY_MODE')): ?>
121 121
 
122 122
 			    	<ul class="lasso--welcome__social">
123
-			    		<li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li>
124
-			    		<li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li>
125
-			    		<li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li>
123
+			    		<li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li>
124
+			    		<li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li>
125
+			    		<li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li>
126 126
 			    	</ul>
127 127
 
128 128
 			    <?php endif; ?>
@@ -139,61 +139,61 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	function lasso_preflight_check() {
141 141
 
142
-		$notices 		= array();
142
+		$notices = array();
143 143
 
144
-		$article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' );
144
+		$article_object = lasso_editor_get_option('article_class', 'lasso_editor');
145 145
 
146
-		$theme_name  	= wp_get_theme()->get('Name');
147
-		$theme_class  	= lasso_get_supported_theme_class();
146
+		$theme_name = wp_get_theme()->get('Name');
147
+		$theme_class = lasso_get_supported_theme_class();
148 148
 
149
-		$license   		= get_option( 'lasso_license_key' );
150
-		$status   		= get_option( 'lasso_license_status' );
149
+		$license = get_option('lasso_license_key');
150
+		$status = get_option('lasso_license_status');
151 151
 
152 152
 		// if the required CSS class has not been saved and we're not a supported theme
153
-		if ( empty( $article_object ) && false == $theme_class ) {
153
+		if (empty($article_object) && false == $theme_class) {
154 154
 
155 155
 			// we dont automatically support this theme so show them otherwise
156 156
 			$notices[] = sprintf('<li class="error">
157
-							<h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3>
158
-							<p>'.__( 'Before using Editus,', 'lasso' ).' <a href="%s">'.__( 'enter and save', 'lasso' ).'</a> '.__( 'the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso' ).' <a href="mailto:[email protected]">'.__( 'email us.', 'lasso' ).'</a> '.__( 'with a link to a public URL with the theme and we\'ll find it for you.', 'lasso' ).'</p>
159
-							</li>', admin_url( 'admin.php?page=lasso-editor-settings' ) );
157
+							<h3>'.__('Article CSS Class Needed!', 'lasso').'</h3>
158
+							<p>'.__('Before using Editus,', 'lasso').' <a href="%s">'.__('enter and save', 'lasso').'</a> '.__('the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso').' <a href="mailto:[email protected]">'.__('email us.', 'lasso').'</a> '.__('with a link to a public URL with the theme and we\'ll find it for you.', 'lasso').'</p>
159
+							</li>', admin_url('admin.php?page=lasso-editor-settings'));
160 160
 		}
161 161
 
162 162
 		// WP REST API not active
163
-		if ( !function_exists( 'json_get_url_prefix' ) ) {
163
+		if (!function_exists('json_get_url_prefix')) {
164 164
 			$notices[] = '<li class="info"><h3>WP REST API not Activated!</h3>
165
-							<p>'.__( 'Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end. It is required until WordPress officially merges the REST API into core sometime during 2015.', 'lasso' ).'</p>
165
+							<p>'.__('Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end. It is required until WordPress officially merges the REST API into core sometime during 2015.', 'lasso').'</p>
166 166
 							</li>';
167 167
 		}
168 168
 
169 169
 		// aesop story engine isnt active
170
-		if ( !class_exists( 'Aesop_Core' ) ) {
171
-			$notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3>
172
-							<p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank
173
-							">'.__( 'Aesop Story Engine', 'lasso' ).'</a> '.__( 'isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso' ).'</p>
174
-							</li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') );
170
+		if (!class_exists('Aesop_Core')) {
171
+			$notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3>
172
+							<p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank
173
+							">'.__('Aesop Story Engine', 'lasso').'</a> '.__('isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso').'</p>
174
+							</li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine'));
175 175
 		}
176 176
 
177 177
 		// we dont really get along with wp side comments because of the section ids that get applied dynamically. since we save our html, it'll get saved along with the post as HTML
178
-		if ( class_exists( 'WP_Side_Comments' ) ) {
179
-			$notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3>
180
-							<p>'.__( 'Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso' ).'</p>
178
+		if (class_exists('WP_Side_Comments')) {
179
+			$notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3>
180
+							<p>'.__('Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso').'</p>
181 181
 							</li>';
182 182
 		}
183 183
 
184 184
 		// if the license key isnt activated
185
-		if ( empty( $license ) ) {
186
-			$notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3>
187
-							<p>'.__( 'Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso' ).'</p>
185
+		if (empty($license)) {
186
+			$notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3>
187
+							<p>'.__('Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso').'</p>
188 188
 							</li>';
189 189
 		}
190
-		if ( !empty( $license ) && 'invalid' == $status ) {
191
-			$notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3>
192
-							<p>'.__( 'The license key that you entered is ', 'lasso' ).'<strong>'.__( 'invalid', 'lasso' ).'</strong>'.__( '. It may have been entered incorreclty, or may have expired.', 'lasso' ).'</p>
190
+		if (!empty($license) && 'invalid' == $status) {
191
+			$notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3>
192
+							<p>'.__('The license key that you entered is ', 'lasso').'<strong>'.__('invalid', 'lasso').'</strong>'.__('. It may have been entered incorreclty, or may have expired.', 'lasso').'</p>
193 193
 							</li>';
194 194
 		}
195 195
 
196
-		return apply_filters( 'lasso_preflight_notices', $notices );
196
+		return apply_filters('lasso_preflight_notices', $notices);
197 197
 
198 198
 	}
199 199
 
@@ -207,13 +207,13 @@  discard block
 block discarded – undo
207 207
 	    $plugins = array(
208 208
 
209 209
 	        array(
210
-	            'name'      => __('WP REST API','lasso'),
210
+	            'name'      => __('WP REST API', 'lasso'),
211 211
 	            'slug'      => 'json-rest-api',
212 212
 	            'required'  => true,
213 213
 	        ),
214 214
 
215 215
 	        array(
216
-	            'name'      => __('Aesop Story Engine','lasso'),
216
+	            'name'      => __('Aesop Story Engine', 'lasso'),
217 217
 	            'slug'      => 'aesop-story-engine',
218 218
 	            'required'  => false,
219 219
 	        ),
@@ -221,36 +221,36 @@  discard block
 block discarded – undo
221 221
 	    );
222 222
 
223 223
 	    $config = array(
224
-	        'default_path' => '',                      // Default absolute path to pre-packaged plugins.
224
+	        'default_path' => '', // Default absolute path to pre-packaged plugins.
225 225
 	        'menu'         => 'lasso-install-plugins', // Menu slug.
226
-	        'has_notices'  => true,                    // Show admin notices or not.
227
-	        'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
228
-	        'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
229
-	        'is_automatic' => false,                   // Automatically activate plugins after installation or not.
230
-	        'message'      => '',                      // Message to output right before the plugins table.
226
+	        'has_notices'  => true, // Show admin notices or not.
227
+	        'dismissable'  => true, // If false, a user cannot dismiss the nag message.
228
+	        'dismiss_msg'  => '', // If 'dismissable' is false, this message will be output at top of nag.
229
+	        'is_automatic' => false, // Automatically activate plugins after installation or not.
230
+	        'message'      => '', // Message to output right before the plugins table.
231 231
 	        'strings'      => array(
232
-	            'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
233
-	            'menu_title'                      => __( 'Install Plugins', 'lasso' ),
234
-	            'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
235
-	            'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
236
-	            'notice_can_install_required'     => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s).
237
-	            'notice_can_install_recommended'  => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).
238
-	            'notice_cannot_install'           => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).
239
-	            'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
240
-	            'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
241
-	            'notice_cannot_activate'          => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).
242
-	            'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s).
243
-	            'notice_cannot_update'            => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).
244
-	            'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
245
-	            'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
246
-	            'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
247
-	            'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
248
-	            'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
232
+	            'page_title'                      => __('Install Required Plugins', 'lasso'),
233
+	            'menu_title'                      => __('Install Plugins', 'lasso'),
234
+	            'installing'                      => __('Installing Plugin: %s', 'lasso'), // %s = plugin name.
235
+	            'oops'                            => __('Something went wrong with the plugin API.', 'lasso'),
236
+	            'notice_can_install_required'     => _n_noop('This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.'), // %1$s = plugin name(s).
237
+	            'notice_can_install_recommended'  => _n_noop('This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.'), // %1$s = plugin name(s).
238
+	            'notice_cannot_install'           => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), // %1$s = plugin name(s).
239
+	            'notice_can_activate_required'    => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), // %1$s = plugin name(s).
240
+	            'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), // %1$s = plugin name(s).
241
+	            'notice_cannot_activate'          => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), // %1$s = plugin name(s).
242
+	            'notice_ask_to_update'            => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.'), // %1$s = plugin name(s).
243
+	            'notice_cannot_update'            => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), // %1$s = plugin name(s).
244
+	            'install_link'                    => _n_noop('Begin installing plugin', 'Begin installing plugins'),
245
+	            'activate_link'                   => _n_noop('Begin activating plugin', 'Begin activating plugins'),
246
+	            'return'                          => __('Return to Required Plugins Installer', 'lasso'),
247
+	            'plugin_activated'                => __('Plugin activated successfully.', 'lasso'),
248
+	            'complete'                        => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link.
249 249
 	            'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
250 250
 	        )
251 251
 	    );
252 252
 
253
-	    tgmpa( $plugins, $config );
253
+	    tgmpa($plugins, $config);
254 254
 
255 255
 	}
256 256
 }
Please login to merge, or discard this patch.
bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 /*----------------------------------------------------------------------------*
10 10
  * Register Autoloader
11 11
  *----------------------------------------------------------------------------*/
12
-include_once( LASSO_DIR . '/includes/lasso_autoloader.php' );
12
+include_once(LASSO_DIR.'/includes/lasso_autoloader.php');
13 13
 $loader = new lasso_autoloader();
14 14
 
15 15
 $loader->register();
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
  *----------------------------------------------------------------------------*/
20 20
 //require_once plugin_dir_path( __FILE__ ) . 'public/class-lasso.php';
21 21
 
22
-$loader->addNamespace('lasso', LASSO_DIR . 'includes' );
23
-$loader->addNamespace('lasso_public_facing', LASSO_DIR . 'public/includes' );
24
-$loader->addNamespace('lasso\internal_api', LASSO_DIR . 'internal-api' );
22
+$loader->addNamespace('lasso', LASSO_DIR.'includes');
23
+$loader->addNamespace('lasso_public_facing', LASSO_DIR.'public/includes');
24
+$loader->addNamespace('lasso\internal_api', LASSO_DIR.'internal-api');
25 25
 new lasso\internal_api\end_points();
26 26
 
27
-register_activation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'activate' ) );
28
-register_deactivation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'deactivate' ) );
27
+register_activation_hook(__FILE__, array('lasso_public_facing\lasso', 'activate'));
28
+register_deactivation_hook(__FILE__, array('lasso_public_facing\lasso', 'deactivate'));
29 29
 
30
-add_action( 'plugins_loaded', array( 'lasso_public_facing\lasso', 'get_instance' ) );
30
+add_action('plugins_loaded', array('lasso_public_facing\lasso', 'get_instance'));
31 31
 
32 32
 //load tour
33
-add_action(  'init', function() {
34
-	if (! is_admin() && is_user_logged_in() ) {
33
+add_action('init', function() {
34
+	if (!is_admin() && is_user_logged_in()) {
35 35
 		new \lasso_public_facing\tour();
36 36
 	}
37 37
 });
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
  * Dashboard and Administrative Functionality
42 42
  *----------------------------------------------------------------------------*/
43 43
 
44
-if ( is_admin() ) {
45
-	$loader->addNamespace('lasso_admin', LASSO_DIR . 'admin/includes' );
46
-	add_action( 'plugins_loaded', array( 'lasso_admin\load_admin', 'get_instance' ) );
44
+if (is_admin()) {
45
+	$loader->addNamespace('lasso_admin', LASSO_DIR.'admin/includes');
46
+	add_action('plugins_loaded', array('lasso_admin\load_admin', 'get_instance'));
47 47
 
48 48
 }
Please login to merge, or discard this patch.
includes/lasso_autoloader.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@
 block discarded – undo
115 115
 			// replace namespace separators with directory separators
116 116
 			// in the relative class name, append with .php
117 117
 			$file = $base_dir
118
-			        . str_replace('\\', '/', $relative_class)
119
-			        . '.php';
118
+					. str_replace('\\', '/', $relative_class)
119
+					. '.php';
120 120
 
121 121
 			// if the mapped file exists, require it
122 122
 			if ($this->requireFile($file)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 	 */
41 41
 	public function addNamespace($prefix, $base_dir, $prepend = false) {
42 42
 		// normalize namespace prefix
43
-		$prefix = trim($prefix, '\\') . '\\';
43
+		$prefix = trim($prefix, '\\').'\\';
44 44
 
45 45
 		// normalize the base directory with a trailing separator
46
-		$base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';
46
+		$base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR).'/';
47 47
 
48 48
 		// initialize the namespace prefix array
49 49
 		if (isset($this->prefixes[$prefix]) === false) {
Please login to merge, or discard this patch.
includes/process/delete.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 	 *
26 26
 	 * @since 1.0
27 27
 	 */
28
-	public function post( $data ) {
28
+	public function post($data) {
29 29
 
30
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
30
+		$postid = isset($data['postid']) ? $data['postid'] : false;
31 31
 
32 32
 		// bail out if teh current user can't publish posts
33
-		if ( !lasso_user_can( 'delete_post', $postid ) )
33
+		if (!lasso_user_can('delete_post', $postid))
34 34
 			return;
35 35
 
36 36
 		$args = array(
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 			'post_status' 	=> 'trash'
39 39
 		);
40 40
 
41
-		wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) );
41
+		wp_update_post(apply_filters('lasso_object_deleted_args', $args));
42 42
 
43
-		do_action( 'lasso_object_deleted', $postid, get_current_user_ID() );
43
+		do_action('lasso_object_deleted', $postid, get_current_user_ID());
44 44
 
45 45
 		return true;
46 46
 	}
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
54 54
 	 */
55
-	public static function params(){
56
-		$params[ 'process_delete_post' ] = array(
55
+	public static function params() {
56
+		$params['process_delete_post'] = array(
57 57
 			'postid' => 'absint',
58 58
 		);
59 59
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return array Array of additional functions to use to authorize action.
69 69
 	 */
70 70
 	public static function auth_callbacks() {
71
-		$params[ 'process_delete_post' ] = array(
71
+		$params['process_delete_post'] = array(
72 72
 			'lasso_user_can'
73 73
 		);
74 74
 
Please login to merge, or discard this patch.
includes/process/map.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,27 +28,27 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function save( $data ) {
31
+	public function save($data) {
32 32
 
33
-		$postid     	= isset( $data['postid'] ) ? $data['postid'] : false;
34
-		$locations    	= isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false;
35
-		$start_point    = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false;
36
-		$zoom       	= isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false;
33
+		$postid     	= isset($data['postid']) ? $data['postid'] : false;
34
+		$locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false;
35
+		$start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false;
36
+		$zoom       	= isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false;
37 37
 
38
-		if ( is_array( $locations ) ) {
39
-			delete_post_meta( $postid, 'ase_map_component_locations' );
38
+		if (is_array($locations)) {
39
+			delete_post_meta($postid, 'ase_map_component_locations');
40 40
 
41 41
 			// update locations if set
42
-			foreach ( $locations as $location ) {
43
-				$point = json_decode( urldecode( $location ), true );
44
-				add_post_meta( $postid, 'ase_map_component_locations', $point );
42
+			foreach ($locations as $location) {
43
+				$point = json_decode(urldecode($location), true);
44
+				add_post_meta($postid, 'ase_map_component_locations', $point);
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-			update_post_meta( $postid, 'ase_map_component_start_point', $start_point );
48
+			update_post_meta($postid, 'ase_map_component_start_point', $start_point);
49 49
 
50 50
 			// update zoom
51
-			update_post_meta( $postid, 'ase_map_component_zoom', $zoom );
51
+			update_post_meta($postid, 'ase_map_component_zoom', $zoom);
52 52
 		}
53 53
 
54 54
 		return true;
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
64 64
 	 */
65
-	public static function params(){
66
-		$params[ 'process_map_save' ] = array(
65
+	public static function params() {
66
+		$params['process_map_save'] = array(
67 67
 			'postid' => 'absint',
68 68
 			'ase-map-component-locations' => 'lasso_sanitize_data',
69 69
 			'ase-map-component-start-point' => array(
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @return array Array of additional functions to use to authorize action.
88 88
 	 */
89 89
 	public static function auth_callbacks() {
90
-		$params[ 'process_map_save' ] = array(
90
+		$params['process_map_save'] = array(
91 91
 			'lasso_user_can'
92 92
 		);
93 93
 
Please login to merge, or discard this patch.
includes/process/meta.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return bool Always returns true.
30 30
 	 */
31
-	public function update( $data ) {
31
+	public function update($data) {
32 32
 
33
-		$post_id = isset( $data['post_id'] ) ? $data['post_id'] : false;
33
+		$post_id = isset($data['post_id']) ? $data['post_id'] : false;
34 34
 
35 35
 			
36 36
 		/**
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 		 *
41 41
 		 * @param array $allowed_fields The fields
42 42
 		 */
43
-		$allowed_fields = apply_filters( 'lasso_meta_fields', array() );
44
-		if ( ! empty( $allowed_fields ) ) {
45
-			foreach( $allowed_fields as $field ) {
46
-				if ( isset( $data[ $field ] ) ) {
47
-					update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ]  );
43
+		$allowed_fields = apply_filters('lasso_meta_fields', array());
44
+		if (!empty($allowed_fields)) {
45
+			foreach ($allowed_fields as $field) {
46
+				if (isset($data[$field])) {
47
+					update_post_meta($post_id, lasso_unclean_string($field), $data[$field]);
48 48
 				}
49 49
 			}
50 50
 		}
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return array Array of keys to pull from $data per action and their sanitization callback
64 64
 	 */
65
-	public static function params(){
66
-		$params[ 'process_meta_update' ] = array(
65
+	public static function params() {
66
+		$params['process_meta_update'] = array(
67 67
 			'post_id' 	=> 'absint',
68 68
 			'tab_name'	=> 'trim'
69 69
 		);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 * @return array Array of additional functions to use to authorize action.
81 81
 	 */
82 82
 	public static function auth_callbacks() {
83
-		$params[ 'process_meta_update' ] = array(
83
+		$params['process_meta_update'] = array(
84 84
 			'lasso_user_can'
85 85
 		);
86 86
 
Please login to merge, or discard this patch.
includes/process/new_object.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,26 +28,26 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @since 1.0
30 30
 	 */
31
-	public function post( $data ) {
31
+	public function post($data) {
32 32
 
33
-		$title  = $data[ 'story_title' ];
33
+		$title  = $data['story_title'];
34 34
 
35
-		$object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ];
35
+		$object = is_null($data['object']) ? false : $data['object'];
36 36
 
37 37
 		// insert a new post
38 38
 		$args = array(
39 39
 			'post_title'    => $title,
40 40
 			'post_status'   => 'draft',
41 41
 			'post_type'    	=> $object,
42
-			'post_content'  => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') )
42
+			'post_content'  => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso'))
43 43
 		);
44 44
 
45
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) );
45
+		$postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args));
46 46
 
47
-		do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() );
47
+		do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID());
48 48
 
49 49
 		return array(
50
-			'postlink' => get_permalink( $postid )
50
+			'postlink' => get_permalink($postid)
51 51
 		);
52 52
 
53 53
 	}
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
61 61
 	 */
62 62
 	public static function params() {
63
-		$params[ 'process_new_object_post' ] = array(
64
-			'story_title' => array( 'wp_strip_all_tags', 'trim' ),
63
+		$params['process_new_object_post'] = array(
64
+			'story_title' => array('wp_strip_all_tags', 'trim'),
65 65
 			'object' => 'trim'
66 66
 		);
67 67
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return array Array of additional functions to use to authorize action.
78 78
 	 */
79 79
 	public static function auth_callbacks() {
80
-		$params[ 'process_new_object_post' ] = array();
80
+		$params['process_new_object_post'] = array();
81 81
 
82 82
 		return $params;
83 83
 
Please login to merge, or discard this patch.