Completed
Push — master ( 87ad6f...c07007 )
by
unknown
40s
created
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.
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.
includes/process/meta.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 			}
53 53
 		}
54 54
 
55
-        do_action( 'editus_after_meta_update', $post_id, $data );
55
+		do_action( 'editus_after_meta_update', $post_id, $data );
56 56
 
57 57
 
58 58
 		return true;
Please login to merge, or discard this patch.
public/includes/helpers.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
 	if ( empty( $postid ) )
200 200
 		$postid = get_the_ID();
201 201
 
202
-    if ('category' == $taxonomy)  {
203
-        $objects = get_the_category( $postid );
204
-    } else if ('tag' == $taxonomy)  {
205
-        $objects = get_the_tags( $postid );
206
-    } else {
207
-        $objects = get_the_terms( $postid, $taxonomy );
208
-    }
202
+	if ('category' == $taxonomy)  {
203
+		$objects = get_the_category( $postid );
204
+	} else if ('tag' == $taxonomy)  {
205
+		$objects = get_the_tags( $postid );
206
+	} else {
207
+		$objects = get_the_terms( $postid, $taxonomy );
208
+	}
209 209
 
210 210
 	if ( empty( $objects) )
211 211
 		return;
@@ -227,16 +227,16 @@  discard block
 block discarded – undo
227 227
 */
228 228
 function lasso_get_objects( $taxonomy = 'category' ) {
229 229
 
230
-    if ('category' == $taxonomy)  {
231
-        $objects = get_categories(array('hide_empty' => 0));
232
-    } else if ('tag' == $taxonomy)  {
233
-        $objects = get_tags(array('hide_empty' => 0));
234
-    } else {
235
-        $objects = get_terms( array(
236
-            'taxonomy' => $taxonomy,
237
-            'hide_empty' => false,
238
-        ));
239
-    }
230
+	if ('category' == $taxonomy)  {
231
+		$objects = get_categories(array('hide_empty' => 0));
232
+	} else if ('tag' == $taxonomy)  {
233
+		$objects = get_tags(array('hide_empty' => 0));
234
+	} else {
235
+		$objects = get_terms( array(
236
+			'taxonomy' => $taxonomy,
237
+			'hide_empty' => false,
238
+		));
239
+	}
240 240
 	
241 241
 	if ( empty( $objects) )
242 242
 		return;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		'public' => true,
262 262
 	), 'objects' );
263 263
 	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
264
-    unset( $post_types[ 'attachment' ] );
264
+	unset( $post_types[ 'attachment' ] );
265 265
 
266 266
 	/**
267 267
 	 * Set which post types are allowed
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	$post_types = get_post_types( array(
289 289
 		'public' => true,
290 290
 	), 'names' );
291
-    unset( $post_types[ 'attachment' ] );
291
+	unset( $post_types[ 'attachment' ] );
292 292
 
293 293
 	/**
294 294
 	 * Set which post types are allowed
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
  */
401 401
 if ( !function_exists( 'lasso_user_can' ) ):
402 402
 	function lasso_user_can( $action = '', $postid = 0 ) {
403
-        $result = false;
403
+		$result = false;
404 404
 		if ( empty( $action ) )
405 405
 			$action = 'edit_posts';
406 406
 
@@ -415,17 +415,17 @@  discard block
 block discarded – undo
415 415
 				$allowed_post_types = array_diff($allowed_post_types,array('page'));
416 416
 			}
417 417
 			
418
-            if (!empty($allowed_post_types) && !empty($postid)) {
418
+			if (!empty($allowed_post_types) && !empty($postid)) {
419 419
 				$type = get_post_type( $postid );
420
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
420
+				$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
421 421
 				
422
-                if ( in_array( $type, $allowed_post_types ) ) {
422
+				if ( in_array( $type, $allowed_post_types ) ) {
423 423
 				   $result =  true;
424
-			    }
425
-            } else {
426
-                //we are not checking against a post, return true
424
+				}
425
+			} else {
426
+				//we are not checking against a post, return true
427 427
 				$result =  true;
428
-        	}
428
+			}
429 429
 		} else {
430 430
 			$result = false;
431 431
 		}
