Completed
Push — master ( 984ede...78ac8b )
by
unknown
02:01
created
admin/includes/menus/license.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -6,28 +6,28 @@  discard block
 block discarded – undo
6 6
 
7 7
 	function __construct() {
8 8
 
9
-		define( 'LASSO_STORE_ITEM_NAME', 'lasso' );
10
-		define( 'LASSO_STORE_URL', 'https://edituswp.com' );
11
-
12
-		add_action( 'admin_init',  array( $this, 'plugin_updater' ), 0 );
13
-		add_action( 'admin_menu',  array( $this, 'license_menu' ) );
14
-		add_action( 'network_admin_menu',  array( $this, 'license_menu' ) ); // CHANGED Added hook.
15
-		add_action( 'admin_init',  array( $this, 'register_option' ) );
16
-		add_action( 'admin_init',  array( $this, 'activate_license' ) );
17
-		add_action( 'admin_init',  array( $this, 'deactivate_license' ) );
9
+		define('LASSO_STORE_ITEM_NAME', 'lasso');
10
+		define('LASSO_STORE_URL', 'https://edituswp.com');
11
+
12
+		add_action('admin_init', array($this, 'plugin_updater'), 0);
13
+		add_action('admin_menu', array($this, 'license_menu'));
14
+		add_action('network_admin_menu', array($this, 'license_menu')); // CHANGED Added hook.
15
+		add_action('admin_init', array($this, 'register_option'));
16
+		add_action('admin_init', array($this, 'activate_license'));
17
+		add_action('admin_init', array($this, 'deactivate_license'));
18 18
 	}
19 19
 
