@@ -45,7 +45,7 @@ |
||
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 |
@@ -236,16 +236,16 @@ discard block |
||
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 |
||
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; |
@@ -52,7 +52,7 @@ |
||
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; |
@@ -199,13 +199,13 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -34,8 +34,8 @@ |
||
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( |
@@ -23,11 +23,11 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -48,7 +48,7 @@ discard block |
||
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 |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - return $args; |
|
60 | + return $args; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -106,25 +106,25 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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(); |
@@ -59,7 +59,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) ), |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | height: 42px; |
115 | 115 | } |
116 | 116 | <?php |
117 | - } |
|
117 | + } |
|
118 | 118 | } else { |
119 | 119 | ?> |
120 | 120 | |
@@ -123,8 +123,8 @@ discard block |
||
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 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
242 | 242 | |
243 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
243 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
244 | 244 | |
245 | 245 | ?> |
246 | 246 | <div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" style="display:none;"> |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | function lasso_editor_text_toolbar() { |
299 | 299 | |
300 | 300 | ob_start(); |
301 | - $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
301 | + $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
302 | 302 | |
303 | 303 | |
304 | 304 | $is_mobile = wp_is_mobile(); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
318 | 318 | |
319 | 319 | // mobile styles |
320 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
320 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
321 | 321 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
322 | 322 | |
323 | 323 | //show color |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
334 | 334 | |
335 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
335 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
336 | 336 | |
337 | 337 | ?> |
338 | 338 | <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 ?>> |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | //editor options |
558 | 558 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
559 | - $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
559 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
560 | 560 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
561 | 561 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
562 | 562 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | // do we support pending status |
578 | 578 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
579 | 579 | |
580 | - $excerpt = $post->post_excerpt; |
|
580 | + $excerpt = $post->post_excerpt; |
|
581 | 581 | |
582 | 582 | ?> |
583 | 583 | <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | }?> |
675 | 675 | <?php |
676 | 676 | if ($allow_change_date) { |
677 | - $dateformat = get_option( 'date_format' ); |
|
677 | + $dateformat = get_option( 'date_format' ); |
|
678 | 678 | ?> |
679 | 679 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
680 | 680 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | $types = lasso_post_types_names(); |
769 | 769 | if ( !empty( $types ) ) { |
770 | 770 | foreach( $types as $name => $label ) |
771 | - { |
|
772 | - $type = $name; |
|
771 | + { |
|
772 | + $type = $name; |
|
773 | 773 | //$type = preg_replace( '/s\b/','', $name ); |
774 | 774 | if ($type == 'page' && !current_user_can('edit_pages')) { |
775 | 775 | continue; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | if ( !empty( $types ) ) { |
792 | 792 | // get the first element |
793 | 793 | $keys = array_keys($types); |
794 | - $type =$keys[0]; |
|
794 | + $type =$keys[0]; |
|
795 | 795 | //$type = preg_replace( '/s\b/','', $type ); |
796 | 796 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
797 | 797 | } |
@@ -819,8 +819,8 @@ discard block |
||
819 | 819 | global $post; |
820 | 820 | |
821 | 821 | global $wp_post_types; |
822 | - $labels = &$wp_post_types['post']->labels; |
|
823 | - $labels->name = 'Articles'; |
|
822 | + $labels = &$wp_post_types['post']->labels; |
|
823 | + $labels->name = 'Articles'; |
|
824 | 824 | |
825 | 825 | ob_start(); |
826 | 826 | |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | ob_start(); |
881 | 881 | |
882 | 882 | |
883 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
883 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
884 | 884 | |
885 | 885 | // let users add custom css classes |
886 | 886 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -982,10 +982,10 @@ discard block |
||
982 | 982 | function lasso_editor_options_blob() { |
983 | 983 | |
984 | 984 | $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
985 | - $codes = add_wpimg_options( $codes ); |
|
985 | + $codes = add_wpimg_options( $codes ); |
|
986 | 986 | $codes = add_wpimg_block_options( $codes ); |
987 | 987 | $codes = add_wpcover_block_options( $codes ); |
988 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
988 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
989 | 989 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
990 | 990 | |
991 | 991 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -1087,9 +1087,9 @@ discard block |
||
1087 | 1087 | $return .= '</form>'; |
1088 | 1088 | |
1089 | 1089 | // extra JS codes |
1090 | - if (isset($shortcode['codes'])) { |
|
1091 | - $return .= $shortcode['codes']; |
|
1092 | - } |
|
1090 | + if (isset($shortcode['codes'])) { |
|
1091 | + $return .= $shortcode['codes']; |
|
1092 | + } |
|
1093 | 1093 | $blob[$slug] = $return; |
1094 | 1094 | } |
1095 | 1095 | |
@@ -1098,95 +1098,95 @@ discard block |
||
1098 | 1098 | |
1099 | 1099 | |
1100 | 1100 | function add_wpimg_options( $shortcodes ) { |
1101 | - $custom = array( |
|
1102 | - 'wpimg' => array( |
|
1103 | - 'name' => __( 'Image', 'lasso' ), |
|
1104 | - 'type' => 'single', |
|
1105 | - 'atts' => array( |
|
1106 | - 'img' => array( |
|
1107 | - 'type' => 'media_upload', |
|
1108 | - 'default' => '', |
|
1109 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1110 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1111 | - ), |
|
1112 | - 'align' => array( |
|
1113 | - 'type' => 'select', |
|
1114 | - 'values' => array( |
|
1115 | - array( |
|
1116 | - 'value' => 'center', |
|
1117 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1118 | - ), |
|
1119 | - array( |
|
1120 | - 'value' => 'left', |
|
1121 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1122 | - ), |
|
1123 | - array( |
|
1124 | - 'value' => 'right', |
|
1125 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1126 | - ), |
|
1127 | - ), |
|
1128 | - 'default' => 'center', |
|
1129 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1130 | - 'tip'=>'' |
|
1131 | - ), |
|
1101 | + $custom = array( |
|
1102 | + 'wpimg' => array( |
|
1103 | + 'name' => __( 'Image', 'lasso' ), |
|
1104 | + 'type' => 'single', |
|
1105 | + 'atts' => array( |
|
1106 | + 'img' => array( |
|
1107 | + 'type' => 'media_upload', |
|
1108 | + 'default' => '', |
|
1109 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1110 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1111 | + ), |
|
1112 | + 'align' => array( |
|
1113 | + 'type' => 'select', |
|
1114 | + 'values' => array( |
|
1115 | + array( |
|
1116 | + 'value' => 'center', |
|
1117 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1118 | + ), |
|
1119 | + array( |
|
1120 | + 'value' => 'left', |
|
1121 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1122 | + ), |
|
1123 | + array( |
|
1124 | + 'value' => 'right', |
|
1125 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1126 | + ), |
|
1127 | + ), |
|
1128 | + 'default' => 'center', |
|
1129 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1130 | + 'tip'=>'' |
|
1131 | + ), |
|
1132 | 1132 | |
1133 | - 'imgwidth' => array( |
|
1134 | - 'type' => 'text_small', |
|
1135 | - 'default' => '300px', |
|
1136 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1137 | - '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' ) |
|
1138 | - ), |
|
1139 | - 'imgheight' => array( |
|
1140 | - 'type' => 'text_small', |
|
1141 | - 'default' => '', |
|
1142 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1143 | - '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' ) |
|
1144 | - ), |
|
1145 | - 'linkoption' => array( |
|
1146 | - 'type' => 'select', |
|
1147 | - 'values' => array( |
|
1148 | - array( |
|
1149 | - 'value' => 'none', |
|
1150 | - 'name' => __( 'None', 'aesop-core' ) |
|
1151 | - ), |
|
1152 | - array( |
|
1153 | - 'value' => 'img', |
|
1154 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1155 | - ), |
|
1156 | - array( |
|
1157 | - 'value' => 'url', |
|
1158 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1159 | - ), |
|
1160 | - ), |
|
1161 | - 'default' => 'none', |
|
1162 | - 'desc' => __( 'Link', 'lasso' ), |
|
1163 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1164 | - ), |
|
1133 | + 'imgwidth' => array( |
|
1134 | + 'type' => 'text_small', |
|
1135 | + 'default' => '300px', |
|
1136 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
1137 | + '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' ) |
|
1138 | + ), |
|
1139 | + 'imgheight' => array( |
|
1140 | + 'type' => 'text_small', |
|
1141 | + 'default' => '', |
|
1142 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
1143 | + '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' ) |
|
1144 | + ), |
|
1145 | + 'linkoption' => array( |
|
1146 | + 'type' => 'select', |
|
1147 | + 'values' => array( |
|
1148 | + array( |
|
1149 | + 'value' => 'none', |
|
1150 | + 'name' => __( 'None', 'aesop-core' ) |
|
1151 | + ), |
|
1152 | + array( |
|
1153 | + 'value' => 'img', |
|
1154 | + 'name' => __( 'Image', 'aesop-core' ) |
|
1155 | + ), |
|
1156 | + array( |
|
1157 | + 'value' => 'url', |
|
1158 | + 'name' => __( 'URL', 'aesop-core' ) |
|
1159 | + ), |
|
1160 | + ), |
|
1161 | + 'default' => 'none', |
|
1162 | + 'desc' => __( 'Link', 'lasso' ), |
|
1163 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1164 | + ), |
|
1165 | 1165 | |
1166 | - 'link' => array( |
|
1167 | - 'type' => 'text', |
|
1168 | - 'default' => '', |
|
1169 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1170 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1171 | - ), |
|
1172 | - 'alt' => array( |
|
1173 | - 'type' => 'text', |
|
1174 | - 'default' => '', |
|
1175 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1176 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1177 | - ), |
|
1166 | + 'link' => array( |
|
1167 | + 'type' => 'text', |
|
1168 | + 'default' => '', |
|
1169 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
1170 | + 'tip' => __( 'URL link', 'lasso' ) |
|
1171 | + ), |
|
1172 | + 'alt' => array( |
|
1173 | + 'type' => 'text', |
|
1174 | + 'default' => '', |
|
1175 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1176 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1177 | + ), |
|
1178 | 1178 | |
1179 | - 'caption' => array( |
|
1180 | - 'type' => 'text_area', |
|
1181 | - 'default' => '', |
|
1182 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1183 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1184 | - ), |
|
1179 | + 'caption' => array( |
|
1180 | + 'type' => 'text_area', |
|
1181 | + 'default' => '', |
|
1182 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1183 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1184 | + ), |
|
1185 | 1185 | |
1186 | 1186 | |
1187 | - ), |
|
1188 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1189 | - 'codes' => '<script> |
|
1187 | + ), |
|
1188 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
1189 | + 'codes' => '<script> |
|
1190 | 1190 | jQuery(document).ready(function($){ |
1191 | 1191 | function linkSetting(l){ |
1192 | 1192 | if ( l=="url") { |
@@ -1206,101 +1206,101 @@ discard block |
||
1206 | 1206 | }) |
1207 | 1207 | }); |
1208 | 1208 | </script>' |
1209 | - ) |
|
1210 | - ); |
|
1209 | + ) |
|
1210 | + ); |
|
1211 | 1211 | |
1212 | - return array_merge( $shortcodes, $custom ); |
|
1212 | + return array_merge( $shortcodes, $custom ); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | function add_wpimg_block_options( $shortcodes ) { |
1216 | - $custom = array( |
|
1217 | - 'wpimg-block' => array( |
|
1218 | - 'name' => __( 'Image', 'lasso' ), |
|
1219 | - 'type' => 'single', |
|
1220 | - 'atts' => array( |
|
1221 | - 'img' => array( |
|
1222 | - 'type' => 'media_upload', |
|
1223 | - 'default' => '', |
|
1224 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1225 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1226 | - ), |
|
1227 | - 'align' => array( |
|
1228 | - 'type' => 'select', |
|
1229 | - 'values' => array( |
|
1230 | - array( |
|
1231 | - 'value' => 'center', |
|
1232 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1233 | - ), |
|
1234 | - array( |
|
1235 | - 'value' => 'left', |
|
1236 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1237 | - ), |
|
1238 | - array( |
|
1239 | - 'value' => 'right', |
|
1240 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1241 | - ), |
|
1242 | - ), |
|
1243 | - 'default' => 'center', |
|
1244 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1245 | - 'tip'=>'' |
|
1246 | - ), |
|
1247 | - 'alt' => array( |
|
1248 | - 'type' => 'text', |
|
1249 | - 'default' => '', |
|
1250 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1251 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1252 | - ), |
|
1253 | - 'caption' => array( |
|
1254 | - 'type' => 'text', |
|
1255 | - 'default' => '', |
|
1256 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1257 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1258 | - ), |
|
1259 | - 'link' => array( |
|
1260 | - 'type' => 'text', |
|
1261 | - 'default' => '', |
|
1262 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1263 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1264 | - ), |
|
1216 | + $custom = array( |
|
1217 | + 'wpimg-block' => array( |
|
1218 | + 'name' => __( 'Image', 'lasso' ), |
|
1219 | + 'type' => 'single', |
|
1220 | + 'atts' => array( |
|
1221 | + 'img' => array( |
|
1222 | + 'type' => 'media_upload', |
|
1223 | + 'default' => '', |
|
1224 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1225 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1226 | + ), |
|
1227 | + 'align' => array( |
|
1228 | + 'type' => 'select', |
|
1229 | + 'values' => array( |
|
1230 | + array( |
|
1231 | + 'value' => 'center', |
|
1232 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1233 | + ), |
|
1234 | + array( |
|
1235 | + 'value' => 'left', |
|
1236 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1237 | + ), |
|
1238 | + array( |
|
1239 | + 'value' => 'right', |
|
1240 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1241 | + ), |
|
1242 | + ), |
|
1243 | + 'default' => 'center', |
|
1244 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1245 | + 'tip'=>'' |
|
1246 | + ), |
|
1247 | + 'alt' => array( |
|
1248 | + 'type' => 'text', |
|
1249 | + 'default' => '', |
|
1250 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1251 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1252 | + ), |
|
1253 | + 'caption' => array( |
|
1254 | + 'type' => 'text', |
|
1255 | + 'default' => '', |
|
1256 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1257 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1258 | + ), |
|
1259 | + 'link' => array( |
|
1260 | + 'type' => 'text', |
|
1261 | + 'default' => '', |
|
1262 | + 'desc' => __( 'Link URL', 'lasso' ), |
|
1263 | + 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1264 | + ), |
|
1265 | 1265 | |
1266 | 1266 | |
1267 | - ), |
|
1268 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1269 | - 'codes' => '<script> |
|
1267 | + ), |
|
1268 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1269 | + 'codes' => '<script> |
|
1270 | 1270 | jQuery(document).ready(function($){ |
1271 | 1271 | |
1272 | 1272 | }); |
1273 | 1273 | </script>' |
1274 | - ) |
|
1275 | - ); |
|
1274 | + ) |
|
1275 | + ); |
|
1276 | 1276 | |
1277 | - return array_merge( $shortcodes, $custom ); |
|
1277 | + return array_merge( $shortcodes, $custom ); |
|
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | function add_wpcover_block_options( $shortcodes ) { |
1281 | - $custom = array( |
|
1282 | - 'wpcover-block' => array( |
|
1283 | - 'name' => __( 'Cover', 'lasso' ), |
|
1284 | - 'type' => 'single', |
|
1285 | - 'atts' => array( |
|
1286 | - 'img' => array( |
|
1287 | - 'type' => 'media_upload', |
|
1288 | - 'default' => '', |
|
1289 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1290 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1291 | - ) |
|
1292 | - |
|
1293 | - ), |
|
1294 | - 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
1295 | - 'codes' => '<script> |
|
1281 | + $custom = array( |
|
1282 | + 'wpcover-block' => array( |
|
1283 | + 'name' => __( 'Cover', 'lasso' ), |
|
1284 | + 'type' => 'single', |
|
1285 | + 'atts' => array( |
|
1286 | + 'img' => array( |
|
1287 | + 'type' => 'media_upload', |
|
1288 | + 'default' => '', |
|
1289 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1290 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1291 | + ) |
|
1292 | + |
|
1293 | + ), |
|
1294 | + 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
1295 | + 'codes' => '<script> |
|
1296 | 1296 | jQuery(document).ready(function($){ |
1297 | 1297 | |
1298 | 1298 | }); |
1299 | 1299 | </script>' |
1300 | - ) |
|
1301 | - ); |
|
1300 | + ) |
|
1301 | + ); |
|
1302 | 1302 | |
1303 | - return array_merge( $shortcodes, $custom ); |
|
1303 | + return array_merge( $shortcodes, $custom ); |
|
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | /** |
@@ -1345,23 +1345,23 @@ discard block |
||
1345 | 1345 | * @return string |
1346 | 1346 | */ |
1347 | 1347 | function lasso_editor_adjustBrightness($hex, $steps) { |
1348 | - $steps = max(-255, min(255, $steps)); |
|
1348 | + $steps = max(-255, min(255, $steps)); |
|
1349 | 1349 | |
1350 | - // Normalize into a six character long hex string |
|
1351 | - $hex = str_replace('#', '', $hex); |
|
1352 | - if (strlen($hex) == 3) { |
|
1353 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1354 | - } |
|
1350 | + // Normalize into a six character long hex string |
|
1351 | + $hex = str_replace('#', '', $hex); |
|
1352 | + if (strlen($hex) == 3) { |
|
1353 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1354 | + } |
|
1355 | 1355 | |
1356 | - // Split into three parts: R, G and B |
|
1357 | - $color_parts = str_split($hex, 2); |
|
1358 | - $return = '#'; |
|
1356 | + // Split into three parts: R, G and B |
|
1357 | + $color_parts = str_split($hex, 2); |
|
1358 | + $return = '#'; |
|
1359 | 1359 | |
1360 | - foreach ($color_parts as $color) { |
|
1361 | - $color = hexdec($color); // Convert to decimal |
|
1362 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1363 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1364 | - } |
|
1360 | + foreach ($color_parts as $color) { |
|
1361 | + $color = hexdec($color); // Convert to decimal |
|
1362 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1363 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1364 | + } |
|
1365 | 1365 | |
1366 | - return $return; |
|
1366 | + return $return; |
|
1367 | 1367 | } |