Please login to merge, or discard this patch.
includes/process/new_object.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
 
35 35
 		$object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ];
36 36
         
37
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
38
-        $new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
37
+		$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );        
38
+		$new_post_text  = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));
39 39
 
40 40
 		// insert a new post
41 41
 		$args = array(
Please login to merge, or discard this patch.
public/includes/wrap-shortcodes.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 function lasso_wrap_shortcodes( $content ) {
24 24
 	global $shortcode_tags;
25 25
 
26
-    $no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
26
+	$no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
27 27
 
28
-    if ($no_wrap_shortcode == 'on') {
29
-        return $content;
30
-    }
28
+	if ($no_wrap_shortcode == 'on') {
29
+		return $content;
30
+	}
31 31
 
32 32
 	if ( false === strpos( $content, '[' ) ) {
33 33
 		return $content;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	if ( strpos( $m[2],'aesop_'  ) === 0 ) {
79 79
 		// check against the exceptions
80 80
 		if (strpos_arr($m[2],$exception_arr1)===false) {
81
-		    return $m[0];
81
+			return $m[0];
82 82
 		}
83 83
 	}
84 84
 	if (strpos_arr($m[2],$exception_arr2)!==false) {
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 
91 91
 /* a helper function */
92 92
 function strpos_arr($haystack, $needle) {
93
-    if(!is_array($needle)) $needle = array($needle);
94
-    foreach($needle as $what) {
95
-        if(($pos = strpos($haystack, $what))!==false) return $pos;
96
-    }
97
-    return false;
93
+	if(!is_array($needle)) $needle = array($needle);
94
+	foreach($needle as $what) {
95
+		if(($pos = strpos($haystack, $what))!==false) return $pos;
96
+	}
97
+	return false;
98 98
 }
99 99
\ No newline at end of file
Please login to merge, or discard this patch.
lasso.php 1 patch
Indentation   +66 added lines, -66 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,41 +169,41 @@  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_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
174
-        if ($add_paragraph) {
175
-            add_action('wp_enqueue_scripts', array($this,'scripts'));
172
+	public function __construct(){
173
+		$add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
174
+		if ($add_paragraph) {
175
+			add_action('wp_enqueue_scripts', array($this,'scripts'));
176 176
             
177
-        }
177
+		}
178 178
 	}
179 179
     
180
-    function scripts()
181
-    {
182
-            add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
183
-            add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
184
-            add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
185
-            //wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
186
-            //wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
187
-    }
180
+	function scripts()
181
+	{
182
+			add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style'));
183
+			add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1);
184
+			add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 );
185
+			//wp_enqueue_style( 'editus-table-style', LASSO_URL.  '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true );
186
+			//wp_enqueue_script( 'editus_table',  LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true );
187
+	}
188 188
    
189
-    function editus_components_add_paragraph( $array ){
190
-        $custom = array(
191
-               'htmlparagraph' => array(
192
-                         'name'    => __('HTML Paragraph','lasso'),
193
-                          'content' => self::editus_html_paragraph(),
194
-                )
195
-        );
196
-        return array_merge( $array, $custom );
197
-    }
189
+	function editus_components_add_paragraph( $array ){
190
+		$custom = array(
191
+			   'htmlparagraph' => array(
192
+						 'name'    => __('HTML Paragraph','lasso'),
193
+						  'content' => self::editus_html_paragraph(),
194
+				)
195
+		);
196
+		return array_merge( $array, $custom );
197
+	}
198 198
     
199 199
     
200
-    function editus_html_paragraph()
201
-    {   
202
-        return '<p contenteditable="true"><br></p>';
203
-    }
200
+	function editus_html_paragraph()
201
+	{   
202
+		return '<p contenteditable="true"><br></p>';
203
+	}
204 204
 
205
-    function editus_paragraph_style()
206
-    { ?>
205
+	function editus_paragraph_style()
206
+	{ ?>
207 207
         <style>
208 208
         #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before
209 209
         { 
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
         }
213 213
         </style>
214 214
     <?php
215
-    }
215
+	}
216 216
     
217 217
 
218
-    function editus_toolbar_components_add_paragraph( ) {
219
-          ?>
218
+	function editus_toolbar_components_add_paragraph( ) {
219
+		  ?>
220 220
           <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li>
221 221
           <?php
222
-    }
222
+	}
223 223
 }
224 224
 
225 225
 new editus_paragraph();
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Indentation   +11 added lines, -11 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' );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$toolbar_show_color      = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' );
123 123
 		$toolbar_show_alignment  = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' );
