Completed
Push — master ( 4de7f8...f6ea62 )
by
unknown
01:38
created
includes/process/update_object.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 *  @since    0.9.3
135 135
 	 *
136 136
 	 *  @param    int    	$postid       	The current postid
137
-     *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
137
+	 *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
138 138
 	 *  @param    string     $taxonomy    	The name of the taxonomy to which the term belongs.
139 139
 	 *
140 140
 	 *  @return bool True if update was successful, false if not.
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			}
148 148
 			
149 149
 			if ($taxonomy =='category') {
150
-                // convert from names to category ids
150
+				// convert from names to category ids
151 151
 				$cats = array();
152 152
 				if (is_array($value)) {
153 153
 					foreach ($value as $cat) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 *
180 180
 	 *
181 181
 	 *  @param    int    	$postid       	The current postid
182
-     *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
182
+	 *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
183 183
 	 *                                      The first item is the name of taxonomy
184 184
 	 *
185 185
 	 *  @return bool True if update was successful, false if not.
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				$value = explode( ',', $value );
193 193
 			}
194 194
 						
195
-            // Deleting first array item
195
+			// Deleting first array item
196 196
 			$taxonomy = array_shift($value);
197 197
 			$cats = array();
198 198
 			foreach ($value as $cat) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		
215 215
 		if( $value ) {
216 216
 			$time = current_time('mysql');
217
-            wp_update_post(
217
+			wp_update_post(
218 218
 				array (
219 219
 					'ID'            => $postid, // ID of the post to update
220 220
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
admin/includes/load_admin.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 
100 100
 		foreach ( $pages as $page ) {
101 101
 			wp_enqueue_media();
102
-            wp_enqueue_style( 'wp-color-picker');
103
-            wp_enqueue_script( 'wp-color-picker');
102
+			wp_enqueue_style( 'wp-color-picker');
103
+			wp_enqueue_script( 'wp-color-picker');
104 104
 		
105 105
 			wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true );
106 106
 			wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION );
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	}
132 132
 
133 133
 	/**
134
-	*	Adds an admin notice reminding the user if their license key has not been saved
135
-	*
136
-	*	@since 0.9.7
137
-	*	@todo make dismissible
138
-	*/
134
+	 *	Adds an admin notice reminding the user if their license key has not been saved
135
+	 *
136
+	 *	@since 0.9.7
137
+	 *	@todo make dismissible
138
+	 */
139 139
 	public function license_nag(){
140 140
 
141 141
 		$screen 	= get_current_screen();
@@ -156,26 +156,26 @@  discard block
 block discarded – undo
156 156
 
157 157
 			if ( empty( $license ) ) {
158 158
 
159
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
159
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
160 160
 
161
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
161
+			} else if ( 'invalid' == $status ){ // license key entered wrong or something
162 162
 
163 163
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
164 164
 
165
-        	} else if ( empty( $status ) ){ // license key saved but not activated
165
+			} else if ( empty( $status ) ){ // license key saved but not activated
166 166
 
167 167
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
168 168
 
169
-        	}
169
+			}
170 170
 		}
171 171
 
172 172
 	}
173 173
 
174 174
 	/**
175
-	*  Process hiding the dimiss
176
-	*
177
-	* @since 0.9.7
178
-	*/
175
+	 *  Process hiding the dimiss
176
+	 *
177
+	 * @since 0.9.7
178
+	 */
179 179
 	public function dismiss_nag() {
180 180
 
181 181
 		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
Please login to merge, or discard this patch.
includes/process/map.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 			}
46 46
 
47 47
 			// udpate start point
48
-            $point = json_decode( $start_point, true );
48
+			$point = json_decode( $start_point, true );
49 49
 			update_post_meta( $postid, 'ase_map_component_start_point', $point );
50 50
 
51 51
 			// update zoom
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		if ( !is_user_logged_in() )
99 99
 			return;
100 100
         
101
-        // check for lasso story engine and add a class doniting this
102
-        $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
101
+		// check for lasso story engine and add a class doniting this
102
+		$ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active';
103 103
 
104 104
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
105 105
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		$edit_post_disabled  = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' );
111 111
 		$post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' );
112 112
 		$allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' );
113
-        $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
113
+		$allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' );
114 114
 		$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
115 115
 		$shortcodify_disabled  = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' );
116 116
 		$enable_autosave  = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' );
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
136 136
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
137 137
         
138
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
138
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
139 139
 		
140 140
 		// do we support pending status
141 141
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 			$insert_comp_ui = 'drag';
148 148
 		}
149 149
         
150
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
150
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
151 151
         
152
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
152
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
153
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
154 154
 
155 155
 ?>
156 156
 		<div class="wrap">
Please login to merge, or discard this patch.
lasso.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2);
49 49
 function lasso_show_in_rest($args, $post_type){
50 50
  
51
-    $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
51
+	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) );
52 52
 	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
53 53
 	if (in_array( $post_type,$allowed_post_types)) {
54 54
 		$args['show_in_rest'] = true;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 	}
59 59
  
60
-    return $args;
60
+	return $args;
61 61
 }
62 62
 
63 63
 
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 //table codes to be added
107 107
 class editus_table {
108 108
     
109
-    public function __construct(){
110
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
-        if ($add_table) {
112
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
109
+	public function __construct(){
110
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
111
+		if ($add_table) {
112
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
113 113
             
114
-        }
114
+		}
115 115
 	}
116 116
     
117
-    function scripts()
118
-    {
119
-        add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
-            add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
-            wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
-            wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
-    }
117
+	function scripts()
118
+	{
119
+		add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu'));
120
+			add_filter('lasso_components',array($this,'editus_components_add_table'),10,1);
121
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 );
122
+			wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
123
+			wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
124
+	}
125 125
     
126
-    function editus_table_edit_menu()
127
-    { ?>
126
+	function editus_table_edit_menu()
127
+	{ ?>
128 128
 
129 129
         <ul class='editus-table-menu'>
130 130
           <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li>
@@ -134,31 +134,31 @@  discard block
 block discarded – undo
134 134
           <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li
135 135
         </ul>
136 136
     <?php
137
-    }
137
+	}
138 138
     
139 139
     
140
-    function editus_html_table()
141
-    {   
142
-        return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
-    }
140
+	function editus_html_table()
141
+	{   
142
+		return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>';
143
+	}
144 144
 
145 145
 
146
-    function editus_components_add_table( $array ){
147
-        $custom = array(
148
-               'htmltable' => array(
149
-                         'name'    => __('HTML Table','lasso'),
150
-                          'content' => self::editus_html_table(),
151
-                )
152
-        );
153
-        return array_merge( $array, $custom );
154
-    }
146
+	function editus_components_add_table( $array ){
147
+		$custom = array(
148
+			   'htmltable' => array(
149
+						 'name'    => __('HTML Table','lasso'),
150
+						  'content' => self::editus_html_table(),
151
+				)
152
+		);
153
+		return array_merge( $array, $custom );
154
+	}
155 155
 
156 156
 
157
-    function editus_toolbar_components_add_table( ) {
158
-          ?>
157
+	function editus_toolbar_components_add_table( ) {
158
+		  ?>
159 159
           <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li>
160 160
           <?php
161
-    }
161
+	}
162 162
 }
