Completed
Push — master ( 3737f0...b3eac7 )
by
unknown
43s
created
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   +129 added lines, -129 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,95 +503,95 @@  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
-        echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
579
-        echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';   
580
-        if (!empty($atts['link'])) {
581
-            echo '<a href="'.$atts['link'].'">';
582
-        }        
583
-        echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
584
-        if ($atts['caption'])
585
-        {
586
-            echo '<figcaption>'.$atts['caption'].'</figcaption>';
587
-        }
588
-        if (!empty($atts['link'])) {
589
-            echo '</a>';
590
-        }
591
-        echo '</figure></div>';
592
-        echo '<p><br></p>';
593
-        return;
594
-    }
578
+		echo '<div class="wp-block-image" data-component-type="wpimg-block">'; 
579
+		echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">';   
580
+		if (!empty($atts['link'])) {
581
+			echo '<a href="'.$atts['link'].'">';
582
+		}        
583
+		echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt']  . '"' . $imgextra . ' >';
584
+		if ($atts['caption'])
585
+		{
586
+			echo '<figcaption>'.$atts['caption'].'</figcaption>';
587
+		}
588
+		if (!empty($atts['link'])) {
589
+			echo '</a>';
590
+		}
591
+		echo '</figure></div>';
592
+		echo '<p><br></p>';
593
+		return;
594
+	}
595 595
 	
596 596
 	
597 597
 	public function get_ase_options()
@@ -627,12 +627,12 @@  discard block
 block discarded – undo
627 627
 		exit;
628 628
 	}
629 629
     
630
-    /* This function doesn't actually publish post, but should be called when a post is published */
631
-    public function on_publish_post( ) {
630
+	/* This function doesn't actually publish post, but should be called when a post is published */
631
+	public function on_publish_post( ) {
632 632
 
633 633
 		$post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false;
634 634
         
635
-        do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
635
+		do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) );
636 636
 
637 637
 		exit;
638 638
 	}
@@ -690,14 +690,14 @@  discard block
 block discarded – undo
690 690
 			$allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' );
691 691
 			
692 692
 			if ($taxonomy =='category') {
693
-                // convert from names to category ids
693
+				// convert from names to category ids
694 694
 				$cats = array();
695 695
 				foreach ($value as $cat) {
696 696
 					$cat_id = get_cat_ID($cat);
697 697
 					if ($cat_id !=0) {
698 698
 						$cats [] = $cat_id;
699 699
 					} else if ($allow_new_category) {
700
-					    $cats [] = wp_create_category($cat);
700
+						$cats [] = wp_create_category($cat);
701 701
 					}
702 702
 				}
703 703
 				$value = $cats;
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 		}
718 718
 	}
719 719
     
720
-    public function create_gallery( ) {
720
+	public function create_gallery( ) {
721 721
 
722 722
 		$postid  	= isset( $_POST['postid'] ) ? $_POST['postid'] : false;
723 723
         
@@ -771,10 +771,10 @@  discard block
 block discarded – undo
771 771
 			'message' => 'gallery-created',
772 772
 			'id' => $postid)
773 773
 		);
774
-        exit;
774
+		exit;
775 775
 	}
776 776
     
777
-    public function update_gallery( ) {
777
+	public function update_gallery( ) {
778 778
         
779 779
 		$options      = isset( $_POST['fields'] ) ? $_POST['fields'] : false;
780 780
         
@@ -790,12 +790,12 @@  discard block
 block discarded – undo
790 790
 
791 791
 		self::save_gallery_options( $postid, $gallery_ids, $options, $type );
792 792
 
793
-        echo json_encode( array('message' => 'gallery-updated') );
793
+		echo json_encode( array('message' => 'gallery-updated') );
794 794
 
795
-        exit;
795
+		exit;
796 796
 	}
797 797
     
798
-    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
798
+	public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
799 799
 
800 800
 		// gallery width
801 801
 		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 	public function set_date( $postid, $value) {
880 880
 		if( $value ) {
881 881
 			$value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 ));
882
-            wp_update_post(
882
+			wp_update_post(
883 883
 				array (
884 884
 					'ID'            => $postid, // ID of the post to update
885 885
 					'post_date'     => date( 'Y-m-d H:i:s',  strtotime($value) ),
Please login to merge, or discard this patch.