124 124
         
125
-        $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
125
+		$text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false);
126 126
 		
127 127
 		$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
128 128
 		$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 		$bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor',  "b");
138 138
 		$i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor',  "i");
139 139
         
140
-        $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
141
-        $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
140
+		$add_table = lasso_editor_get_option('add_table', 'lasso_editor', false);
141
+		$add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false);
142 142
 		
143 143
 		// do we support pending status
144 144
 		$no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor');
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 			$insert_comp_ui = 'drag';
151 151
 		}
152 152
         
153
-        $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
153
+		$link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor');
154 154
         
155
-        $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
156
-        $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
155
+		$use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off');
156
+		$use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off');
157 157
 		
158 158
 		$support_custom_taxonomy   = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' );
159 159
         
160
-        $new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
160
+		$new_post_text    = lasso_editor_get_option( 'new_post_text', 'lasso_editor' );
161 161
         
162
-        $no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
162
+		$no_wrap_shortcode    = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor');
163 163
 
164 164
 ?>
165 165
 		<div class="wrap">
Please login to merge, or discard this patch.
public/includes/lasso.php 1 patch
Indentation   +136 added lines, -136 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;
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
 		$status = isset( $data['status'] ) ? $data['status'] : false;
329 329
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
330 330
 		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
331
-        $excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
331
+		$excerpt   = isset( $data['excerpt'] ) ? $data['excerpt'] : false;
332 332
 	
333 333
 
334 334
 		$args = array(
335 335
 			'ID'   			=> (int) $postid,
336 336
 			'post_name'  	=> $slug,
337 337
 			'post_status' 	=> $status,
338
-            'post_excerpt'  => wp_strip_all_tags($excerpt,true)
338
+			'post_excerpt'  => wp_strip_all_tags($excerpt,true)
339 339
 		);
340 340
 		
341 341
 		
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
 		exit;
411 411
 	}
412 412
     
413
-    public function editus_do_block()
413
+	public function editus_do_block()
414 414
 	{
415 415
 		
416 416
 		$code= $_POST["code"];
417 417
 
418
-        $out = do_blocks( $code );
418
+		$out = do_blocks( $code );
419 419
 		
420 420
 		echo $out;
421 421
 		exit;
@@ -434,67 +434,67 @@  discard block
 block discarded – undo
434 434
 			}
435 435
 		}
436 436
 		if ($code == "aesop_video") {
437
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
438
-		    echo aesop_video_shortcode($atts);
437
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php');
438
+			echo aesop_video_shortcode($atts);
439 439
 		}
440 440
 		else if ($code == "aesop_image") {
441
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
442
-		    echo aesop_image_shortcode($atts);
441
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php');
442
+			echo aesop_image_shortcode($atts);
443 443
 		}
444 444
 		else if ($code == "aesop_quote") {
445
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
446
-		    echo aesop_quote_shortcode($atts);
445
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php');
446
+			echo aesop_quote_shortcode($atts);
447 447
 		}