163 163
 
164 164
 
@@ -169,37 +169,37 @@  discard block
 block discarded – undo
169 169
 //table codes to be added
170 170
 class editus_paragraph {
171 171
     
172
-    public function __construct(){
173
-        add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+	public function __construct(){
173
+		add_action('wp_enqueue_scripts', array($this,'scripts'));
174 174
 	}
175 175
     
176
-    function scripts()
177
-    {
178
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
-            //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
-            //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
-    }
176
+	function scripts()
177
+	{
178
+			add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
179
+			add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
180
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
181
+			//wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
182
+			//wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
183
+	}
184 184
    
185
-    function editus_components_add_paragraph( $array ){
186
-        $custom = array(
187
-               'htmlparagraph' => array(
188
-                         'name'    => __('HTML Paragraph','lasso'),
189
-                          'content' => self::editus_html_paragraph(),
190
-                )
191
-        );
192
-        return array_merge( $array, $custom );
193
-    }
185
+	function editus_components_add_paragraph( $array ){
186
+		$custom = array(
187
+			   'htmlparagraph' => array(
188
+						 'name'    => __('HTML Paragraph','lasso'),
189
+						  'content' => self::editus_html_paragraph(),
190
+				)
191
+		);
192
+		return array_merge( $array, $custom );
193
+	}
194 194
     
195 195
     
196
-    function editus_html_paragraph()
197
-    {   
198
-        return '<p contenteditable="true"><br></p>';
199
-    }
196
+	function editus_html_paragraph()
197
+	{   
198
+		return '<p contenteditable="true"><br></p>';
199
+	}
200 200
 
201
-    function editus_paragraph_style()
202
-    { ?>
201
+	function editus_paragraph_style()
202
+	{ ?>
203 203
         <style>
204 204
         #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before
205 205
         { 
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
         }
209 209
         </style>
210 210
     <?php
211
-    }
211
+	}
212 212
     
213 213
 
214
-    function editus_toolbar_components_add_paragraph( ) {
215
-          ?>
214
+	function editus_toolbar_components_add_paragraph( ) {
215
+		  ?>
216 216
           <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
217 217
           <?php
218
-    }
218
+	}
219 219
 }
220 220
 
221 221
 //Disable it for now
Please login to merge, or discard this patch.
public/includes/assets.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -15,29 +15,29 @@  discard block
 block discarded – undo
15 15
 		add_action('wp_enqueue_scripts', array($this,'scripts'));
16 16
 	}
17 17
     
18
-    function is_multipage()
19
-    {
20
-        global $post;
21
-        $pos = strpos($post->post_content, "<!--nextpage-->");
22
-        if (!$pos) return -1;
18
+	function is_multipage()
19
+	{
20
+		global $post;
21
+		$pos = strpos($post->post_content, "<!--nextpage-->");
22
+		if (!$pos) return -1;
23 23
         
24
-        global $wp;
25
-        $url =  home_url( $wp->request );
26
-        $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
-        return $index;        
28
-    }
24
+		global $wp;
25
+		$url =  home_url( $wp->request );
26
+		$index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1;
27
+		return $index;        
28
+	}
29 29
 
