@@ -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 |
@@ -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,9 +982,9 @@ 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 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
987 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
988 | 988 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
989 | 989 | |
990 | 990 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -1086,9 +1086,9 @@ discard block |
||
1086 | 1086 | $return .= '</form>'; |
1087 | 1087 | |
1088 | 1088 | // extra JS codes |
1089 | - if (isset($shortcode['codes'])) { |
|
1090 | - $return .= $shortcode['codes']; |
|
1091 | - } |
|
1089 | + if (isset($shortcode['codes'])) { |
|
1090 | + $return .= $shortcode['codes']; |
|
1091 | + } |
|
1092 | 1092 | $blob[$slug] = $return; |
1093 | 1093 | } |
1094 | 1094 | |
@@ -1097,95 +1097,95 @@ discard block |
||
1097 | 1097 | |
1098 | 1098 | |
1099 | 1099 | function add_wpimg_options( $shortcodes ) { |
1100 | - $custom = array( |
|
1101 | - 'wpimg' => array( |
|
1102 | - 'name' => __( 'Image', 'lasso' ), |
|
1103 | - 'type' => 'single', |
|
1104 | - 'atts' => array( |
|
1105 | - 'img' => array( |
|
1106 | - 'type' => 'media_upload', |
|
1107 | - 'default' => '', |
|
1108 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1109 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1110 | - ), |
|
1111 | - 'align' => array( |
|
1112 | - 'type' => 'select', |
|
1113 | - 'values' => array( |
|
1114 | - array( |
|
1115 | - 'value' => 'center', |
|
1116 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1117 | - ), |
|
1118 | - array( |
|
1119 | - 'value' => 'left', |
|
1120 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1121 | - ), |
|
1122 | - array( |
|
1123 | - 'value' => 'right', |
|
1124 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1125 | - ), |
|
1126 | - ), |
|
1127 | - 'default' => 'center', |
|
1128 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1129 | - 'tip'=>'' |
|
1130 | - ), |
|
1100 | + $custom = array( |
|
1101 | + 'wpimg' => array( |
|
1102 | + 'name' => __( 'Image', 'lasso' ), |
|
1103 | + 'type' => 'single', |
|
1104 | + 'atts' => array( |
|
1105 | + 'img' => array( |
|
1106 | + 'type' => 'media_upload', |
|
1107 | + 'default' => '', |
|
1108 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1109 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1110 | + ), |
|
1111 | + 'align' => array( |
|
1112 | + 'type' => 'select', |
|
1113 | + 'values' => array( |
|
1114 | + array( |
|
1115 | + 'value' => 'center', |
|
1116 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1117 | + ), |
|
1118 | + array( |
|
1119 | + 'value' => 'left', |
|
1120 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1121 | + ), |
|
1122 | + array( |
|
1123 | + 'value' => 'right', |
|
1124 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1125 | + ), |
|
1126 | + ), |
|
1127 | + 'default' => 'center', |
|
1128 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1129 | + 'tip'=>'' |
|
1130 | + ), |
|
1131 | 1131 | |
1132 | - 'imgwidth' => array( |
|
1133 | - 'type' => 'text_small', |
|
1134 | - 'default' => '300px', |
|
1135 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1136 | - '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' ) |
|
1137 | - ), |
|
1138 | - 'imgheight' => array( |
|
1139 | - 'type' => 'text_small', |
|
1140 | - 'default' => '', |
|
1141 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1142 | - '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' ) |
|
1143 | - ), |
|
1144 | - 'linkoption' => array( |
|
1145 | - 'type' => 'select', |
|
1146 | - 'values' => array( |
|
1147 | - array( |
|
1148 | - 'value' => 'none', |
|
1149 | - 'name' => __( 'None', 'aesop-core' ) |
|
1150 | - ), |
|
1151 | - array( |
|
1152 | - 'value' => 'img', |
|
1153 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1154 | - ), |
|
1155 | - array( |
|
1156 | - 'value' => 'url', |
|
1157 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1158 | - ), |
|
1159 | - ), |
|
1160 | - 'default' => 'none', |
|
1161 | - 'desc' => __( 'Link', 'lasso' ), |
|
1162 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1163 | - ), |
|
1132 | + 'imgwidth' => array( |
|
1133 | + 'type' => 'text_small', |
|
1134 | + 'default' => '300px', |
|
1135 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
1136 | + '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' ) |
|
1137 | + ), |
|
1138 | + 'imgheight' => array( |
|
1139 | + 'type' => 'text_small', |
|
1140 | + 'default' => '', |
|
1141 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
1142 | + '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' ) |
|
1143 | + ), |
|
1144 | + 'linkoption' => array( |
|
1145 | + 'type' => 'select', |
|
1146 | + 'values' => array( |
|
1147 | + array( |
|
1148 | + 'value' => 'none', |
|
1149 | + 'name' => __( 'None', 'aesop-core' ) |
|
1150 | + ), |
|
1151 | + array( |
|
1152 | + 'value' => 'img', |
|
1153 | + 'name' => __( 'Image', 'aesop-core' ) |
|
1154 | + ), |
|
1155 | + array( |
|
1156 | + 'value' => 'url', |
|
1157 | + 'name' => __( 'URL', 'aesop-core' ) |
|
1158 | + ), |
|
1159 | + ), |
|
1160 | + 'default' => 'none', |
|
1161 | + 'desc' => __( 'Link', 'lasso' ), |
|
1162 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1163 | + ), |
|
1164 | 1164 | |
1165 | - 'link' => array( |
|
1166 | - 'type' => 'text', |
|
1167 | - 'default' => '', |
|
1168 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1169 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1170 | - ), |
|
1171 | - 'alt' => array( |
|
1172 | - 'type' => 'text', |
|
1173 | - 'default' => '', |
|
1174 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1175 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1176 | - ), |
|
1165 | + 'link' => array( |
|
1166 | + 'type' => 'text', |
|
1167 | + 'default' => '', |
|
1168 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
1169 | + 'tip' => __( 'URL link', 'lasso' ) |
|
1170 | + ), |
|
1171 | + 'alt' => array( |
|
1172 | + 'type' => 'text', |
|
1173 | + 'default' => '', |
|
1174 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1175 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1176 | + ), |
|
1177 | 1177 | |
1178 | - 'caption' => array( |
|
1179 | - 'type' => 'text_area', |
|
1180 | - 'default' => '', |
|
1181 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1182 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1183 | - ), |
|
1178 | + 'caption' => array( |
|
1179 | + 'type' => 'text_area', |
|
1180 | + 'default' => '', |
|
1181 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1182 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1183 | + ), |
|
1184 | 1184 | |
1185 | 1185 | |
1186 | - ), |
|
1187 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1188 | - 'codes' => '<script> |
|
1186 | + ), |
|
1187 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
1188 | + 'codes' => '<script> |
|
1189 | 1189 | jQuery(document).ready(function($){ |
1190 | 1190 | function linkSetting(l){ |
1191 | 1191 | if ( l=="url") { |
@@ -1205,75 +1205,75 @@ discard block |
||
1205 | 1205 | }) |
1206 | 1206 | }); |
1207 | 1207 | </script>' |
1208 | - ) |
|
1209 | - ); |
|
1208 | + ) |
|
1209 | + ); |
|
1210 | 1210 | |
1211 | - return array_merge( $shortcodes, $custom ); |
|
1211 | + return array_merge( $shortcodes, $custom ); |
|
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | function add_wpimg_block_options( $shortcodes ) { |
1215 | - $custom = array( |
|
1216 | - 'wpimg-block' => array( |
|
1217 | - 'name' => __( 'Image', 'lasso' ), |
|
1218 | - 'type' => 'single', |
|
1219 | - 'atts' => array( |
|
1220 | - 'img' => array( |
|
1221 | - 'type' => 'media_upload', |
|
1222 | - 'default' => '', |
|
1223 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1224 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1225 | - ), |
|
1226 | - 'align' => array( |
|
1227 | - 'type' => 'select', |
|
1228 | - 'values' => array( |
|
1229 | - array( |
|
1230 | - 'value' => 'center', |
|
1231 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1232 | - ), |
|
1233 | - array( |
|
1234 | - 'value' => 'left', |
|
1235 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1236 | - ), |
|
1237 | - array( |
|
1238 | - 'value' => 'right', |
|
1239 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1240 | - ), |
|
1241 | - ), |
|
1242 | - 'default' => 'center', |
|
1243 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1244 | - 'tip'=>'' |
|
1245 | - ), |
|
1246 | - 'alt' => array( |
|
1247 | - 'type' => 'text', |
|
1248 | - 'default' => '', |
|
1249 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1250 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1251 | - ), |
|
1252 | - 'caption' => array( |
|
1253 | - 'type' => 'text', |
|
1254 | - 'default' => '', |
|
1255 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1256 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1257 | - ), |
|
1258 | - 'link' => array( |
|
1259 | - 'type' => 'text', |
|
1260 | - 'default' => '', |
|
1261 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1262 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1263 | - ), |
|
1215 | + $custom = array( |
|
1216 | + 'wpimg-block' => array( |
|
1217 | + 'name' => __( 'Image', 'lasso' ), |
|
1218 | + 'type' => 'single', |
|
1219 | + 'atts' => array( |
|
1220 | + 'img' => array( |
|
1221 | + 'type' => 'media_upload', |
|
1222 | + 'default' => '', |
|
1223 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1224 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1225 | + ), |
|
1226 | + 'align' => array( |
|
1227 | + 'type' => 'select', |
|
1228 | + 'values' => array( |
|
1229 | + array( |
|
1230 | + 'value' => 'center', |
|
1231 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1232 | + ), |
|
1233 | + array( |
|
1234 | + 'value' => 'left', |
|
1235 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1236 | + ), |
|
1237 | + array( |
|
1238 | + 'value' => 'right', |
|
1239 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1240 | + ), |
|
1241 | + ), |
|
1242 | + 'default' => 'center', |
|
1243 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1244 | + 'tip'=>'' |
|
1245 | + ), |
|
1246 | + 'alt' => array( |
|
1247 | + 'type' => 'text', |
|
1248 | + 'default' => '', |
|
1249 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1250 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1251 | + ), |
|
1252 | + 'caption' => array( |
|
1253 | + 'type' => 'text', |
|
1254 | + 'default' => '', |
|
1255 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1256 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1257 | + ), |
|
1258 | + 'link' => array( |
|
1259 | + 'type' => 'text', |
|
1260 | + 'default' => '', |
|
1261 | + 'desc' => __( 'Link URL', 'lasso' ), |
|
1262 | + 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1263 | + ), |
|
1264 | 1264 | |
1265 | 1265 | |
1266 | - ), |
|
1267 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1268 | - 'codes' => '<script> |
|
1266 | + ), |
|
1267 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1268 | + 'codes' => '<script> |
|
1269 | 1269 | jQuery(document).ready(function($){ |
1270 | 1270 | |
1271 | 1271 | }); |
1272 | 1272 | </script>' |
1273 | - ) |
|
1274 | - ); |
|
1273 | + ) |
|
1274 | + ); |
|
1275 | 1275 | |
1276 | - return array_merge( $shortcodes, $custom ); |
|
1276 | + return array_merge( $shortcodes, $custom ); |
|
1277 | 1277 | } |
1278 | 1278 | |
1279 | 1279 | /** |
@@ -1318,23 +1318,23 @@ discard block |
||
1318 | 1318 | * @return string |
1319 | 1319 | */ |
1320 | 1320 | function lasso_editor_adjustBrightness($hex, $steps) { |
1321 | - $steps = max(-255, min(255, $steps)); |
|
1321 | + $steps = max(-255, min(255, $steps)); |
|
1322 | 1322 | |
1323 | - // Normalize into a six character long hex string |
|
1324 | - $hex = str_replace('#', '', $hex); |
|
1325 | - if (strlen($hex) == 3) { |
|
1326 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1327 | - } |
|
1323 | + // Normalize into a six character long hex string |
|
1324 | + $hex = str_replace('#', '', $hex); |
|
1325 | + if (strlen($hex) == 3) { |
|
1326 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1327 | + } |
|
1328 | 1328 | |
1329 | - // Split into three parts: R, G and B |
|
1330 | - $color_parts = str_split($hex, 2); |
|
1331 | - $return = '#'; |
|
1329 | + // Split into three parts: R, G and B |
|
1330 | + $color_parts = str_split($hex, 2); |
|
1331 | + $return = '#'; |
|
1332 | 1332 | |
1333 | - foreach ($color_parts as $color) { |
|
1334 | - $color = hexdec($color); // Convert to decimal |
|
1335 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1336 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1337 | - } |
|
1333 | + foreach ($color_parts as $color) { |
|
1334 | + $color = hexdec($color); // Convert to decimal |
|
1335 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1336 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1337 | + } |
|
1338 | 1338 | |
1339 | - return $return; |
|
1339 | + return $return; |
|
1340 | 1340 | } |
@@ -15,29 +15,29 @@ discard block |
||
15 | 15 | add_action('wp_enqueue_scripts', array($this,'scripts')); |
16 | 16 | } |
17 | 17 | |
18 | - function is_multipage() |
|
19 | - { |
|
20 | - global $post; |
|
21 | - $pos = strpos($post->post_content, "<!--nextpage-->"); |
|
22 | - if (!$pos) return -1; |
|
18 | + function is_multipage() |
|
19 | + { |
|
20 | + global $post; |
|
21 | + $pos = strpos($post->post_content, "<!--nextpage-->"); |
|
22 | + if (!$pos) return -1; |
|
23 | 23 | |
24 | - global $wp; |
|
25 | - $url = home_url( $wp->request ); |
|
26 | - $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1; |
|
27 | - return $index; |
|
28 | - } |
|
24 | + global $wp; |
|
25 | + $url = home_url( $wp->request ); |
|
26 | + $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1; |
|
27 | + return $index; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | public function scripts(){ |
31 | 31 | |
32 | 32 | |
33 | 33 | global $post; |
34 | 34 | if ( lasso_user_can('edit_posts') |
35 | - /* uncomment this line to disable Editus on Gutenberg posts*/ |
|
36 | - /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
|
37 | - ) { |
|
35 | + /* uncomment this line to disable Editus on Gutenberg posts*/ |
|
36 | + /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
|
37 | + ) { |
|
38 | 38 | |
39 | 39 | /** Returns the time offset from UTC |
40 | - */ |
|
40 | + */ |
|
41 | 41 | function get_UTC_offset() { |
42 | 42 | $timezone_string = get_option( 'timezone_string' ); |
43 | 43 | if (empty( $timezone_string ) ) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
54 | 54 | |
55 | - //don't load autocomplete if it's a stockholm theme |
|
55 | + //don't load autocomplete if it's a stockholm theme |
|
56 | 56 | $themename = wp_get_theme()->get('Name'); |
57 | 57 | if ($themename !='Stockholm' ) { |
58 | 58 | wp_enqueue_script('jquery-ui-autocomplete'); |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
91 | 91 | $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
92 | 92 | |
93 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
93 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
94 | 94 | |
95 | - $use_wpimgblock = false; |
|
95 | + $use_wpimgblock = false; |
|
96 | 96 | |
97 | - $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
97 | + $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
98 | 98 | |
99 | - $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off'); |
|
99 | + $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off'); |
|
100 | 100 | |
101 | 101 | |
102 | 102 | //text alignement |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // allow change date for post |
112 | 112 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
113 | 113 | |
114 | - // support custom taxonomy |
|
114 | + // support custom taxonomy |
|
115 | 115 | $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
116 | 116 | |
117 | 117 | if ($show_color) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $tz_offset = get_UTC_offset(); |
138 | 138 | $post_date = get_the_time('U', $postid); |
139 | 139 | $time = (time()+$tz_offset); |
140 | - $delta = $time - $post_date; |
|
140 | + $delta = $time - $post_date; |
|
141 | 141 | |
142 | 142 | $strings = array( |
143 | 143 | 'save' => __('Save','lasso'), |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | 'catsPlaceholder' => __('add categories...'), |
183 | 183 | 'tagsPlaceholder' => __('add tags...'), |
184 | - 'taxoPlaceholder' => __('add taxonomy terms...'), |
|
184 | + 'taxoPlaceholder' => __('add taxonomy terms...'), |
|
185 | 185 | |
186 | 186 | |
187 | 187 | ); |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
194 | 194 | |
195 | 195 | |
196 | - if ($allow_change_date) { |
|
197 | - $permalink = get_site_url().'/?p='.$postid; |
|
198 | - } else { |
|
199 | - $permalink = get_permalink($postid); |
|
200 | - } |
|
196 | + if ($allow_change_date) { |
|
197 | + $permalink = get_site_url().'/?p='.$postid; |
|
198 | + } else { |
|
199 | + $permalink = get_permalink($postid); |
|
200 | + } |
|
201 | 201 | |
202 | 202 | // rest api |
203 | 203 | $rest_nonce = ''; |
@@ -217,17 +217,17 @@ discard block |
||
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
220 | - //excerpt |
|
221 | - $post_excerpt = ""; |
|
222 | - $post_excerpt = wp_strip_all_tags($post->post_excerpt,true); |
|
220 | + //excerpt |
|
221 | + $post_excerpt = ""; |
|
222 | + $post_excerpt = wp_strip_all_tags($post->post_excerpt,true); |
|
223 | 223 | |
224 | - //find if this is multi page. -1 if not |
|
225 | - $multipage = self::is_multipage(); |
|
226 | - $post_content = ""; |
|
227 | - //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
228 | - //if ($multipage != -1) { |
|
229 | - $post_content = $post->post_content; |
|
230 | - //} |
|
224 | + //find if this is multi page. -1 if not |
|
225 | + $multipage = self::is_multipage(); |
|
226 | + $post_content = ""; |
|
227 | + //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
228 | + //if ($multipage != -1) { |
|
229 | + $post_content = $post->post_content; |
|
230 | + //} |
|
231 | 231 | |
232 | 232 | //get custom taxonomy |
233 | 233 | $custom_taxonomies = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']); |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | $existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy ); |
241 | 241 | } |
242 | 242 | |
243 | - $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
244 | - $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'))); |
|
243 | + $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
244 | + $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'))); |
|
245 | 245 | |
246 | 246 | |
247 | 247 | // localized objects |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | 'nonce' => wp_create_nonce('lasso_editor'), |
271 | 271 | 'handle' => lasso_editor_settings_toolbar(), |
272 | 272 | 'toolbar' => lasso_editor_text_toolbar(), |
273 | - 'toolbarPopup' => $text_select_popup ? lasso_editor_selected_text_toolbar(): false, |
|
273 | + 'toolbarPopup' => $text_select_popup ? lasso_editor_selected_text_toolbar(): false, |
|
274 | 274 | 'toolbarHeadings' => $toolbar_headings, |
275 | 275 | 'toolbarHeadingsH4' => $toolbar_headings_h4, |
276 | 276 | 'component_modal' => lasso_editor_component_modal(), |
@@ -322,19 +322,19 @@ discard block |
||
322 | 322 | 'customFields' => $custom_fields, |
323 | 323 | 'clickToInsert' => ($insert_comp_ui =='click'), |
324 | 324 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
325 | - 'rtl' => is_rtl(), |
|
325 | + 'rtl' => is_rtl(), |
|
326 | 326 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
327 | 327 | 'linksEditable' => $links_editable, |
328 | 328 | 'supportPendingStatus' => !$no_pending_status, |
329 | 329 | 'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table><p></p>'), |
330 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
331 | - 'multipages'=> $multipage, |
|
332 | - 'post_content'=>$post_content, |
|
333 | - 'post_excerpt'=>$post_excerpt, |
|
334 | - 'supCustTaxo' => $support_custom_taxonomy == 'on', |
|
335 | - 'oldWPimg'=> $use_old_wpimg =='on', |
|
336 | - 'useWPImgBlk'=> $use_wpimgblock, |
|
337 | - 'prefixHTTP'=> $link_prefix_http =='on' |
|
330 | + 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
331 | + 'multipages'=> $multipage, |
|
332 | + 'post_content'=>$post_content, |
|
333 | + 'post_excerpt'=>$post_excerpt, |
|
334 | + 'supCustTaxo' => $support_custom_taxonomy == 'on', |
|
335 | + 'oldWPimg'=> $use_old_wpimg =='on', |
|
336 | + 'useWPImgBlk'=> $use_wpimgblock, |
|
337 | + 'prefixHTTP'=> $link_prefix_http =='on' |
|
338 | 338 | ); |
339 | 339 | |
340 | 340 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | |
343 | 343 | |
344 | 344 | if (!$using_restapiv2) { |
345 | - // enqueue REST API V1 |
|
345 | + // enqueue REST API V1 |
|
346 | 346 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
347 | 347 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
348 | 348 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if ($show_color) { |
359 | 359 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
360 | 360 | } else { |
361 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
361 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
362 | 362 | } |
363 | 363 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
364 | 364 | |
@@ -367,44 +367,44 @@ discard block |
||
367 | 367 | |
368 | 368 | } |
369 | 369 | |
370 | - function gutenberg_active() { |
|
370 | + function gutenberg_active() { |
|
371 | 371 | |
372 | - // Gutenberg plugin is installed and activated. |
|
373 | - $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
374 | - |
|
375 | - // Block editor since 5.0. |
|
376 | - $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
377 | - |
|
378 | - if ( ! $gutenberg && ! $block_editor ) { |
|
379 | - return false; |
|
380 | - } |
|
381 | - |
|
382 | - if ( self::is_classic_editor_plugin_active() ) { |
|
383 | - $editor_option = get_option( 'classic-editor-replace' ); |
|
384 | - $block_editor_active = array( 'no-replace', 'block' ); |
|
385 | - |
|
386 | - return in_array( $editor_option, $block_editor_active, true ); |
|
387 | - } |
|
388 | - |
|
389 | - return true; |
|
390 | - } |
|
391 | - |
|
392 | - /** |
|
393 | - * Check if Classic Editor plugin is active. |
|
394 | - * |
|
395 | - * @return bool |
|
396 | - */ |
|
397 | - function is_classic_editor_plugin_active() { |
|
398 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
399 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
400 | - } |
|
401 | - |
|
402 | - if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
403 | - return true; |
|
404 | - } |
|
405 | - |
|
406 | - return false; |
|
407 | - } |
|
372 | + // Gutenberg plugin is installed and activated. |
|
373 | + $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
374 | + |
|
375 | + // Block editor since 5.0. |
|
376 | + $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
377 | + |
|
378 | + if ( ! $gutenberg && ! $block_editor ) { |
|
379 | + return false; |
|
380 | + } |
|
381 | + |
|
382 | + if ( self::is_classic_editor_plugin_active() ) { |
|
383 | + $editor_option = get_option( 'classic-editor-replace' ); |
|
384 | + $block_editor_active = array( 'no-replace', 'block' ); |
|
385 | + |
|
386 | + return in_array( $editor_option, $block_editor_active, true ); |
|
387 | + } |
|
388 | + |
|
389 | + return true; |
|
390 | + } |
|
391 | + |
|
392 | + /** |
|
393 | + * Check if Classic Editor plugin is active. |
|
394 | + * |
|
395 | + * @return bool |
|
396 | + */ |
|
397 | + function is_classic_editor_plugin_active() { |
|
398 | + if ( ! function_exists( 'is_plugin_active' ) ) { |
|
399 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
400 | + } |
|
401 | + |
|
402 | + if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
403 | + return true; |
|
404 | + } |
|
405 | + |
|
406 | + return false; |
|
407 | + } |
|
408 | 408 | |
409 | 409 | } |
410 | 410 |
@@ -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(); |