448 448
 		else if ($code == "aesop_parallax") {
449
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
450
-		    echo aesop_parallax_shortcode($atts);
449
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php');
450
+			echo aesop_parallax_shortcode($atts);
451 451
 		}
452 452
 		else if ($code == "aesop_character") {
453
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
454
-		    echo aesop_character_shortcode($atts);
453
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php');
454
+			echo aesop_character_shortcode($atts);
455 455
 		}
456 456
 		else if ($code == "aesop_collection") {
457
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
458
-		    echo aesop_collection_shortcode($atts);
457
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php');
458
+			echo aesop_collection_shortcode($atts);
459 459
 		}
460 460
 		else if ($code == "aesop_chapter") {
461
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
462
-		    echo aesop_chapter_shortcode($atts);
461
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php');
462
+			echo aesop_chapter_shortcode($atts);
463 463
 		}
464 464
 		else if ($code == "aesop_content") {
465
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
466
-		    echo aesop_content_shortcode($atts, $atts['content_data']);
465
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php');
466
+			echo aesop_content_shortcode($atts, $atts['content_data']);
467 467
 		}
468 468
 		else if ($code == "aesop_gallery") {
469
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
-		    echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
469
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php');
470
+			echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]');
471 471
 		}
472 472
 		else if ($code == "aesop_audio") {
473
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
474
-		    echo aesop_audio_shortcode($atts);
473
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php');
474
+			echo aesop_audio_shortcode($atts);
475 475
 		}
476 476
 		else if ($code == "aesop_document") {
477
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
478
-		    echo aesop_document_shortcode($atts);
477
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php');
478
+			echo aesop_document_shortcode($atts);
479 479
 		}
480 480
 		else if ($code == "aesop_timeline_stop") {		
481
-		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php');
482
-		    echo aesop_timeline_stop_shortcode($atts);
481
+			require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php');
482
+			echo aesop_timeline_stop_shortcode($atts);
483 483
 		}
484
-        /*else if ($code == "aesop_content") {
484
+		/*else if ($code == "aesop_content") {
485 485
 		    require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php');
486 486
 		    echo aesop_content_shortcode($atts);
487 487
 		}*/