30 30
 	public function scripts(){
31 31
 
32 32
 	
33 33
 		global $post;
34 34
 		if ( lasso_user_can('edit_posts') 
35
-		     /* uncomment this line to disable Editus on Gutenberg posts*/
36
-             /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
-             ) {
35
+			 /* uncomment this line to disable Editus on Gutenberg posts*/
36
+			 /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content)  && !is_home()) */              
37
+			 ) {
38 38
 			
39 39
 			/**    Returns the time offset from UTC
40
-			*/
40
+			 */
41 41
 			function get_UTC_offset() {
42 42
 				$timezone_string = get_option( 'timezone_string' );
43 43
 				if (empty( $timezone_string ) ) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
54 54
 
55
-            //don't load autocomplete if it's a stockholm theme
55
+			//don't load autocomplete if it's a stockholm theme
56 56
 			$themename  	= wp_get_theme()->get('Name');
57 57
 			if ($themename !='Stockholm' ) {
58 58
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
91 91
 			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
92 92
             
93
-            $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
93
+			$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
94 94
             
95
-            $use_wpimgblock = false;
95
+			$use_wpimgblock = false;
96 96
             
97
-            $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
97
+			$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off');
98 98
 
99 99
 			
100 100
 			//text alignement
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			$tz_offset = get_UTC_offset();
133 133
 			$post_date = get_the_time('U', $postid);
134 134
 			$time = (time()+$tz_offset);
135
-            $delta = $time - $post_date;
135
+			$delta = $time - $post_date;
136 136
             
137 137
 			$strings = array(
138 138
 				'save' 				=> __('Save','lasso'),
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
188 188
 			
189 189
 			
190
-            if ($allow_change_date) {
191
-			    $permalink = get_site_url().'/?p='.$postid;
192
-            } else {
193
-                $permalink = get_permalink($postid);
194
-            }
190
+			if ($allow_change_date) {
191
+				$permalink = get_site_url().'/?p='.$postid;
192
+			} else {
193
+				$permalink = get_permalink($postid);
194
+			}
195 195
 			
196 196
 			// rest api
197 197
 			$rest_nonce = '';
@@ -211,17 +211,17 @@  discard block
 block discarded – undo
211 211
 				}
212 212
 			}
213 213
             
214
-            //excerpt
215
-            $post_excerpt = "";
216
-            $post_excerpt = $post->post_excerpt;
214
+			//excerpt
215
+			$post_excerpt = "";
216
+			$post_excerpt = $post->post_excerpt;
217 217
             
218
-            //find if this is multi page. -1 if not
219
-            $multipage = self::is_multipage();
220
-            $post_content = "";
221
-            //pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
-            //if ($multipage != -1) {
223
-               $post_content = $post->post_content;
224
-            //}
218
+			//find if this is multi page. -1 if not
219
+			$multipage = self::is_multipage();
220
+			$post_content = "";
221
+			//pass post_content if we need to process multipage. In future we may need to pass this for other purposes
222
+			//if ($multipage != -1) {
223
+			   $post_content = $post->post_content;
224
+			//}
225 225
 
226 226
 			// localized objects
227 227
 			$objects = array(
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 				'customFields'      => $custom_fields,
299 299
 				'clickToInsert'     => ($insert_comp_ui =='click'),
300 300
 				'buttonOnEmptyP'     => ($insert_comp_ui =='mediumcom'),      // auto show a button to insert components on an empty paragraph      
301
-                'rtl'               => is_rtl(),				
301
+				'rtl'               => is_rtl(),				
302 302
 				'skipToEdit'        =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode
303 303
 				'linksEditable'    => $links_editable,
304 304
 				'supportPendingStatus' => !$no_pending_status,
305 305
 				'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'),
306
-                'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
-                'multipages'=> $multipage,
308
-                'post_content'=>$post_content,
309
-                'post_excerpt'=>$post_excerpt,
310
-                'oldWPimg'=> $use_old_wpimg =='on',
311
-                'useWPImgBlk'=> $use_wpimgblock,
312
-                'prefixHTTP'=> $link_prefix_http =='on'
306
+				'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//,
307
+				'multipages'=> $multipage,
308
+				'post_content'=>$post_content,
309
+				'post_excerpt'=>$post_excerpt,
310
+				'oldWPimg'=> $use_old_wpimg =='on',
311
+				'useWPImgBlk'=> $use_wpimgblock,
312
+				'prefixHTTP'=> $link_prefix_http =='on'
313 313
 			);
314 314
 
315 315
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 			
318 318
 			
319 319
 			if (!$using_restapiv2) {
320
-               // enqueue REST API V1
320
+			   // enqueue REST API V1
321 321
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
322 322
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
323 323
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			if ($show_color) {
334 334
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
335 335
 			} else {
336
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
336
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
337 337
 			}
338 338
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
339 339
 
@@ -342,44 +342,44 @@  discard block
 block discarded – undo
342 342
 
343 343
 	}
344 344
     
345
-    function gutenberg_active() {
345
+	function gutenberg_active() {
346 346
         
347
-        // Gutenberg plugin is installed and activated.
348
-        $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
-
350
-        // Block editor since 5.0.
351
-        $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
-
353
-        if ( ! $gutenberg && ! $block_editor ) {
354
-            return false;
355
-        }
356
-
357
-        if ( self::is_classic_editor_plugin_active() ) {
358
-            $editor_option       = get_option( 'classic-editor-replace' );
359
-            $block_editor_active = array( 'no-replace', 'block' );
360
-
361
-            return in_array( $editor_option, $block_editor_active, true );
362
-        }
363
-
364
-        return true;
365
-    }
366
-
367
-    /**
368
-     * Check if Classic Editor plugin is active.
369
-     *
370
-     * @return bool
371
-     */
372
-    function is_classic_editor_plugin_active() {
373
-        if ( ! function_exists( 'is_plugin_active' ) ) {
374
-            include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
-        }
376
-
377
-        if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
-            return true;
379
-        }
380
-
381
-        return false;
382
-    }
347
+		// Gutenberg plugin is installed and activated.
348
+		$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
349
+
350
+		// Block editor since 5.0.
351
+		$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
352
+
353
+		if ( ! $gutenberg && ! $block_editor ) {
354
+			return false;
355
+		}
356
+
357
+		if ( self::is_classic_editor_plugin_active() ) {
358
+			$editor_option       = get_option( 'classic-editor-replace' );
359
+			$block_editor_active = array( 'no-replace', 'block' );
360
+
361
+			return in_array( $editor_option, $block_editor_active, true );
362
+		}
363
+
364
+		return true;
365
+	}
366
+
367
+	/**
368
+	 * Check if Classic Editor plugin is active.
369
+	 *
370
+	 * @return bool
371
+	 */
372
+	function is_classic_editor_plugin_active() {
373
+		if ( ! function_exists( 'is_plugin_active' ) ) {
374
+			include_once ABSPATH . 'wp-admin/includes/plugin.php';
375
+		}
376
+
377
+		if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
378
+			return true;
379
+		}
380
+
381
+		return false;
382
+	}
383 383
 
384 384
 }
385 385
 
Please login to merge, or discard this patch.
public/includes/components.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -236,16 +236,16 @@  discard block
 block discarded – undo
236 236
 if ( !function_exists('lasso_wp_image') ):
237 237
 
238 238
 	function lasso_wp_image(){
239
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
-        if ($use_wp_block_image == 'on') {
242
-        	return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
-        }
244
-        else if ($use_old_wpimg != 'on') {
245
-        	return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
-        } else {
247
-            return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
-        }
239
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
240
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
241
+		if ($use_wp_block_image == 'on') {
242
+			return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
243
+		}
244
+		else if ($use_old_wpimg != 'on') {
245
+			return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
246
+		} else {
247
+			return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
248
+		}
249 249
 	}
250 250
 
251 251
 endif;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
 if ( !function_exists('lasso_wp_image_block') ):
289 289
 	function lasso_wp_image_block(){
290
-        return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
290
+		return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img  src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>';
291 291
 	}
292 292
 
293 293
 endif;
Please login to merge, or discard this patch.
public/includes/lasso.php 1 patch
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		
60 60
 		add_action( 'wp_ajax_get_aesop_component',     array( $this, 'get_aesop_component' ) );
61 61
 		add_action( 'wp_ajax_editus_do_shortcode',     array( $this, 'editus_do_shortcode' ) );