20 20
 	function plugin_updater() {
21 21
 
22 22
 		// retrieve our license key from the DB
23
-		$license_key = trim( get_option( 'lasso_license_key' ) );
23
+		$license_key = trim(get_option('lasso_license_key'));
24 24
 
25 25
 		// setup the updater
26
-		$edd_updater = new \EDD_SL_Plugin_Updater( LASSO_STORE_URL , LASSO_FILE, array(
26
+		$edd_updater = new \EDD_SL_Plugin_Updater(LASSO_STORE_URL, LASSO_FILE, array(
27 27
 				'version'  => LASSO_VERSION,
28 28
 				'license'  => $license_key,
29 29
 				'item_name' => LASSO_STORE_ITEM_NAME,
30
-				'author'  => __( 'Aesopinteractive LLC', 'lasso' )
30
+				'author'  => __('Aesopinteractive LLC', 'lasso')
31 31
 			)
32 32
 		);
33 33
 
@@ -35,51 +35,51 @@  discard block
 block discarded – undo
35 35
 	function license_menu() {
36 36
 
37 37
 		// CHANGED Removed condition.
38
-		add_submenu_page( 'lasso-editor', __( 'License Key', 'lasso' ), __( 'License', 'lasso' ), 'manage_options', 'lasso-license', array( $this, 'license_page' ) );
38
+		add_submenu_page('lasso-editor', __('License Key', 'lasso'), __('License', 'lasso'), 'manage_options', 'lasso-license', array($this, 'license_page'));
39 39
 
40 40
 	}
41 41
 	function license_page() {
42
-		$license  = get_option( 'lasso_license_key' );
43
-		$status  = get_option( 'lasso_license_status' );
42
+		$license = get_option('lasso_license_key');
43
+		$status = get_option('lasso_license_status');
44 44
 
45 45
 ?>
46 46
 		<div class="wrap">
47
-			<h2><?php _e( 'Editus License', 'lasso' ); ?></h2>
48
-			<p><?php _e( 'Input the license key you recieved with your purchase to ensure your version of Editus stays updated.', 'lasso' );?></p>
47
+			<h2><?php _e('Editus License', 'lasso'); ?></h2>
48
+			<p><?php _e('Input the license key you recieved with your purchase to ensure your version of Editus stays updated.', 'lasso'); ?></p>
49 49
 			<form class="lasso--form-settings" method="post" action="options.php">
50 50
 
51
-				<?php settings_fields( 'lasso_license' ); ?>
51
+				<?php settings_fields('lasso_license'); ?>
52 52
 
53 53
 				<table class="form-table">
54 54
 					<tbody>
55 55
 						<tr valign="top">
56 56
 							<th scope="row" valign="top">
57
-								<?php _e( 'License Key', 'lasso' ); ?>
57
+								<?php _e('License Key', 'lasso'); ?>
58 58
 							</th>
59 59
 							<td>
60
-								<input id="lasso_license_key" name="lasso_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $license ); ?>" />
60
+								<input id="lasso_license_key" name="lasso_license_key" type="text" class="regular-text" value="<?php esc_attr_e($license); ?>" />
61 61
 							</td>
62 62
 						</tr>
63
-						<?php if ( false !== $license ) { ?>
63
+						<?php if (false !== $license) { ?>
64 64
 							<tr valign="top">
65 65
 								<th scope="row" valign="top">
66
-									<?php _e( 'Activate License', 'lasso' ); ?>
66
+									<?php _e('Activate License', 'lasso'); ?>
67 67
 								</th>
68 68
 								<td>
69
-									<?php if ( $status !== false && $status == 'valid' ) { ?>
70
-										<span style="color:green;"><?php _e( 'active' ); ?></span>
71
-										<?php wp_nonce_field( 'lasso_license_nonce', 'lasso_license_nonce' ); ?>
72
-										<input type="submit" class="button-secondary" name="edd_license_deactivate" value="<?php esc_attr_e( 'Deactivate License', 'lasso' ); ?>"/>
69
+									<?php if ($status !== false && $status == 'valid') { ?>
70
+										<span style="color:green;"><?php _e('active'); ?></span>
71
+										<?php wp_nonce_field('lasso_license_nonce', 'lasso_license_nonce'); ?>
72
+										<input type="submit" class="button-secondary" name="edd_license_deactivate" value="<?php esc_attr_e('Deactivate License', 'lasso'); ?>"/>
73 73
 									<?php } else {
74
-				wp_nonce_field( 'lasso_license_nonce', 'lasso_license_nonce' ); ?>
75
-										<input type="submit" class="button-secondary" name="edd_license_activate" value="<?php esc_attr_e( 'Activate License', 'lasso' ); ?>"/>
74
+				wp_nonce_field('lasso_license_nonce', 'lasso_license_nonce'); ?>
75
+										<input type="submit" class="button-secondary" name="edd_license_activate" value="<?php esc_attr_e('Activate License', 'lasso'); ?>"/>
76 76
 									<?php } ?>
77 77
 								</td>
78 78
 							</tr>
79 79
 						<?php } ?>
80 80
 					</tbody>
81 81
 				</table>
82
-				<?php submit_button( 'Save License' ); ?>
82
+				<?php submit_button('Save License'); ?>
83 83
 
84 84
 			</form>
85 85
 		<?php
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 	// register option
89 89
 	function register_option() {
90 90
 
91
-		register_setting( 'lasso_license', 'lasso_license_key', array( $this, 'sanitize_license' ) );
91
+		register_setting('lasso_license', 'lasso_license_key', array($this, 'sanitize_license'));
92 92
 	}
93 93
 
94 94
 	// santize
95
-	function sanitize_license( $new ) {
96
-		$old = get_option( 'lasso_license_key' );
97
-		if ( $old && $old != $new ) {
98
-			delete_option( 'lasso_license_status' ); // new license has been entered, so must reactivate
95
+	function sanitize_license($new) {
96
+		$old = get_option('lasso_license_key');
97
+		if ($old && $old != $new) {
98
+			delete_option('lasso_license_status'); // new license has been entered, so must reactivate
99 99
 		}
100 100
 		return $new;
101 101
 	}
@@ -104,36 +104,36 @@  discard block
 block discarded – undo
104 104
 	function activate_license() {
105 105
 
106 106
 		// listen for our activate button to be clicked
107
-		if ( isset( $_POST['edd_license_activate'] ) ) {
107
+		if (isset($_POST['edd_license_activate'])) {
108 108
 
109 109
 			// run a quick security check
110
-			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) )
110
+			if (!check_admin_referer('lasso_license_nonce', 'lasso_license_nonce'))
111 111
 				return; // get out if we didn't click the Activate button
112 112
 
113 113
 			// retrieve the license from the database
114
-			$license = trim( get_option( 'lasso_license_key' ) );
114
+			$license = trim(get_option('lasso_license_key'));
115 115
 
116 116
 			// data to send in our API request
117 117
 			$api_params = array(
118 118
 				'edd_action'=> 'activate_license',
119 119
 				'license'  => $license,
120
-				'item_name' => urlencode( LASSO_STORE_ITEM_NAME ), // the name of our product in EDD
120
+				'item_name' => urlencode(LASSO_STORE_ITEM_NAME), // the name of our product in EDD
121 121
 				'url'       => home_url()
122 122
 			);
123 123
 
124 124
 			// Call the custom API.
125
-			$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
125
+			$response = wp_remote_post(LASSO_STORE_URL, array('body' => $api_params, 'timeout' => 15, 'sslverify' => false));
126 126
 
127 127
 			// make sure the response came back okay
128
-			if ( is_wp_error( $response ) )
128
+			if (is_wp_error($response))
129 129
 				return false;
130 130
 
131 131
 			// decode the license data
132
-			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
132
+			$license_data = json_decode(wp_remote_retrieve_body($response));
133 133
 
134 134
 			// $license_data->license will be either "valid" or "invalid"
135 135
 
136
-			update_option( 'lasso_license_status', $license_data->license );
136
+			update_option('lasso_license_status', $license_data->license);
137 137
 
138 138
 		}
139 139
 	}
@@ -141,37 +141,37 @@  discard block
 block discarded – undo
141 141
 	function deactivate_license() {
142 142
 
143 143
 		// listen for our activate button to be clicked
144
-		if ( isset( $_POST['edd_license_deactivate'] ) ) {
144
+		if (isset($_POST['edd_license_deactivate'])) {
145 145
 
146 146
 			// run a quick security check
147
-			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) )
147
+			if (!check_admin_referer('lasso_license_nonce', 'lasso_license_nonce'))
148 148
 				return; // get out if we didn't click the Activate button
149 149
 
150 150
 			// retrieve the license from the database
151
-			$license = trim( get_option( 'lasso_license_key' ) );
151
+			$license = trim(get_option('lasso_license_key'));
152 152
 
153 153
 
154 154
 			// data to send in our API request
155 155
 			$api_params = array(
156 156
 				'edd_action'=> 'deactivate_license',
157 157
 				'license'  => $license,
158
-				'item_name' => urlencode( LASSO_STORE_ITEM_NAME ), // the name of our product in EDD
158
+				'item_name' => urlencode(LASSO_STORE_ITEM_NAME), // the name of our product in EDD
159 159
 				'url'       => home_url()
160 160
 			);
161 161
 
162 162
 			// Call the custom API.
163
-			$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
163
+			$response = wp_remote_post(LASSO_STORE_URL, array('body' => $api_params, 'timeout' => 15, 'sslverify' => false));
164 164
 
165 165
 			// make sure the response came back okay
166
-			if ( is_wp_error( $response ) )
166
+			if (is_wp_error($response))
167 167
 				return false;
168 168
 
169 169
 			// decode the license data
170
-			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
170
+			$license_data = json_decode(wp_remote_retrieve_body($response));
171 171
 
172 172
 			// $license_data->license will be either "deactivated" or "failed"
173
-			if ( $license_data->license == 'deactivated' )
174
-				delete_option( 'lasso_license_status' );
173
+			if ($license_data->license == 'deactivated')
174
+				delete_option('lasso_license_status');
175 175
 
176 176
 		}
177 177
 	}
@@ -181,24 +181,24 @@  discard block
 block discarded – undo
181 181
 
182 182
 		global $wp_version;
183 183
 
184
-		$license = trim( get_option( 'lasso_license_key' ) );
184
+		$license = trim(get_option('lasso_license_key'));
185 185
 
186 186
 		$api_params = array(
187 187
 			'edd_action' => 'check_license',
188 188
 			'license' => $license,
189
-			'item_name' => urlencode( LASSO_STORE_ITEM_NAME ),
189
+			'item_name' => urlencode(LASSO_STORE_ITEM_NAME),
190 190
 			'url'       => home_url()
191 191
 		);
192 192
 
193 193
 		// Call the custom API.
194
-		$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
194
+		$response = wp_remote_post(LASSO_STORE_URL, array('body' => $api_params, 'timeout' => 15, 'sslverify' => false));
195 195
 
196
-		if ( is_wp_error( $response ) )
196
+		if (is_wp_error($response))
197 197
 			return false;
198 198
 
199
-		$license_data = json_decode( wp_remote_retrieve_body( $response ) );
199
+		$license_data = json_decode(wp_remote_retrieve_body($response));
200 200
 
201
-		if ( $license_data->license == 'valid' ) {
201
+		if ($license_data->license == 'valid') {
202 202
 			echo 'valid'; exit;
203 203
 			// this license is still valid
204 204
 		} else {
Please login to merge, or discard this patch.
includes/process/gallery.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return array Key "markup" has the HTML.
31 31
 	 */
32
-	public function swap( $data ) {
32
+	public function swap($data) {
33 33
 
34 34
 
35
-		$id = $data[ 'gallery_id' ];
36
-		if ( is_null( $id ) ) {
35
+		$id = $data['gallery_id'];
36
+		if (is_null($id)) {
37 37
 			$id = false;
38 38
 		}
39 39
 
40
-		$markup = sprintf( '<div contenteditable="false" class="lasso--empty-component aesop-component aesop-gallery-component" data-component-type="gallery" data-id="%s">%s</div>', $id, __( 'Save and refresh to view gallery.','lasso' ) );
40
+		$markup = sprintf('<div contenteditable="false" class="lasso--empty-component aesop-component aesop-gallery-component" data-component-type="gallery" data-id="%s">%s</div>', $id, __('Save and refresh to view gallery.', 'lasso'));
41 41
 
42 42
 		return array(
43 43
 			'gallery' => $markup
@@ -54,49 +54,49 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @return array|bool On success an array containing "message" or on failure false.
56 56
 	 */
57
-	public function create( $data ) {
57
+	public function create($data) {
58 58
 
59 59
 		//@todo adapt auth callbacks to work with args.
60
-		if (  ! lasso_user_can( 'publish_posts' ) ) {
60
+		if (!lasso_user_can('publish_posts')) {
61 61
 			return false;
62 62
 
63 63
 		}
64 64
 
65
-		$gallery_ids = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false;
65
+		$gallery_ids = isset($data['gallery_ids']) ? $data['gallery_ids'] : false;
66 66
 
67 67
 		// bail if no gallery ids
68
-		if ( empty( $gallery_ids ) ) {
68
+		if (empty($gallery_ids)) {
69 69
 			return false;
70 70
 		}
71 71
 
72
-		$postid   		 = isset( $data['postid'] ) ? (int) $data['postid'] : false;
73
-		$type   		 = isset( $data['gallery_type'] ) ? $data['gallery_type'] : false;
74
-		$edgallerytitle	 = isset( $data['edgallerytitle'] ) ? $data['edgallerytitle'] : $postid.'-'.rand();
72
+		$postid = isset($data['postid']) ? (int) $data['postid'] : false;
73
+		$type = isset($data['gallery_type']) ? $data['gallery_type'] : false;
74
+		$edgallerytitle = isset($data['edgallerytitle']) ? $data['edgallerytitle'] : $postid.'-'.rand();
75 75
 
76 76
 		// insert a new gallery
77 77
 		$args = array(
78
-			'post_title'    => $edgallerytitle ,
78
+			'post_title'    => $edgallerytitle,
79 79
 			'post_status'   => 'publish',
80 80
 			'post_type'     => 'ai_galleries'
81 81
 		);
82 82
 
83
-		$postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) );
83
+		$postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args));
84 84
 
85 85
 		// update gallery ids
86
-		if ( $gallery_ids ) {
86
+		if ($gallery_ids) {
87 87
 
88
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
88
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
89 89
 
90 90
 		}
91 91
 
92 92
 		// update the gallery type
93
-		if ( !empty( $type ) ) {
93
+		if (!empty($type)) {
94 94
 
95
-			update_post_meta( $postid, 'aesop_gallery_type', $type );
95
+			update_post_meta($postid, 'aesop_gallery_type', $type);
96 96
 
97 97
 		}
98 98
 
99
-		do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() );
99
+		do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID());
100 100
 
101 101
 		return array(
102 102
 			'message' => 'gallery-created',
@@ -114,20 +114,20 @@  discard block
 block discarded – undo
114 114
 	 *
115 115
 	 * @return array "message" key has the message.
116 116
 	 */
117
-	public function update( $data ) {
118
-
119
-		$options      = isset( $data['fields'] ) ? $data['fields'] : false;
120
-		$postid   	  = !empty( $options ) ? (int) $options['id'] : false;
121
-		$gallery_ids  = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false;
122
-		if ( ! empty( $data ) && $data[ 'gallery_type' ] ) {
123
-			$type = $data[ 'gallery_type' ];
124
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
125
-			$type = $options[ 'galleryType' ];
126
-		}else{
117
+	public function update($data) {
118
+
119
+		$options      = isset($data['fields']) ? $data['fields'] : false;
120
+		$postid = !empty($options) ? (int) $options['id'] : false;
121
+		$gallery_ids  = isset($data['gallery_ids']) ? $data['gallery_ids'] : false;
122
+		if (!empty($data) && $data['gallery_type']) {
123
+			$type = $data['gallery_type'];
124
+		}elseif (!empty($options) && $options['galleryType']) {
125
+			$type = $options['galleryType'];
126
+		} else {
127 127
 			$type = false;
128 128
 		}
129 129
 
130
-		save_gallery::save_gallery_options( $postid, $gallery_ids, $options, $type );
130
+		save_gallery::save_gallery_options($postid, $gallery_ids, $options, $type);
131 131
 
132 132
 		return array(
133 133
 			'message' => 'gallery-updated'
@@ -145,25 +145,25 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @return bool
147 147
 	 */
148
-	public function get_images( $data ) {
148
+	public function get_images($data) {
149 149
 
150 150
 		//check caps
151
-		if ( !current_user_can( 'edit_posts' ) ) {
151
+		if (!current_user_can('edit_posts')) {
152 152
 			return false;
153 153
 		}
154 154
 
155 155
 		// bail if no id specified like on new galleries
156
-		if ( is_null( $data['post_id'] ) || empty( $data['post_id'] ) ) {
156
+		if (is_null($data['post_id']) || empty($data['post_id'])) {
157 157
 			return false;
158 158
 		}
159 159
 
160
-		$postid  = isset( $data['post_id'] ) ? $data['post_id'] : false;
160
+		$postid = isset($data['post_id']) ? $data['post_id'] : false;
161 161
 
162 162
 		// fetch image ids from cache
163
-		$image_ids  = get_post_meta( $postid, '_ase_gallery_images', true );
163
+		$image_ids = get_post_meta($postid, '_ase_gallery_images', true);
164 164
 
165 165
 		// send ids to return images
166
-		return self::get_the_images( $image_ids );
166
+		return self::get_the_images($image_ids);
167 167
 
168 168
 	}
169 169
 
@@ -173,32 +173,32 @@  discard block
 block discarded – undo
173 173
 	 * @param $image_ids array array of image ids
174 174
 	 * @since 0.1
175 175
 	 */
176
-	private function get_the_images( $image_ids = '' ) {
176
+	private function get_the_images($image_ids = '') {
177 177
 
178
-		if ( empty( $image_ids ) )
178
+		if (empty($image_ids))
179 179
 			return;
180 180
 
181
-		$image_ids  = array_map( 'intval', explode( ',', $image_ids ) );
181
+		$image_ids = array_map('intval', explode(',', $image_ids));
182 182
 
183 183
 		$out[] = '<ul id="ase-gallery-images">';
184 184
 
185
-		if ( !empty( $image_ids ) ):
185
+		if (!empty($image_ids)):
186 186
 
187
-			foreach ( $image_ids as $image_id ) {
187
+			foreach ($image_ids as $image_id) {
188 188
 
189
-				$image    =  wp_get_attachment_image_src( $image_id, 'thumbnail', false );
189
+				$image = wp_get_attachment_image_src($image_id, 'thumbnail', false);
190 190
 
191
-				$out[] = sprintf( '
191
+				$out[] = sprintf('
192 192
 		        <li id="%1s" class="ase-gallery-image">
193 193
 		        	<i class="dashicons dashicons-no-alt" title="%2s"></i>
194 194
 		        	<i class="dashicons dashicons-edit" title="%3s"></i>
195 195
 		           	<img src="%4s">
196 196
 		        </li>
197 197
 		       ',
198
-					absint( $image_id ),
199
-					__( 'Delete From Gallery', 'lasso' ),
200
-					__( 'Edit Image Caption', 'lasso' ),
201
-					esc_url( $image[0] )
198
+					absint($image_id),
199
+					__('Delete From Gallery', 'lasso'),
200
+					__('Edit Image Caption', 'lasso'),
201
+					esc_url($image[0])
202 202
 				);
203 203
 
204 204
 			}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
 		$out[] = '</ul>';
209 209
 
210
-		return array( 'html' => implode( '', $out ) );
210
+		return array('html' => implode('', $out));
211 211
 
212 212
 	}
213 213
 
@@ -219,13 +219,13 @@  discard block
 block discarded – undo
219 219
 	 *
220 220
 	 * @return array Array of keys to pull from $data per action and their sanitization callback
221 221
 	 */
222
-	public static function params(){
223
-		$params[ 'process_gallery_swap' ] = array(
222
+	public static function params() {
223
+		$params['process_gallery_swap'] = array(
224 224
 			'gallery_id' => 'absint',
225 225
 
226 226
 		);
227 227
 
228
-		$params[ 'process_gallery_create' ] = array(
228
+		$params['process_gallery_create'] = array(
229 229
 			'postid'   => 'absint',
230 230
 			'content'   => 'wp_kses_post',
231 231
 			'edgallerytitle' =>'sanitize_text_field',
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
 		);
239 239
 
240
-		$params[ 'process_gallery_update' ] = array(
240
+		$params['process_gallery_update'] = array(
241 241
 			'postid'        => 'absint',
242 242
 			'gallery_ids'   => 'lasso_sanitize_data',
243 243
 			'fields'        => 'lasso_sanitize_data',
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 			)
248 248
 		);
249 249
 
250
-		$params[ 'process_gallery_get_images' ] = array(
250
+		$params['process_gallery_get_images'] = array(
251 251
 			'post_id'       => 'absint'
252 252
 		);
253 253
 
@@ -263,19 +263,19 @@  discard block
 block discarded – undo
263 263
 	 * @return array Array of additional functions to use to authorize action.
264 264
 	 */
265 265
 	public static function auth_callbacks() {
266
-		$params[ 'process_gallery_swap' ] = array(
266
+		$params['process_gallery_swap'] = array(
267 267
 			'lasso_user_can'
268 268
 		);
269 269
 
270
-		$params[ 'process_gallery_create' ] = array(
270
+		$params['process_gallery_create'] = array(
271 271
 			'is_user_logged_in'
272 272
 		);
273 273
 
274
-		$params[ 'process_gallery_update' ] = array(
274
+		$params['process_gallery_update'] = array(
275 275
 			'lasso_user_can'
276 276
 		);
277 277
 
278
-		$params[ 'process_gallery_get_images' ] = array();
278
+		$params['process_gallery_get_images'] = array();
279 279
 
280 280
 		return $params;
281 281
 
Please login to merge, or discard this patch.
includes/save_gallery.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,65 +12,65 @@
 block discarded – undo
12 12
 	/**
13 13
 	 * Update an existing galleries options
14 14
 	 */
15
-	public static function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
15
+	public static function save_gallery_options($postid, $gallery_ids, $options, $type = false) {
16 16
 
17 17
 		// gallery width
18
-		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
18
+		$gallery_width = isset($options['width']) ? $options['width'] : false;
19 19
 
20 20
 		// gallery grid item width
21
-		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
21
+		$item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false;
22 22
 
23 23
 		// caption
24
-		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
24
+		$caption = isset($options['caption']) ? $options['caption'] : false;
25 25
 
26 26
 		// gallery transition
27
-		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
27
+		$transition = isset($options['transition']) ? $options['transition'] : false;
28 28
 
29 29
 		// gallery transition speed
30
-		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
30
+		$transitionSpeed = isset($options['speed']) ? $options['speed'] : false;
31 31
 
32 32
 		// gallery hide thumbs
33
-		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
33
+		$hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false;
34 34
 
35 35
 		// photoset layout hardwired to on for now
36
-		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
36
+		$psLayout = isset($options['pslayout']) ? $options['pslayout'] : false;
37 37
 
38 38
 		// photoset layout
39
-		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
39
+		$psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
40 40
 		
41 41
 		// hero gallery height
42
-		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
42
+		$gallery_height = isset($options['height']) ? $options['height'] : false;
43 43
 
44 44
 		// update gallery ids
45
-		if ( !empty( $gallery_ids ) ) {
45
+		if (!empty($gallery_ids)) {
46 46
 
47
-			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
47
+			update_post_meta($postid, '_ase_gallery_images', $gallery_ids);
48 48
 
49 49
 		}
50 50
 
51
-		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
51
+		update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type)));
52 52
 
53
-		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
53
+		update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width)));
54 54
 
55
-		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
55
+		update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width)));
56 56
 
57
-		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
57
+		update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption)));
58 58
 
59
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
59
+		update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition)));
60 60
 
61
-		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
61
+		update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed)));
62 62
 
63
-		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
63
+		update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs)));
64 64
 
65
-		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
65
+		update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout)));
66 66
 
67
-		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
67
+		update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox)));
68 68
 		
69
-		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
69
+		update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height)));
70 70
 		
71 71
 		//hardwired for now
72 72
 		
73
-		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
73
+		update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300);
74 74
 
75 75
 	}
76 76
 
Please login to merge, or discard this patch.
public/includes/editor-modules--gallery.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 	ob_start();
13 13
 
14
-	if ( $galleries ) { ?>
14
+	if ($galleries) { ?>
15 15
 	
16
-		<?php if ( lasso_user_can( 'publish_posts' ) ): ?>
16
+		<?php if (lasso_user_can('publish_posts')): ?>
17 17
 			<div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important">
18 18
 				<div class="ase-gallery-opts--single lasso-option">
19
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a>
19
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a>
20 20
 				</div>
21 21
 			</div>
22 22
 		<?php endif; ?>
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 		<div class="ase-gallery-opts ase-gallery-opts--edit-gallery" >
25 25
 			<div class="ase-gallery-opts--single lasso-option">
26 26
 
27
-				<label><?php _e( 'Manage Images', 'lasso' );?>
28
-					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a>
27
+				<label><?php _e('Manage Images', 'lasso'); ?>
28
+					<a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a>
29 29
 
30 30
 				</label>
31
-				<small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small>
31
+				<small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small>
32 32
 
33 33
 				<div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div>
34 34
 
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 
39 39
 	<?php }
40 40
 
41
-	if ( lasso_user_can( 'publish_posts' ) ): ?>
41
+	if (lasso_user_can('publish_posts')): ?>
42 42
 
43 43
 		<div class="ase-gallery-opts ase-gallery-opts--create-gallery" >
44 44
 
45 45
 			<div class="ase-gallery-opts--single lasso-option">
46 46
 
47
-				<label><?php _e( 'Create a Gallery', 'lasso' );?></label>
47
+				<label><?php _e('Create a Gallery', 'lasso'); ?></label>
48 48
 				<small class="lasso-option-desc">Gallery Name:</small>
49 49
                 <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br>
50 50
 				
51
-				<small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small>
52
-				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a>
51
+				<small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small>
52
+				<a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a>
53 53
 
54 54
 				<div id="ase-gallery-images"></div>
55 55
 
56
-				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a>
56
+				<a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a>
57 57
 
58 58
 			</div>
59 59
 
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	<!-- Gallery Layout/Type Chooser -->
65 65
 	<div class="ase-gallery-opts ase-gallery-opts--type" >
66 66
 		<div data-option="gallery-type" class="ase-gallery-opts--single lasso-option">
67
-			<label><?php _e( 'Gallery Type', 'lasso' );?></label>
68
-			<small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small>
67
+			<label><?php _e('Gallery Type', 'lasso'); ?></label>
68
+			<small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small>
69 69
 			<fieldset>
70
-	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label>
71
-	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label>
70
+	      		<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label>
71
+	        	<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label>
72 72
 				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label>
73
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label>
74
-				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label>
73
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label>
74
+				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label>
75 75
 				<label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label>
76 76
 			</fieldset>
77 77
 		</div>
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	<div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;">
82 82
 
83 83
 		<div data-option="itemwidth" class="ase-gallery-opts--single lasso-option">
84
-			<label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label>
85
-			<small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small>
84
+			<label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label>
85
+			<small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small>
86 86
 			<input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value="">
87 87
 		</div>
88 88
 
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 	<div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;">
93 93
 
94 94
 		<div data-option="transition" class="ase-gallery-opts--single lasso-option">
95
-			<label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label>
96
-			<small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small>
95
+			<label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label>
96
+			<small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small>
97 97
 		   	<select name="lasso_thumb_gallery_transition" class="lasso-generator-attr">
98
-		      <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option>
99
-		      <option value="slide"><?php _e( 'Slide', 'lasso' );?></option>
100
-		      <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option>
98
+		      <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option>
99
+		      <option value="slide"><?php _e('Slide', 'lasso'); ?></option>
100
+		      <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option>
101 101
 		    </select>
102 102
 		</div>
103 103
 
104 104
 		<div data-option="speed" class="ase-gallery-opts--single lasso-option">
105
-			<label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label>
106
-			<small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small>
105
+			<label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label>
106
+			<small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small>
107 107
 			<input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value="">
108 108
 		</div>
109 109
 
110 110
 		<div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option">
111 111
 			<input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs">
112
-			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label>
112
+			<label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label>
113 113
 		</div>
114 114
 
115 115
 	</div>
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	<div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;">
119 119
 
120 120
 		<div data-option="pslayout" class="ase-gallery-opts--single lasso-option">
121
-			<label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label>
122
-			<small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small>
121
+			<label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label>
122
+			<small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small>
123 123
 			<input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value="">
124 124
 		</div>
125 125
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	<div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;">
135 135
 
136 136
 		<div data-option="height" class="ase-gallery-opts--single lasso-option">
137
-			<label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label>
138
-			<small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small>
137
+			<label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label>
138
+			<small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small>
139 139
 			<input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value="">
140 140
 		</div>
141 141
 
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 	<div class="ase-gallery-opts ase-gallery-opts--global">
146 146
 
147 147
 		<div data-option="width" class="ase-gallery-opts--single lasso-option">
148
-			<label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label>
149
-			<small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small>
148
+			<label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label>
149
+			<small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small>
150 150
 			<input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value="">
151 151
 		</div>
152 152
 		<div data-option="caption" class="ase-gallery-opts--single lasso-option">
153
-			<label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label>
154
-			<small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small>
153
+			<label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label>
154
+			<small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small>
155 155
 			<textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea>
156 156
 		</div>
157 157
 
Please login to merge, or discard this patch.
includes/process/save.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -19,27 +19,27 @@  discard block
 block discarded – undo
19 19
 	 *
20 20
 	 * @return bool Always returns true.
21 21
 	 */
22
-	public function content( $data ) {
22
+	public function content($data) {
23 23
 
24 24
 		$save_to_post_disabled = $this->save_to_post_disables();
25 25
 
26
-		$postid = (int) $data[ 'post_id' ];
27
-		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
28
-		$content = $this->remove_comments( $content );
26
+		$postid = (int) $data['post_id'];
27
+		$content = $this->replace_rendered_shortcodes($data['content']);
28
+		$content = $this->remove_comments($content);
29 29
 
30
-		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
30
+		if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) {
31 31
 
32 32
 			$args = array(
33 33
 				'ID'           => (int) $postid,
34 34
 				'post_content' => $content
35 35
 			);
36 36
 
37
-			wp_update_post( apply_filters( 'lasso_object_save_args', $args ) );
37
+			wp_update_post(apply_filters('lasso_object_save_args', $args));
38 38
 
39 39
 		}
40 40
 
41 41
 		// run save action
42
-		do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() );
42
+		do_action('lasso_post_saved', $postid, $content, get_current_user_ID());
43 43
 
44 44
 		return true;
45 45
 
@@ -54,25 +54,25 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @return bool Always returns true.
56 56
 	 */
57
-	public function publish_content( $data ) {
57
+	public function publish_content($data) {
58 58
 		$save_to_post_disabled = $this->save_to_post_disables();
59 59
 
60
-		$postid = (int) $data[ 'post_id' ];
61
-		$content = $this->replace_rendered_shortcodes( $data[ 'content' ] );
62
-		$content = $this->remove_comments( $content );
60
+		$postid = (int) $data['post_id'];
61
+		$content = $this->replace_rendered_shortcodes($data['content']);
62
+		$content = $this->remove_comments($content);
63 63
 
64
-		if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) {
64
+		if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) {
65 65
 
66
-			$args = array (
66
+			$args = array(
67 67
 				'ID'           	=> $postid,
68 68
 				'post_content' 	=> $content,
69 69
 				'post_status' 	=> 'publish'
70 70
 			);
71
-			wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) );
71
+			wp_update_post(apply_filters('lasso_object_publish_args', $args));
72 72
 
73 73
 		}
74 74
 
75
-		do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() );
75
+		do_action('lasso_post_published', $postid, $content, get_current_user_ID());
76 76
 
77 77
 		return true;
78 78
 
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
87 87
 	 */
88
-	public static function params(){
89
-		$params[ 'process_save_content' ] = array(
88
+	public static function params() {
89
+		$params['process_save_content'] = array(
90 90
 			'post_id' => 'absint',
91 91
 			'content' => 'wp_kses_post'
92 92
 		);
93 93
 
94
-		$params[ 'process_save_publish_content' ] = array(
94
+		$params['process_save_publish_content'] = array(
95 95
 			'post_id' => 'absint',
96 96
 			'content' => 'wp_kses_post'
97 97
 		);
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 	 * @return array Array of additional functions to use to authorize action.
108 108
 	 */
109 109
 	public static function auth_callbacks() {
110
-		$params[ 'process_save_content' ] = array(
110
+		$params['process_save_content'] = array(
111 111
 			'lasso_user_can'
112 112
 		);
113 113
 
114
-		$params[ 'process_save_publish_content' ] = array();
114
+		$params['process_save_publish_content'] = array();
115 115
 
116 116
 		return $params;
117 117
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return bool
128 128
 	 */
129 129
 	protected function save_to_post_disables() {
130
-		$save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
130
+		$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
131 131
 
132 132
 		return $save_to_post_disabled;
133 133
 
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
 	 *
145 145
 	 * @return string
146 146
 	 */
147
-	protected function replace_rendered_shortcodes( $content ) {
147
+	protected function replace_rendered_shortcodes($content) {
148 148
 		//debug line
149 149
         //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content);
150 150
 		
151 151
 
152
-		if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) {
152
+		if (false === strpos($content, '--EDITUS_OTHER_SHORTCODE_START|')) {
153 153
 			return $content;
154 154
 		}
155
-		$content = htmlspecialchars_decode ($content);
155
+		$content = htmlspecialchars_decode($content);
156 156
 
157 157
 		$content = preg_replace(
158 158
 			'/<!--EDITUS_OTHER_SHORTCODE_START\|\[(.*?)\]-->(.*?)<!--EDITUS_OTHER_SHORTCODE_END-->/s',
Please login to merge, or discard this patch.
public/includes/underscore-templates.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( !function_exists( 'lasso_backbone_templates' ) ):
3
+if (!function_exists('lasso_backbone_templates')):
4 4
 
5 5
 	add_action('wp_footer', 'lasso_backbone_templates');
6
-	function lasso_backbone_templates(){
6
+	function lasso_backbone_templates() {
7 7
 
8 8
 		$can_delete = lasso_user_can('delete_posts');
9 9
 		$can_delete_class = $can_delete ? false : 'no-delete';
10 10
 
11 11
 		
12 12
 		// only run on posts and pages if user is logged in
13
-		if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { 
14
-		    if ( !class_exists( 'WP_REST_Controller' ) ) {
13
+		if (is_user_logged_in() && lasso_user_can('edit_posts')) { 
14
+		    if (!class_exists('WP_REST_Controller')) {
15 15
 			    // using rest api v1 
16 16
 				?>
17 17
 				<script type="text/html" id="lasso-tmpl--post">
18 18
 					<li>
19
-						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" >
19
+						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" >
20 20
 							<%= post.title %>
21 21
 
22 22
 							<div class="lasso--post-list__controls">
23
-								<span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span>
24
-								<?php if( $can_delete ): ?>
25
-								<span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span>
23
+								<span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span>
24
+								<?php if ($can_delete): ?>
25
+								<span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span>
26 26
 								<?php endif; ?>
27 27
 							</div>
28 28
 						</a>
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		    ?>
35 35
 				<script type="text/html" id="lasso-tmpl--post">
36 36
 					<li>
37
-						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" >
37
+						<a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" >
38 38
 							<%= post.title.rendered %>
39 39
 
40 40
 							<div class="lasso--post-list__controls">
41
-								<span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span>
42
-								<?php if( $can_delete ): ?>
43
-								<span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span>
41
+								<span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span>
42
+								<?php if ($can_delete): ?>
43
+								<span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span>
44 44
 								<?php endif; ?>
45 45
 							</div>
46 46
 						</a>
Please login to merge, or discard this patch.
public/includes/components.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -16,80 +16,80 @@  discard block
 block discarded – undo
16 16
 
17 17
 	$array = array(
18 18
 		'quote' => array(
19
-			'name'    => __('Quote','lasso'),
19
+			'name'    => __('Quote', 'lasso'),
20 20
 			'content' => lasso_quote_component(),
21 21
 		),
22 22
 		'image' => array(
23
-			'name'    => __('Image','lasso'),
23
+			'name'    => __('Image', 'lasso'),
24 24
 			'content' => lasso_image_component(),
25 25
 		),
26 26
 		'parallax' => array(
27
-			'name'    => __('Parallax','lasso'),
27
+			'name'    => __('Parallax', 'lasso'),
28 28
 			'content' => lasso_parallax_component(),
29 29
 		),
30 30
 		'audio' => array(
31
-			'name'    => __('Audio','lasso'),
31
+			'name'    => __('Audio', 'lasso'),
32 32
 			'content' => lasso_audio_component(),
33 33
 		),
34 34
 		'content' => array(
35
-			'name'    => __('Content','lasso'),
35
+			'name'    => __('Content', 'lasso'),
36 36
 			'content' => lasso_content_component(),
37 37
 		),
38 38
 		'character' => array(
39
-			'name'    => __('Character','lasso'),
39
+			'name'    => __('Character', 'lasso'),
40 40
 			'content' => lasso_character_component(),
41 41
 		),
42 42
 		'collection' => array(
43
-			'name'    => __('Collection','lasso'),
43
+			'name'    => __('Collection', 'lasso'),
44 44
 			'content' => lasso_collections_component(),
45 45
 		),
46 46
 		'document' => array(
47
-			'name'    => __('Document','lasso'),
47
+			'name'    => __('Document', 'lasso'),
48 48
 			'content' => lasso_document_component(),
49 49
 		),
50 50
 		'gallery' => array(
51
-			'name'    => __('Gallery','lasso'),
51
+			'name'    => __('Gallery', 'lasso'),
52 52
 			'content' => lasso_gallery_component(),
53 53
 		),
54 54
 		'chapter' => array(
55
-			'name'    => __('Chapter','lasso'),
55
+			'name'    => __('Chapter', 'lasso'),
56 56
 			'content' => lasso_heading_component(),
57 57
 		),
58 58
 		'map' => array(
59
-			'name'    => __('Map','lasso'),
59
+			'name'    => __('Map', 'lasso'),
60 60
 			'content' => lasso_map_component(),
61 61
 		),
62 62
 		'timeline_stop' => array(
63
-			'name'    => __('Timeline','lasso'),
63
+			'name'    => __('Timeline', 'lasso'),
64 64
 			'content' => lasso_timeline_component(),
65 65
 		),
66 66
 		'video' => array(
67
-			'name'    => __('Video','lasso'),
67
+			'name'    => __('Video', 'lasso'),
68 68
 			'content' => lasso_video_component(),
69 69
 		),
70 70
 		'wpimg' => array(
71
-			'name'    => __('WordPress Image','lasso'),
71
+			'name'    => __('WordPress Image', 'lasso'),
72 72
 			'content' => lasso_wp_image(),
73 73
 		),
74 74
 		'wpquote' => array(
75
-			'name'    => __('WordPress Quote','lasso'),
75
+			'name'    => __('WordPress Quote', 'lasso'),
76 76
 			'content' => lasso_wp_quote(),
77 77
 		),
78 78
 		'gallery_pop' => array(
79
-			'name'    => __('Gallery Pop','lasso'),
79
+			'name'    => __('Gallery Pop', 'lasso'),
80 80
 			'content' => lasso_gallery_pop_component(),
81 81
 		),
82 82
 		'events' => array(
83
-			'name'    => __('Events','lasso'),
83
+			'name'    => __('Events', 'lasso'),
84 84
 			'content' => lasso_event_component(),
85 85
 		),
86 86
 		'wpvideo' => array(
87
-			'name'    => __('WordPress Image','lasso'),
87
+			'name'    => __('WordPress Image', 'lasso'),
88 88
 			'content' => lasso_wp_video(),
89 89
 		),
90 90
 	);
91 91
 
92
-	return apply_filters( 'lasso_components', $array );
92
+	return apply_filters('lasso_components', $array);
93 93
 }
94 94
 
95 95
 /**
@@ -115,132 +115,132 @@  discard block
 block discarded – undo
115 115
  */
116 116
 
117 117
 // 1
118
-if ( !function_exists( 'lasso_quote_component' ) ):
118
+if (!function_exists('lasso_quote_component')):
119 119
 	function lasso_quote_component() {
120 120
 
121
-		return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' );
121
+		return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]');
122 122
 	}
123 123
 endif;
124 124
 
125 125
 // 2
126
-if ( !function_exists( 'lasso_image_component' ) ):
126
+if (!function_exists('lasso_image_component')):
127 127
 	function lasso_image_component() {
128 128
 
129
-		return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' );
129
+		return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]');
130 130
 	}
131 131
 endif;
132 132
 
133 133
 // 3
134
-if ( !function_exists( 'lasso_parallax_component' ) ):
134
+if (!function_exists('lasso_parallax_component')):
135 135
 	function lasso_parallax_component() {
136 136
 
137
-		return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' );
137
+		return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]');
138 138
 	}
139 139
 endif;
140 140
 
141 141
 // 4
142
-if ( !function_exists( 'lasso_audio_component' ) ):
142
+if (!function_exists('lasso_audio_component')):
143 143
 	function lasso_audio_component() {
144 144
 
145
-		return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' );
145
+		return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]');
146 146
 
147 147
 	}
148 148
 endif;
149 149
 
150 150
 // 5
151
-if ( !function_exists( 'lasso_content_component' ) ):
151
+if (!function_exists('lasso_content_component')):
152 152
 	function lasso_content_component() {
153 153
 
154
-		return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' );
154
+		return do_shortcode('[aesop_content]Start typing here...[/aesop_content]');
155 155
 	}
156 156
 endif;
157 157
 
158 158
 // 6
159
-if ( !function_exists( 'lasso_character_component' ) ):
159
+if (!function_exists('lasso_character_component')):
160 160
 	function lasso_character_component() {
161 161
 
162
-		return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' );
162
+		return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]');
163 163
 
164 164
 	}
165 165
 endif;
166 166
 
167 167
 // 7
168
-if ( !function_exists( 'lasso_collections_component' ) ):
168
+if (!function_exists('lasso_collections_component')):
169 169
 	function lasso_collections_component() {
170 170
 
171
-		return do_shortcode( '[aesop_collection]' );
171
+		return do_shortcode('[aesop_collection]');
172 172
 	}
173 173
 endif;
174 174
 
175 175
 // 8
176
-if ( !function_exists( 'lasso_document_component' ) ):
176
+if (!function_exists('lasso_document_component')):
177 177
 	function lasso_document_component() {
178 178
 
179
-		return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' );
179
+		return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]');
180 180
 
181 181
 	}
182 182
 endif;
183 183
 
184 184
 // 9
185
-if ( !function_exists( 'lasso_gallery_component' ) ):
185
+if (!function_exists('lasso_gallery_component')):
186 186
 	function lasso_gallery_component() {
187 187
 
188
-		return do_shortcode( '[aesop_gallery]' );
188
+		return do_shortcode('[aesop_gallery]');
189 189
 
190 190
 	}
191 191
 endif;
192 192
 
193 193
 // 10
194
-if ( !function_exists( 'lasso_heading_component' ) ):
194
+if (!function_exists('lasso_heading_component')):
195 195
 	function lasso_heading_component() {
196 196
 
197
-		return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' );
197
+		return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]');
198 198
 	}
199 199
 endif;
200 200
 
201 201
 // 11
202
-if ( !function_exists( 'lasso_map_component' ) ):
202
+if (!function_exists('lasso_map_component')):
203 203
 	function lasso_map_component() {
204 204
 
205 205
 		return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data">
206 206
 				'.lasso_map_form_footer().'
207
-				'.do_shortcode( '[aesop_map sticky="off"]' ).'
207
+				'.do_shortcode('[aesop_map sticky="off"]').'
208 208
 			</form>';
209 209
 
210 210
 	}
211 211
 endif;
212 212
 
213 213
 // 12
214
-if ( !function_exists( 'lasso_timeline_component' ) ):
214
+if (!function_exists('lasso_timeline_component')):
215 215
 	function lasso_timeline_component() {
216 216
 
217
-		return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' );
217
+		return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]');
218 218
 
219 219
 	}
220 220
 endif;
221 221
 
222 222
 // 13
223
-if ( !function_exists( 'lasso_video_component' ) ):
223
+if (!function_exists('lasso_video_component')):
224 224
 	function lasso_video_component() {
225 225
 
226
-		return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' );
226
+		return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]');
227 227
 
228 228
 	}
229 229
 endif;
230 230
 
231 231
 // 14 - since 0.9.1
232
-if ( !function_exists('lasso_wp_image') ):
232
+if (!function_exists('lasso_wp_image')):
233 233
 
234
-	function lasso_wp_image(){
234
+	function lasso_wp_image() {
235 235
 		return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>';
236 236
 	}
237 237
 
238 238
 endif;
239 239
 
240 240
 // 15 - since 0.9.2
241
-if ( !function_exists('lasso_wp_quote') ):
241
+if (!function_exists('lasso_wp_quote')):
242 242
 
243
-	function lasso_wp_quote(){
243
+	function lasso_wp_quote() {
244 244
 		return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>';
245 245
 	}
246 246
 
@@ -248,15 +248,15 @@  discard block
 block discarded – undo
248 248
 
249 249
 // 16 gallery pop added but not fully supported as of 0.9.9.11 
250 250
 
251
-if ( !function_exists( 'lasso_gallery_pop_component' ) ):
251
+if (!function_exists('lasso_gallery_pop_component')):
252 252
 	function lasso_gallery_pop_component() {
253
-		return do_shortcode( '[aesop_gallery_pop]' );
253
+		return do_shortcode('[aesop_gallery_pop]');
254 254
 	}
255 255
 endif;
256 256
 
257 257
 // 17 - work in progress
258 258
 
259
-if ( !function_exists( 'lasso_event_component' ) ):
259
+if (!function_exists('lasso_event_component')):
260 260
 	function lasso_event_component() {
261 261
 		$id = editus_get_one_id('aesop_events');
262 262
 		return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>';
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
 endif;
265 265
 
266 266
 // 18 - work in progress
267
-if ( !function_exists('lasso_wp_video') ):
267
+if (!function_exists('lasso_wp_video')):
268 268
 
269
-	function lasso_wp_video(){
269
+	function lasso_wp_video() {
270 270
 		return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>';
271 271
 	}
272 272
 
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
 // helper function to retrieve one id for default option
276 276
 function editus_get_one_id($type)
277 277
 {
278
-	$args = array( 'posts_per_page' => 1, 'post_type' => $type );
279
-	$posts = get_posts( $args );
280
-	if ( $posts ) {
281
-		foreach ( $posts as $post ) {
278
+	$args = array('posts_per_page' => 1, 'post_type' => $type);
279
+	$posts = get_posts($args);
280
+	if ($posts) {
281
+		foreach ($posts as $post) {
282 282
 			return $post->ID;
283 283
 		}
284 284
 	}
Please login to merge, or discard this patch.
admin/includes/menus/welcome.php 1 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' ) &&  !function_exists( 'rest_url' )) {
163
+		if (!function_exists('json_get_url_prefix') && !function_exists('rest_url')) {
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.', '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.', '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,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	    $plugins = array(
208 208
 
209 209
 	        array(
210
-	            'name'      => __('Aesop Story Engine','lasso'),
210
+	            'name'      => __('Aesop Story Engine', 'lasso'),
211 211
 	            'slug'      => 'aesop-story-engine',
212 212
 	            'required'  => false,
213 213
 	        ),
@@ -215,38 +215,38 @@  discard block
 block discarded – undo
215 215
 	    );
216 216
 
217 217
 	    $config = array(
218
-	        'default_path' => '',                      // Default absolute path to pre-packaged plugins.
218
+	        'default_path' => '', // Default absolute path to pre-packaged plugins.
219 219
 	        'menu'         => 'lasso-install-plugins', // Menu slug.
220
-	        'has_notices'  => true,                    // Show admin notices or not.
221
-	        'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
222
-	        'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
223
-	        'is_automatic' => false,                   // Automatically activate plugins after installation or not.
224
-	        'message'      => '',                      // Message to output right before the plugins table.
220
+	        'has_notices'  => true, // Show admin notices or not.
221
+	        'dismissable'  => true, // If false, a user cannot dismiss the nag message.
222
+	        'dismiss_msg'  => '', // If 'dismissable' is false, this message will be output at top of nag.
223
+	        'is_automatic' => false, // Automatically activate plugins after installation or not.
224
+	        'message'      => '', // Message to output right before the plugins table.
225 225
 	        'strings'      => array(
226
-	            'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
227
-	            'menu_title'                      => __( 'Install Plugins', 'lasso' ),
228
-	            'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
229
-	            'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
230
-	            '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).
231
-	            '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).
232
-	            '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).
233
-	            '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).
234
-	            '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).
235
-	            '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).
236
-	            '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).
237
-	            '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).
238
-	            'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
239
-	            'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
240
-	            'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
241
-	            'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
242
-	            'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
226
+	            'page_title'                      => __('Install Required Plugins', 'lasso'),
227
+	            'menu_title'                      => __('Install Plugins', 'lasso'),
228
+	            'installing'                      => __('Installing Plugin: %s', 'lasso'), // %s = plugin name.
229
+	            'oops'                            => __('Something went wrong with the plugin API.', 'lasso'),
230
+	            '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).
231
+	            '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).
232
+	            '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).
233
+	            '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).
234
+	            '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).
235
+	            '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).
236
+	            '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).
237
+	            '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).
238
+	            'install_link'                    => _n_noop('Begin installing plugin', 'Begin installing plugins'),
239
+	            'activate_link'                   => _n_noop('Begin activating plugin', 'Begin activating plugins'),
240
+	            'return'                          => __('Return to Required Plugins Installer', 'lasso'),
241
+	            'plugin_activated'                => __('Plugin activated successfully.', 'lasso'),
242
+	            'complete'                        => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link.
243 243
 	            'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
244 244
 	        )
245 245
 	    );
246 246
 		
247
-		$plugins = apply_filters( 'lasso_required_plugins', $plugins );
247
+		$plugins = apply_filters('lasso_required_plugins', $plugins);
248 248
 
249
-	    tgmpa( $plugins, $config );
249
+	    tgmpa($plugins, $config);
250 250
 
251 251
 	}
252 252
 }
Please login to merge, or discard this patch.
public/includes/wrap-shortcodes.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 
7 7
 
8 8
  
9
-if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) {
10
-	add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 );
9
+if (lasso_user_can('edit_posts') && !is_admin()) {
10
+	add_filter('the_content', 'lasso_wrap_shortcodes', 9);
11 11
 }
12 12
 
13 13
 /**
@@ -20,33 +20,33 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * @return string
22 22
  */
23
-function lasso_wrap_shortcodes( $content ) {
23
+function lasso_wrap_shortcodes($content) {
24 24
 	global $shortcode_tags;
25 25
 
26
-	if ( false === strpos( $content, '[' ) ) {
26
+	if (false === strpos($content, '[')) {
27 27
 		return $content;
28 28
 	}
29 29
 
30
-	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
30
+	if (empty($shortcode_tags) || !is_array($shortcode_tags)) {
31 31
 		return $content;
32 32
 	}
33 33
 
34
-	$tagnames  = array_keys( $shortcode_tags );
35
-	$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
34
+	$tagnames  = array_keys($shortcode_tags);
35
+	$tagregexp = join('|', array_map('preg_quote', $tagnames));
36 36
 	$pattern   = "/\\[($tagregexp)/s";
37 37
 
38
-	if ( 0 === preg_match( $pattern, $content ) ) {
38
+	if (0 === preg_match($pattern, $content)) {
39 39
 		// Avoids parsing HTML when there are no shortcodes or embeds anyway.
40 40
 		return $content;
41 41
 	}
42 42
 
43
-	$content = do_shortcodes_in_html_tags( $content, true ,$tagnames);
43
+	$content = do_shortcodes_in_html_tags($content, true, $tagnames);
44 44
 
45 45
 	$pattern = get_shortcode_regex();
46
-	$content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content );
46
+	$content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content);
47 47
 
48 48
 	// Always restore square braces so we don't break things like <!--[if IE ]>
49
-	$content = unescape_invalid_shortcodes( $content );
49
+	$content = unescape_invalid_shortcodes($content);
50 50
 
51 51
 	return $content;
52 52
 }
@@ -60,33 +60,33 @@  discard block
 block discarded – undo
60 60
  *
61 61
  * @return string
62 62
  */
63
-function lasso_wrap_shortcode_tag( $m ) {
63
+function lasso_wrap_shortcode_tag($m) {
64 64
 	// allow [[foo]] syntax for escaping a tag
65
-	if ( $m[1] == '[' && $m[6] == ']' ) {
66
-		return substr( $m[0], 1, - 1 );
65
+	if ($m[1] == '[' && $m[6] == ']') {
66
+		return substr($m[0], 1, - 1);
67 67
 	}
68
-	$exception_arr1 = array('aesop_gallery_pop','aesop_character_carousel');
69
-	$exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler','av_textblock','av_toggle_container','av_toggle');
70
-	$exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions',$exception_arr2);
68
+	$exception_arr1 = array('aesop_gallery_pop', 'aesop_character_carousel');
69
+	$exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler', 'av_textblock', 'av_toggle_container', 'av_toggle');
70
+	$exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions', $exception_arr2);
71 71
 
72
-	if ( strpos( $m[2],'aesop_'  ) === 0 ) {
72
+	if (strpos($m[2], 'aesop_') === 0) {
73 73
 		// check against the exceptions
74
-		if (strpos_arr($m[2],$exception_arr1)===false) {
74
+		if (strpos_arr($m[2], $exception_arr1) === false) {
75 75
 		    return $m[0];
76 76
 		}
77 77
 	}
78
-	if (strpos_arr($m[2],$exception_arr2)!==false) {
78
+	if (strpos_arr($m[2], $exception_arr2) !== false) {
79 79
 		return $m[0];
80 80
 	}
81 81
 
82
-	return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->';
82
+	return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->';
83 83
 }
84 84
 
85 85
 /* a helper function */
86 86
 function strpos_arr($haystack, $needle) {
87
-    if(!is_array($needle)) $needle = array($needle);
88
-    foreach($needle as $what) {
89
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
87
+    if (!is_array($needle)) $needle = array($needle);
88
+    foreach ($needle as $what) {
89
+        if (($pos = strpos($haystack, $what)) !== false) return $pos;
90 90
     }
91 91
     return false;
92 92
 }
93 93
\ No newline at end of file
Please login to merge, or discard this patch.