488
-        else if ($code == "aesop_wpimg") {
489
-            self::wpimg($atts);
488
+		else if ($code == "aesop_wpimg") {
489
+			self::wpimg($atts);
490 490
 		}
491 491
 		else if ($code == "aesop_wpimg-block") {
492
-            self::wpimg_block($atts);
492
+			self::wpimg_block($atts);
493 493
 		}
494 494
 		else {
495 495
 			$code = '['.$code.' ';
496 496
 			foreach ($atts as $key => $value) {
497
-			    $code = ''.$key.'="'.$value.'" ';
497
+				$code = ''.$key.'="'.$value.'" ';
498 498
 			}
499 499
 			$code = $code.']';
500 500
 			echo do_shortcode($code);
@@ -503,102 +503,102 @@  discard block
 block discarded – undo
503 503
 		exit; 
504 504
 	}
505 505
     
506
-    public static function wpimg($atts) {
506
+	public static function wpimg($atts) {
507 507
 
508
-        echo '<figure data-component-type="wpimg"';
508
+		echo '<figure data-component-type="wpimg"';
509 509
         
510
-        $extra = "";
510
+		$extra = "";
511 511
         
512
-        // try to use srcset and sizes on new WP installs
512
+		// try to use srcset and sizes on new WP installs
513 513
 		if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) {
514 514
 			$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
515 515
 			$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
516
-            $extra = "srcset='$srcset' sizes='$sizes' ";
517
-        }
518
-        if ($atts['align']=="left") {
519
-            $extra .= 'class="alignleft';
520
-        } else if ($atts['align']=="right") {
521
-            $extra .= 'class="alignright';
522
-        } else {
523
-            $extra .= 'class="aligncenter';
524
-        }
525
-        if ($atts['imgwidth'] || $atts['imgheight']) {
526
-            if ($atts['imgwidth']) {
527
-                $extra .= 'width:'. $atts['imgwidth'].';';
528
-            }
529
-            if ($atts['imgheight']) {
530
-                $extra .= 'height:'. $atts['imgheight'].';';
531
-            }
516
+			$extra = "srcset='$srcset' sizes='$sizes' ";
517
+		}
518
+		if ($atts['align']=="left") {
519
+			$extra .= 'class="alignleft';
520
+		} else if ($atts['align']=="right") {
521
+			$extra .= 'class="alignright';
522
+		} else {
523
+			$extra .= 'class="aligncenter';
524
+		}
525
+		if ($atts['imgwidth'] || $atts['imgheight']) {
526
+			if ($atts['imgwidth']) {
527
+				$extra .= 'width:'. $atts['imgwidth'].';';
528
+			}
529
+			if ($atts['imgheight']) {
530
+				$extra .= 'height:'. $atts['imgheight'].';';
531
+			}
532 532
             
533
-        }
534
-        $extra .= '"';
533
+		}
534
+		$extra .= '"';
535 535
         
536
-        foreach ($atts as $key => $value) {
536
+		foreach ($atts as $key => $value) {
537 537
 			 echo ' data-'.$key.'="'.$value.'"';
538 538
 		}
539
-        //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
540
-        echo ' class="wp-caption lasso-component">';
541
-        $hrefset = false;
542
-        if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
543
-        {
544
-            echo '<a href="' . $atts['link'] . '">';
545
-            $hrefset = true;
546
-        } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
547
-            echo '<a href="' . $atts['img'] . '">';
548
-            $hrefset = true;
549
-        }
550
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
551
-        if ($hrefset)
552
-        {
553
-            echo '</a>';
554
-        }
555
-        if ($atts['caption'])
556
-        {
557
-            echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
558
-        }
559
-        echo '</figure>';
560
-        echo '<p><br></p>';
561
-        return;
562
-    }
539
+		//echo ' class="wp-image- lasso--wpimg__wrap lasso-component">';
540
+		echo ' class="wp-caption lasso-component">';
541
+		$hrefset = false;
542
+		if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" ))
543
+		{
544
+			echo '<a href="' . $atts['link'] . '">';
545
+			$hrefset = true;
546
+		} else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) {
547
+			echo '<a href="' . $atts['img'] . '">';
548
+			$hrefset = true;
549
+		}
550
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  .  '" '. $extra. '>';
551
+		if ($hrefset)
552
+		{
553
+			echo '</a>';
554
+		}
555
+		if ($atts['caption'])
556
+		{
557
+			echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>';
558
+		}
559
+		echo '</figure>';
560
+		echo '<p><br></p>';
561
+		return;
562
+	}
563 563
 	