62
-        add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
62
+		add_action( 'wp_ajax_editus_do_block',     array( $this, 'editus_do_block' ) );
63 63
 		add_action( 'wp_ajax_editus_lock_post',     array( $this, 'editus_lock_post' ) );
64 64
 		add_action( 'wp_ajax_editus_unlock_post',     array( $this, 'editus_unlock_post' ) );
65 65
 		add_action( 'wp_ajax_editus_hide_tour',     array( $this, 'editus_hide_tour' ) );
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 		add_action( 'wp_ajax_editus_featured_img',     array( $this, 'set_featured_img' ) );
70 70
 		add_action( 'wp_ajax_editus_del_featured_img',     array( $this, 'del_featured_img' ) );
71 71
         
72
-        add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
72
+		add_action( 'wp_ajax_editus_publish_post',     array( $this, 'on_publish_post' ) );
73 73
         
74
-        add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
-        add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
74
+		add_action( 'wp_ajax_editus_create_gallery',     array( $this, 'create_gallery' ) );
75
+		add_action( 'wp_ajax_editus_update_gallery',     array( $this, 'update_gallery' ) );
76 76
 
77 77
 		// enable saving custom fields through REST API
78 78
 		self::enable_metasave('post');
79 79
 		self::enable_metasave('page');
80 80
         
81
-        $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
81
+		$default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page'));
82 82
 		$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor',  $default_post_types);
83
-        foreach ( $allowed_post_types  as $post_type ) {
84
-           self::enable_metasave($post_type);
83
+		foreach ( $allowed_post_types  as $post_type ) {
84
+		   self::enable_metasave($post_type);
85 85
 		}
86 86
 		//enqueue assets
87 87
 		new assets();
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
 		$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
279 279
 	}
280 280
 	
281
-    // new ajax function to lock post for editing
281
+	// new ajax function to lock post for editing
282 282
 	public function editus_lock_post()
283 283
 	{
284 284
 		$post_id= $_POST["postid"];
285 285
 		$locked = wp_check_post_lock($post_id);
286 286
 		
287 287
 		if (!$locked) {
288
-		    wp_set_post_lock($post_id);
288
+			wp_set_post_lock($post_id);
289 289
 			echo "true";
290 290
 		} else {
291 291
 			$user_info = get_userdata($locked);
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 	{
299 299
 		$post_id= $_POST["postid"];
300 300
 		$locked = wp_check_post_lock($post_id);
301
-        if (!$locked) {
302
-            delete_post_meta( $post_id, '_edit_lock');
303
-        }
301
+		if (!$locked) {
302
+			delete_post_meta( $post_id, '_edit_lock');
303
+		}
304 304
 		echo "true";
305 305
 		
306 306
 		exit;
@@ -330,14 +330,14 @@  discard block
 block discarded – undo
330 330
 		$status = isset( $data['status'] ) ? $data['status'] : false;
331 331
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
332 332
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
333
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
333
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
334 334
 	
335 335
 
336 336
 		$args = array(
337 337
 			'ID'   			=> (int) $postid,
338 338
 			'post_name'  	=> $slug,
339 339
 			'post_status' 	=> $status,
340
-            'post_excerpt'  => $excerpt
340
+			'post_excerpt'  => $excerpt
341 341
 		);
342 342
 		
343 343
 		
@@ -405,12 +405,12 @@  discard block
 block discarded – undo
405 405
 		exit;
406 406
 	}
407 407
     
408
-    public function editus_do_block()
408
+	public function editus_do_block()
409 409
 	{
410 410
 		
411 411
 		$code= $_POST["code"];
412 412
 
413
-        $out = do_blocks( $code );
413
+		$out = do_blocks( $code );
414 414
 		
415 415
 		echo $out;
416 416
 		exit;
@@ -429,63 +429,63 @@  discard block
 block discarded – undo
429 429
 			}
430 430
 		}
431 431
 		if ($code == "aesop_video") {
432
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
433
-		    echo aesop_video_shortcode($atts);
432
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
433
+			echo aesop_video_shortcode($atts);
434 434
 		}
435 435
 		else if ($code == "aesop_image") {
436
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
437
-		    echo aesop_image_shortcode($atts);
436
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
437
+			echo aesop_image_shortcode($atts);
438 438
 		}
439 439
 		else if ($code == "aesop_quote") {
440
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
441
-		    echo aesop_quote_shortcode($atts);
440
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
441
+			echo aesop_quote_shortcode($atts);
442 442
 		}
443 443
 		else if ($code == "aesop_parallax") {
444
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
445
-		    echo aesop_parallax_shortcode($atts);
444
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
445
+			echo aesop_parallax_shortcode($atts);
446 446
 		}
447 447
 		else if ($code == "aesop_character") {
448
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
449
-		    echo aesop_character_shortcode($atts);
448
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
449
+			echo aesop_character_shortcode($atts);
450 450
 		}
451 451
 		else if ($code == "aesop_collection") {
452
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
453
-		    echo aesop_collection_shortcode($atts);
452
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
453
+			echo aesop_collection_shortcode($atts);
454 454
 		}
455 455
 		else if ($code == "aesop_chapter") {
456
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
457
-		    echo aesop_chapter_shortcode($atts);
456
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
457
+			echo aesop_chapter_shortcode($atts);
458 458
 		}
459 459
 		else if ($code == "aesop_content") {
460
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
461
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
460
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
461
+			echo aesop_content_shortcode($atts, $atts['content_data']);
462 462
 		}
463 463
 		else if ($code == "aesop_gallery") {
464
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
465
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
464
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
465
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
466 466
 		}
467 467
 		else if ($code == "aesop_audio") {
468
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
469
-		    echo aesop_audio_shortcode($atts);
468
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
469
+			echo aesop_audio_shortcode($atts);
470 470
 		}
471 471
 		else if ($code == "aesop_document") {
472
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
473
-		    echo aesop_document_shortcode($atts);
472
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
473
+			echo aesop_document_shortcode($atts);
474 474
 		}
475
-        /*else if ($code == "aesop_content") {
475
+		/*else if ($code == "aesop_content") {
476 476
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
477 477
 		    echo aesop_content_shortcode($atts);
478 478
 		}*/
479
-        else if ($code == "aesop_wpimg") {
480
-            self::wpimg($atts);
479
+		else if ($code == "aesop_wpimg") {
480
+			self::wpimg($atts);
481 481
 		}
482 482
 		else if ($code == "aesop_wpimg-block") {
483
-            self::wpimg_block($atts);
483
+			self::wpimg_block($atts);
484 484
 		}
485 485
 		else {
486 486
 			$code = '['.$code.' ';
487 487
 			foreach ($atts as $key => $value) {
488
-			    $code = ''.$key.'="'.$value.'" ';
488
+				$code = ''.$key.'="'.$value.'" ';
489 489
 			}
490 490
 			$code = $code.']';
491 491
 			echo do_shortcode($code);
@@ -494,88 +494,88 @@  discard block
 block discarded – undo
494 494
 		exit; 
495 495
 	}
496 496
     
497
-    public static function wpimg($atts) {
497
+	public static function wpimg($atts) {
498 498
 
499
-        echo '<figure data-component-type="wpimg"';
499
+		echo '<figure data-component-type="wpimg"';
500 500
         
501
-        $extra = "";
501
+		$extra = "";
502 502
         
503
-        // try to use srcset and sizes on new WP installs
503
+		// try to use srcset and sizes on new WP installs
504 504
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
505 505
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
506 506
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
507
-            $extra = "srcset='$srcset' sizes='$sizes' ";
508
-        }
509
-        if ($atts['align']=="left") {
510
-            $extra .= 'class="alignleft';
511
-        } else if ($atts['align']=="right") {
512
-            $extra .= 'class="alignright';
513
-        } else {
514
-            $extra .= 'class="aligncenter';
515
-        }
516
-        if ($atts['imgwidth'] || $atts['imgheight']) {
517
-            if ($atts['imgwidth']) {
518
-                $extra .= 'width:'. $atts['imgwidth'].';';
519
-            }
520
-            if ($atts['imgheight']) {
521
-                $extra .= 'height:'. $atts['imgheight'].';';
522
-            }
507
+			$extra = "srcset='$srcset' sizes='$sizes' ";
508
+		}
509
+		if ($atts['align']=="left") {
510
+			$extra .= 'class="alignleft';
511
+		} else if ($atts['align']=="right") {
512
+			$extra .= 'class="alignright';
513
+		} else {
514
+			$extra .= 'class="aligncenter';
515
+		}
516
+		if ($atts['imgwidth'] || $atts['imgheight']) {
517
+			if ($atts['imgwidth']) {
518
+				$extra .= 'width:'. $atts['imgwidth'].';';
519
+			}
520
+			if ($atts['imgheight']) {
521
+				$extra .= 'height:'. $atts['imgheight'].';';
522
+			}
523 523
             
524
-        }
525
-        $extra .= '"';
524
+		}
525
+		$extra .= '"';
526 526
         
527
-        foreach ($atts as $key => $value) {
527
+		foreach ($atts as $key => $value) {
528 528
 			 echo ' data-'.$key.'="'.$value.'"';
529 529
 		}
530
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
531
-        echo ' class="wp-caption lasso-component">';
532
-        $hrefset = false;
533
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
534
-        {
535
-            echo '<a href="' . $atts['link'] . '">';
536
-            $hrefset = true;
537
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
538
-            echo '<a href="' . $atts['img'] . '">';
539
-            $hrefset = true;
540
-        }
541
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
542
-        if ($hrefset)
543
-        {
544
-            echo '</a>';
545
-        }
546
-        if ($atts['caption'])
547
-        {
548
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
549
-        }
550
-        echo '</figure>';
551
-        echo '<p><br></p>';
552
-        return;
553
-    }
530
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
531
+		echo ' class="wp-caption lasso-component">';
532
+		$hrefset = false;
533
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
534
+		{
535
+			echo '<a href="' . $atts['link'] . '">';
536
+			$hrefset = true;
537
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
538
+			echo '<a href="' . $atts['img'] . '">';
539
+			$hrefset = true;
540
+		}
541
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
542
+		if ($hrefset)
543
+		{
544
+			echo '</a>';
545
+		}
546
+		if ($atts['caption'])
547
+		{
548
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
549
+		}
550
+		echo '</figure>';
551
+		echo '<p><br></p>';
552
+		return;
553
+	}
554 554
 	
555 555
 	public static function wpimg_block($atts) {
556 556
 		$imgextra = '';
557 557
 		if (!empty($atts['id'])) {
558 558
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
559 559
 		}
560
-        $figclass = 'aligncenter';
561
-        if ($atts['align']=="left") {
562
-            $figclass = 'alignleft';
563
-        } else if ($atts['align']=="right") {
564
-            $figclass = 'alignright';
565
-        } else {
566
-            $figclass = 'aligncenter';
567
-        }
568
-        echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
569
-        echo '<figure class="'.$figclass.' size-large">';        
570
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
571
-        if ($atts['caption'])
572
-        {
573
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
574
-        }
575
-        echo '</figure></div>';
576
-        echo '<p><br></p>';
577
-        return;
578
-    }
560
+		$figclass = 'aligncenter';
561
+		if ($atts['align']=="left") {
562
+			$figclass = 'alignleft';
563
+		} else if ($atts['align']=="right") {
564
+			$figclass = 'alignright';
565
+		} else {
566
+			$figclass = 'aligncenter';
567
+		}
568
+		echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
569
+		echo '<figure class="'.$figclass.' size-large">';        
570
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
571
+		if ($atts['caption'])
572
+		{
573
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
574
+		}
575
+		echo '</figure></div>';
576
+		echo '<p><br></p>';
577
+		return;
578
+	}
579 579
 	
580 580
 	
581 581
 	public function get_ase_options()
@@ -611,12 +611,12 @@  discard block
 block discarded – undo
611 611
 		exit;
612 612
 	}
613 613
     
614
-    /* This function doesn't actually publish post, but should be called when a post is published */
615
-    public function on_publish_post( ) {
614
+	/* This function doesn't actually publish post, but should be called when a post is published */
615
+	public function on_publish_post( ) {
616 616
 
617 617
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
618 618
         
619
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
619
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
620 620
 
621 621
 		exit;
622 622
 	}
@@ -674,14 +674,14 @@  discard block
 block discarded – undo
674 674
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
675 675
 			
676 676
 			if ($taxonomy =='category') {
677
-                // convert from names to category ids
677
+				// convert from names to category ids
678 678
 				$cats = array();
679 679
 				foreach ($value as $cat) {
680 680
 					$cat_id = get_cat_ID($cat);
681 681
 					if ($cat_id !=0) {
682 682
 						$cats [] = $cat_id;
683 683
 					} else if ($allow_new_category) {
684
-					    $cats [] = wp_create_category($cat);
684
+						$cats [] = wp_create_category($cat);
685 685
 					}
686 686
 				}
687 687
 				$value = $cats;
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 		}
702 702
 	}