564 564
 	public static function wpimg_block($atts) {
565 565
 		$imgextra = '';
566 566
 		if (!empty($atts['id'])) {
567 567
 			$imgextra = 'class="wp-image-'.$atts['id'].'"';
568 568
 		}
569
-        $figclass = 'aligncenter';
570
-        if ($atts['align']=="left") {
571
-            $figclass = 'alignleft';
572
-        } else if ($atts['align']=="right") {
573
-            $figclass = 'alignright';
574
-        } else {
575
-            $figclass = 'aligncenter';
576
-        }
569
+		$figclass = 'aligncenter';
570
+		if ($atts['align']=="left") {
571
+			$figclass = 'alignleft';
572
+		} else if ($atts['align']=="right") {
573
+			$figclass = 'alignright';
574
+		} else {
575
+			$figclass = 'aligncenter';
576
+		}
577 577
         
578
-        if ($atts['align']=="left" || $atts['align']=="right") {
579
-            echo '<div class="wp-block-image" data-component-type="wpimg-block">';
580
-            echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; 
581
-        } else {      
582
-            echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';  
583
-        }        
584
-        if (!empty($atts['link'])) {
585
-            echo '<a href="'.$atts['link'].'">';
586
-        }        
587
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
588
-        if ($atts['caption'])
589
-        {
590
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
591
-        }
592
-        if (!empty($atts['link'])) {
593
-            echo '</a>';
594
-        }
595
-        echo '</figure>';
596
-        if ($atts['align']=="left" || $atts['align']=="right") {
597
-            echo '</div>';
598
-        }  
599
-        echo '<p><br></p>';
600
-        return;
601
-    }
578
+		if ($atts['align']=="left" || $atts['align']=="right") {
579
+			echo '<div class="wp-block-image" data-component-type="wpimg-block">';
580
+			echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; 
581
+		} else {      
582
+			echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';  
583
+		}        
584
+		if (!empty($atts['link'])) {
585
+			echo '<a href="'.$atts['link'].'">';
586
+		}        
587
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
588
+		if ($atts['caption'])
589
+		{
590
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
591
+		}
592
+		if (!empty($atts['link'])) {
593
+			echo '</a>';
594
+		}
595
+		echo '</figure>';
596
+		if ($atts['align']=="left" || $atts['align']=="right") {
597
+			echo '</div>';
598
+		}  
599
+		echo '<p><br></p>';
600
+		return;
601
+	}
602 602
 	
603 603
 	
604 604
 	public function get_ase_options()
@@ -634,12 +634,12 @@  discard block
 block discarded – undo
634 634
 		exit;
635 635
 	}
636 636
     
637
-    /* This function doesn't actually publish post, but should be called when a post is published */
638
-    public function on_publish_post( ) {
637
+	/* This function doesn't actually publish post, but should be called when a post is published */
638
+	public function on_publish_post( ) {
639 639
 
640 640
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
641 641
         
642
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
642
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
643 643
 
644 644
 		exit;
645 645
 	}
@@ -697,14 +697,14 @@  discard block
 block discarded – undo
697 697
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
698 698
 			
699 699
 			if ($taxonomy =='category') {
700
-                // convert from names to category ids
700
+				// convert from names to category ids
701 701
 				$cats = array();
702 702
 				foreach ($value as $cat) {
703 703
 					$cat_id = get_cat_ID($cat);
704 704
 					if ($cat_id !=0) {
705 705
 						$cats [] = $cat_id;
706 706
 					} else if ($allow_new_category) {
707
-					    $cats [] = wp_create_category($cat);
707
+						$cats [] = wp_create_category($cat);
708 708
 					}
709 709
 				}
710 710
 				$value = $cats;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 		}
725 725
 	}
726 726
     
727
-    public function create_gallery( ) {
727
+	public function create_gallery( ) {
728 728
 
729 729
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
730 730
         
@@ -778,10 +778,10 @@  discard block
 block discarded – undo
778 778
 			'message' => 'gallery-created',
779 779
 			'id' => $postid)
780 780
 		);
781
-        exit;
781
+		exit;
782 782
 	}
783 783
     
784
-    public function update_gallery( ) {
784
+	public function update_gallery( ) {
785 785
         
786 786
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
787 787
         
@@ -797,12 +797,12 @@  discard block
 block discarded – undo
797 797
 
798 798
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
799 799
 
800
-        echo json_encode( array('message' => 'gallery-updated') );
800
+		echo json_encode( array('message' => 'gallery-updated') );
801 801
 
802
-        exit;
802
+		exit;
803 803
 	}
804 804
     
805
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
805
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
806 806
 
807 807
 		// gallery width
808 808
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 	public function set_date( $postid, $value) {
887 887
 		if( $value ) {
888 888
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
889
-            wp_update_post(
889
+			wp_update_post(
890 890
 				array (
891 891
 					'ID'            => $postid, // ID of the post to update
892 892
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.