703 703
     
704
-    public function create_gallery( ) {
704
+	public function create_gallery( ) {
705 705
 
706 706
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
707 707
         
@@ -755,10 +755,10 @@  discard block
 block discarded – undo
755 755
 			'message' => 'gallery-created',
756 756
 			'id' => $postid)
757 757
 		);
758
-        exit;
758
+		exit;
759 759
 	}
760 760
     
761
-    public function update_gallery( ) {
761
+	public function update_gallery( ) {
762 762
         
763 763
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
764 764
         
@@ -774,12 +774,12 @@  discard block
 block discarded – undo
774 774
 
775 775
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
776 776
 
777
-        echo json_encode( array('message' => 'gallery-updated') );
777
+		echo json_encode( array('message' => 'gallery-updated') );
778 778
 
779
-        exit;
779
+		exit;
780 780
 	}
781 781
     
782
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
782
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
783 783
 
784 784
 		// gallery width
785 785
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 	public function set_date( $postid, $value) {
864 864
 		if( $value ) {
865 865
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
866
-            wp_update_post(
866
+			wp_update_post(
867 867
 				array (
868 868
 					'ID'            => $postid, // ID of the post to update
869 869
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Indentation   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				height: 42px;
115 115
 			}
116 116
 		<?php
117
-            } 
117
+			} 
118 118
 		} else { 
119 119
 		?> 
120 120
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
             }
124 124
             
125 125
         <?php
126
-        }
127
-        ?>
126
+		}
127
+		?>
128 128
         </style>
129 129
 		<div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" >
130 130
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
234 234
 	
235 235
 	// mobile styles
236
-    $mobile_class = $is_mobile ? 'lasso-mobile' : false;
236
+	$mobile_class = $is_mobile ? 'lasso-mobile' : false;
237 237
 	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
238 238
 	
239 239
 	//show color
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	
249 249
 	$sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active')  ? 'shortcodify-disabled' : 'shortcodify-enabled';
250 250
 
251
-    $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
251
+	$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
252 252
 
253 253
 	?>
254 254
 	<div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>>
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	
462 462
 	//editor options
463 463
 	$allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor');
464
-    $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
464
+	$allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor');
465 465
 	$no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor');
466 466
 
467 467
 	// are we singular
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 	// do we support pending status
475 475
 	$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
476 476
     
477
-    $excerpt = $post->post_excerpt;
477
+	$excerpt = $post->post_excerpt;
478 478
 
479 479
 ?>
480 480
 	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 						}?>
554 554
 						<?php 
555 555
 						if ($allow_change_date) { 
556
-						    $dateformat = get_option( 'date_format' ); 
556
+							$dateformat = get_option( 'date_format' ); 
557 557
 						?>
558 558
 						    <label><?php _e( 'Post Date', 'lasso' ); ?></label>
559 559
 							<input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/>
@@ -647,8 +647,8 @@  discard block
 block discarded – undo
647 647
 								$types = lasso_post_types_names();
648 648
 								if ( !empty( $types ) ) {
649 649
 									foreach( $types as $name => $label ) 
650
-                                    {   	
651
-                                        $type = $name;									
650
+									{   	
651
+										$type = $name;									
652 652
 										//$type = preg_replace( '/s\b/','', $name );
653 653
 										if ($type == 'page' && !current_user_can('edit_pages')) {
654 654
 											continue;
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 						if ( !empty( $types ) ) {
671 671
 							// get the first element
672 672
 							$keys = array_keys($types);
673
-						    $type =$keys[0];						
673
+							$type =$keys[0];						
674 674
 							$type = preg_replace( '/s\b/','', $type );
675 675
 							printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) );		
676 676
 						}
@@ -698,8 +698,8 @@  discard block
 block discarded – undo
698 698
 	global $post;
699 699
 	
700 700
 	global $wp_post_types;
701
-    $labels = &$wp_post_types['post']->labels;
702
-    $labels->name = 'Articles';
701
+	$labels = &$wp_post_types['post']->labels;
702
+	$labels->name = 'Articles';
703 703
 
704 704
 	ob_start();
705 705
 
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 	ob_start();
760 760
 
761 761
 
762
-    $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
762
+	$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
763 763
     
764 764
 	// let users add custom css classes
765 765
 	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
@@ -861,9 +861,9 @@  discard block
 block discarded – undo
861 861
 function lasso_editor_options_blob() {
862 862
 
863 863
 	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array();
864
-    $codes   = add_wpimg_options( $codes );
864
+	$codes   = add_wpimg_options( $codes );
865 865
 	$codes   = add_wpimg_block_options( $codes );
866
-    $codes   = apply_filters( 'lasso_custom_options', $codes );
866
+	$codes   = apply_filters( 'lasso_custom_options', $codes );
867 867
 	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
868 868
 
869 869
 	$nonce = wp_create_nonce( 'lasso_gallery' );
@@ -965,9 +965,9 @@  discard block
 block discarded – undo
965 965
 		$return .= '</form>';
966 966
 
967 967
 		// extra JS codes
968
-        if (isset($shortcode['codes'])) {
969
-		    $return .= $shortcode['codes'];
970
-        }
968
+		if (isset($shortcode['codes'])) {
969
+			$return .= $shortcode['codes'];
970
+		}
971 971
 		$blob[$slug] = $return;
972 972
 	}
973 973
 
@@ -976,95 +976,95 @@  discard block
 block discarded – undo
976 976
 
977 977
 
978 978
 function add_wpimg_options( $shortcodes ) {
979
-    $custom = array(
980
-        'wpimg'    => array(
981
-            'name'     => __( 'Image', 'lasso' ),
982
-            'type'     => 'single',
983
-            'atts'     => array(
984
-                'img'    => array(
985
-                    'type'  => 'media_upload',
986
-                    'default'  => '',
987
-                    'desc'   => __( 'Image URL', 'lasso' ),
988
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
989
-                ),
990
-                'align'    => array(
991
-                    'type'  => 'select',
992
-                    'values'  => array(						
993
-                        array(
994
-                            'value' => 'center',
995
-                            'name' => __( 'Center', 'aesop-core' )
996
-                        ),
997
-                        array(
998
-                            'value' => 'left',
999
-                            'name' => __( 'Left', 'aesop-core' )
1000
-                        ),
1001
-                        array(
1002
-                            'value' => 'right',
1003
-                            'name' => __( 'Right', 'aesop-core' )
1004
-                        ),
1005
-                    ),
1006
-                    'default'  => 'center',
1007
-                    'desc'   => __( 'Alignment', 'lasso' ),
1008
-                    'tip'=>''
1009
-                ),			
979
+	$custom = array(
980
+		'wpimg'    => array(
981
+			'name'     => __( 'Image', 'lasso' ),
982
+			'type'     => 'single',
983
+			'atts'     => array(
984
+				'img'    => array(
985
+					'type'  => 'media_upload',
986
+					'default'  => '',
987
+					'desc'   => __( 'Image URL', 'lasso' ),
988
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
989
+				),
990
+				'align'    => array(
991
+					'type'  => 'select',
992
+					'values'  => array(						
993
+						array(
994
+							'value' => 'center',
995
+							'name' => __( 'Center', 'aesop-core' )
996
+						),
997
+						array(
998
+							'value' => 'left',
999
+							'name' => __( 'Left', 'aesop-core' )
1000
+						),
1001
+						array(
1002
+							'value' => 'right',
1003
+							'name' => __( 'Right', 'aesop-core' )
1004
+						),
1005
+					),
1006
+					'default'  => 'center',
1007
+					'desc'   => __( 'Alignment', 'lasso' ),
1008
+					'tip'=>''
1009
+				),			
1010 1010
                 
1011
-                'imgwidth'    => array(
1012
-                    'type'  => 'text_small',
1013
-                    'default'  => '300px',
1014
-                    'desc'   => __( 'Image Width', 'lasso' ),
1015
-                    'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1016
-                ),
1017
-                'imgheight'    => array(
1018
-                    'type'  => 'text_small',
1019
-                    'default'  => '',
1020
-                    'desc'   => __( 'Image Height', 'lasso' ),
1021
-                    'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1022
-                ),	
1023
-                'linkoption'    => array(
1024
-                    'type'  => 'select',
1025
-                    'values'  => array(						
1026
-                        array(
1027
-                            'value' => 'none',
1028
-                            'name' => __( 'None', 'aesop-core' )
1029
-                        ),
1030
-                        array(
1031
-                            'value' => 'img',
1032
-                            'name' => __( 'Image', 'aesop-core' )
1033
-                        ),
1034
-                        array(
1035
-                            'value' => 'url',
1036
-                            'name' => __( 'URL', 'aesop-core' )
1037
-                        ),
1038
-                    ),
1039
-                    'default'  => 'none',
1040
-                    'desc'   => __( 'Link', 'lasso' ),
1041
-                    'tip'  => __( 'Click leads to:', 'lasso' )
1042
-                ),				
1011
+				'imgwidth'    => array(
1012
+					'type'  => 'text_small',
1013
+					'default'  => '300px',
1014
+					'desc'   => __( 'Image Width', 'lasso' ),
1015
+					'tip'  => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' )
1016
+				),
1017
+				'imgheight'    => array(
1018
+					'type'  => 'text_small',
1019
+					'default'  => '',
1020
+					'desc'   => __( 'Image Height', 'lasso' ),
1021
+					'tip'  => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' )
1022
+				),	
1023
+				'linkoption'    => array(
1024
+					'type'  => 'select',
1025
+					'values'  => array(						
1026
+						array(
1027
+							'value' => 'none',
1028
+							'name' => __( 'None', 'aesop-core' )
1029
+						),
1030
+						array(
1031
+							'value' => 'img',
1032
+							'name' => __( 'Image', 'aesop-core' )
1033
+						),
1034
+						array(
1035
+							'value' => 'url',
1036
+							'name' => __( 'URL', 'aesop-core' )
1037
+						),
1038
+					),
1039
+					'default'  => 'none',
1040
+					'desc'   => __( 'Link', 'lasso' ),
1041
+					'tip'  => __( 'Click leads to:', 'lasso' )
1042
+				),				
1043 1043
                 
1044
-                'link'    => array(
1045
-                    'type'  => 'text',
1046
-                    'default'  => '',
1047
-                    'desc'   => __( 'URL Link', 'lasso' ),
1048
-                    'tip'  => __( 'URL link', 'lasso' )
1049
-                ),
1050
-                'alt'    => array(
1051
-                    'type'  => 'text',
1052
-                    'default'  => '',
1053
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1054
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1055
-                ),
1044
+				'link'    => array(
1045
+					'type'  => 'text',
1046
+					'default'  => '',
1047
+					'desc'   => __( 'URL Link', 'lasso' ),
1048
+					'tip'  => __( 'URL link', 'lasso' )
1049
+				),
1050
+				'alt'    => array(
1051
+					'type'  => 'text',
1052
+					'default'  => '',
1053
+					'desc'   => __( 'Image ALT', 'lasso' ),
1054
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1055
+				),
1056 1056
                 
1057
-                'caption'    => array(
1058
-                    'type'  => 'text_area',
1059
-                    'default'  => '',
1060
-                    'desc'   => __( 'Caption', 'lasso' ),
1061
-                    'tip'  => __( 'Optional caption for the image.', 'lasso' )
1062
-                ),
1057
+				'caption'    => array(
1058
+					'type'  => 'text_area',
1059
+					'default'  => '',
1060
+					'desc'   => __( 'Caption', 'lasso' ),
1061
+					'tip'  => __( 'Optional caption for the image.', 'lasso' )
1062
+				),
1063 1063
                 
1064 1064
 
1065
-            ),
1066
-            'desc'     => __( 'An image.', 'aesop-core' ),
1067
-            'codes'    => '<script>	            
1065
+			),
1066
+			'desc'     => __( 'An image.', 'aesop-core' ),
1067
+			'codes'    => '<script>	            
1068 1068
 						jQuery(document).ready(function($){
1069 1069
                             function linkSetting(l){								
1070 1070
 							    if ( l=="url") {
@@ -1084,69 +1084,69 @@  discard block
 block discarded – undo
1084 1084
 							})
1085 1085
 						});
1086 1086
 			           </script>'
1087
-        )
1088
-    );
1087
+		)
1088
+	);
1089 1089
 
1090
-    return array_merge( $shortcodes, $custom );
1090
+	return array_merge( $shortcodes, $custom );
1091 1091
 }
1092 1092
 
1093 1093
 function add_wpimg_block_options( $shortcodes ) {
1094
-    $custom = array(
1095
-        'wpimg-block'    => array(
1096
-            'name'     => __( 'Image', 'lasso' ),
1097
-            'type'     => 'single',
1098
-            'atts'     => array(
1099
-                'img'    => array(
1100
-                    'type'  => 'media_upload',
1101
-                    'default'  => '',
1102
-                    'desc'   => __( 'Image URL', 'lasso' ),
1103
-                    'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1104
-                ),
1105
-                'align'    => array(
1106
-                    'type'  => 'select',
1107
-                    'values'  => array(						
1108
-                        array(
1109
-                            'value' => 'center',
1110
-                            'name' => __( 'Center', 'aesop-core' )
1111
-                        ),
1112
-                        array(
1113
-                            'value' => 'left',
1114
-                            'name' => __( 'Left', 'aesop-core' )
1115
-                        ),
1116
-                        array(
1117
-                            'value' => 'right',
1118
-                            'name' => __( 'Right', 'aesop-core' )
1119
-                        ),
1120
-                    ),
1121
-                    'default'  => 'center',
1122
-                    'desc'   => __( 'Alignment', 'lasso' ),
1123
-                    'tip'=>''
1124
-                ),		
1125
-                'alt'    => array(
1126
-                    'type'  => 'text',
1127
-                    'default'  => '',
1128
-                    'desc'   => __( 'Image ALT', 'lasso' ),
1129
-                    'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1130
-                ),
1131
-                'caption'    => array(
1132
-                    'type'  => 'text',
1133
-                    'default'  => '',
1134
-                    'desc'   => __( 'Caption', 'lasso' ),
1135
-                    'tip'  => __( 'Caption for the image.', 'lasso' )
1136
-                ),
1094
+	$custom = array(
1095
+		'wpimg-block'    => array(
1096
+			'name'     => __( 'Image', 'lasso' ),
1097
+			'type'     => 'single',
1098
+			'atts'     => array(
1099
+				'img'    => array(
1100
+					'type'  => 'media_upload',
1101
+					'default'  => '',
1102
+					'desc'   => __( 'Image URL', 'lasso' ),
1103
+					'tip'  => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' )
1104
+				),
1105
+				'align'    => array(
1106
+					'type'  => 'select',
1107
+					'values'  => array(						
1108
+						array(
1109
+							'value' => 'center',
1110
+							'name' => __( 'Center', 'aesop-core' )
1111
+						),
1112
+						array(
1113
+							'value' => 'left',
1114
+							'name' => __( 'Left', 'aesop-core' )
1115
+						),
1116
+						array(
1117
+							'value' => 'right',
1118
+							'name' => __( 'Right', 'aesop-core' )
1119
+						),
1120
+					),
1121
+					'default'  => 'center',
1122
+					'desc'   => __( 'Alignment', 'lasso' ),
1123
+					'tip'=>''
1124
+				),		
1125
+				'alt'    => array(
1126
+					'type'  => 'text',
1127
+					'default'  => '',
1128
+					'desc'   => __( 'Image ALT', 'lasso' ),
1129
+					'tip'  => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' )
1130
+				),
1131
+				'caption'    => array(
1132
+					'type'  => 'text',
1133
+					'default'  => '',
1134
+					'desc'   => __( 'Caption', 'lasso' ),
1135
+					'tip'  => __( 'Caption for the image.', 'lasso' )
1136
+				),
1137 1137
                
1138 1138
 
1139
-            ),
1140
-            'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1141
-            'codes'    => '<script>	            
1139
+			),
1140
+			'desc'     => __( 'A WP Image Block.', 'aesop-core' ),
1141
+			'codes'    => '<script>	            
1142 1142
 						jQuery(document).ready(function($){
1143 1143
                             
1144 1144
 						});
1145 1145
 			           </script>'
1146
-        )
1147
-    );
1146
+		)
1147
+	);
1148 1148
 
1149
-    return array_merge( $shortcodes, $custom );
1149
+	return array_merge( $shortcodes, $custom );
1150 1150
 }
1151 1151
 
1152 1152
 /**
@@ -1191,23 +1191,23 @@  discard block
 block discarded – undo
1191 1191
  * @return string
1192 1192
  */
1193 1193
 function lasso_editor_adjustBrightness($hex, $steps) { 
1194
-    $steps = max(-255, min(255, $steps));
1194
+	$steps = max(-255, min(255, $steps));
1195 1195
 
1196
-    // Normalize into a six character long hex string
1197
-    $hex = str_replace('#', '', $hex);
1198
-    if (strlen($hex) == 3) {
1199
-        $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1200
-    }
1196
+	// Normalize into a six character long hex string
1197
+	$hex = str_replace('#', '', $hex);
1198
+	if (strlen($hex) == 3) {
1199
+		$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
1200
+	}
1201 1201
 
1202
-    // Split into three parts: R, G and B
1203
-    $color_parts = str_split($hex, 2);
1204
-    $return = '#';
1202
+	// Split into three parts: R, G and B
1203
+	$color_parts = str_split($hex, 2);
1204
+	$return = '#';
1205 1205
 
1206
-    foreach ($color_parts as $color) {
1207
-        $color   = hexdec($color); // Convert to decimal
1208
-        $color   = max(0,min(255,$color + $steps)); // Adjust color
1209
-        $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1210
-    }
1206
+	foreach ($color_parts as $color) {
1207
+		$color   = hexdec($color); // Convert to decimal
1208
+		$color   = max(0,min(255,$color + $steps)); // Adjust color
1209
+		$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
1210
+	}
1211 1211
 
1212
-    return $return;
1212
+	return $return;
1213 1213
 }
Please login to merge, or discard this patch.