@@ -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' => $excerpt |
|
338 | + 'post_excerpt' => $excerpt |
|
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,63 +434,63 @@ 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 | - /*else if ($code == "aesop_content") { |
|
480 | + /*else if ($code == "aesop_content") { |
|
481 | 481 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php'); |
482 | 482 | echo aesop_content_shortcode($atts); |
483 | 483 | }*/ |
484 | - else if ($code == "aesop_wpimg") { |
|
485 | - self::wpimg($atts); |
|
484 | + else if ($code == "aesop_wpimg") { |
|
485 | + self::wpimg($atts); |
|
486 | 486 | } |
487 | 487 | else if ($code == "aesop_wpimg-block") { |
488 | - self::wpimg_block($atts); |
|
488 | + self::wpimg_block($atts); |
|
489 | 489 | } |
490 | 490 | else { |
491 | 491 | $code = '['.$code.' '; |
492 | 492 | foreach ($atts as $key => $value) { |
493 | - $code = ''.$key.'="'.$value.'" '; |
|
493 | + $code = ''.$key.'="'.$value.'" '; |
|
494 | 494 | } |
495 | 495 | $code = $code.']'; |
496 | 496 | echo do_shortcode($code); |
@@ -499,95 +499,95 @@ discard block |
||
499 | 499 | exit; |
500 | 500 | } |
501 | 501 | |
502 | - public static function wpimg($atts) { |
|
502 | + public static function wpimg($atts) { |
|
503 | 503 | |
504 | - echo '<figure data-component-type="wpimg"'; |
|
504 | + echo '<figure data-component-type="wpimg"'; |
|
505 | 505 | |
506 | - $extra = ""; |
|
506 | + $extra = ""; |
|
507 | 507 | |
508 | - // try to use srcset and sizes on new WP installs |
|
508 | + // try to use srcset and sizes on new WP installs |
|
509 | 509 | if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
510 | 510 | $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
511 | 511 | $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
512 | - $extra = "srcset='$srcset' sizes='$sizes' "; |
|
513 | - } |
|
514 | - if ($atts['align']=="left") { |
|
515 | - $extra .= 'class="alignleft'; |
|
516 | - } else if ($atts['align']=="right") { |
|
517 | - $extra .= 'class="alignright'; |
|
518 | - } else { |
|
519 | - $extra .= 'class="aligncenter'; |
|
520 | - } |
|
521 | - if ($atts['imgwidth'] || $atts['imgheight']) { |
|
522 | - if ($atts['imgwidth']) { |
|
523 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
524 | - } |
|
525 | - if ($atts['imgheight']) { |
|
526 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
527 | - } |
|
512 | + $extra = "srcset='$srcset' sizes='$sizes' "; |
|
513 | + } |
|
514 | + if ($atts['align']=="left") { |
|
515 | + $extra .= 'class="alignleft'; |
|
516 | + } else if ($atts['align']=="right") { |
|
517 | + $extra .= 'class="alignright'; |
|
518 | + } else { |
|
519 | + $extra .= 'class="aligncenter'; |
|
520 | + } |
|
521 | + if ($atts['imgwidth'] || $atts['imgheight']) { |
|
522 | + if ($atts['imgwidth']) { |
|
523 | + $extra .= 'width:'. $atts['imgwidth'].';'; |
|
524 | + } |
|
525 | + if ($atts['imgheight']) { |
|
526 | + $extra .= 'height:'. $atts['imgheight'].';'; |
|
527 | + } |
|
528 | 528 | |
529 | - } |
|
530 | - $extra .= '"'; |
|
529 | + } |
|
530 | + $extra .= '"'; |
|
531 | 531 | |
532 | - foreach ($atts as $key => $value) { |
|
532 | + foreach ($atts as $key => $value) { |
|
533 | 533 | echo ' data-'.$key.'="'.$value.'"'; |
534 | 534 | } |
535 | - //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
536 | - echo ' class="wp-caption lasso-component">'; |
|
537 | - $hrefset = false; |
|
538 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
539 | - { |
|
540 | - echo '<a href="' . $atts['link'] . '">'; |
|
541 | - $hrefset = true; |
|
542 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
543 | - echo '<a href="' . $atts['img'] . '">'; |
|
544 | - $hrefset = true; |
|
545 | - } |
|
546 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
547 | - if ($hrefset) |
|
548 | - { |
|
549 | - echo '</a>'; |
|
550 | - } |
|
551 | - if ($atts['caption']) |
|
552 | - { |
|
553 | - echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
554 | - } |
|
555 | - echo '</figure>'; |
|
556 | - echo '<p><br></p>'; |
|
557 | - return; |
|
558 | - } |
|
535 | + //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
536 | + echo ' class="wp-caption lasso-component">'; |
|
537 | + $hrefset = false; |
|
538 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
539 | + { |
|
540 | + echo '<a href="' . $atts['link'] . '">'; |
|
541 | + $hrefset = true; |
|
542 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
543 | + echo '<a href="' . $atts['img'] . '">'; |
|
544 | + $hrefset = true; |
|
545 | + } |
|
546 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
547 | + if ($hrefset) |
|
548 | + { |
|
549 | + echo '</a>'; |
|
550 | + } |
|
551 | + if ($atts['caption']) |
|
552 | + { |
|
553 | + echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
554 | + } |
|
555 | + echo '</figure>'; |
|
556 | + echo '<p><br></p>'; |
|
557 | + return; |
|
558 | + } |
|
559 | 559 | |
560 | 560 | public static function wpimg_block($atts) { |
561 | 561 | $imgextra = ''; |
562 | 562 | if (!empty($atts['id'])) { |
563 | 563 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
564 | 564 | } |
565 | - $figclass = 'aligncenter'; |
|
566 | - if ($atts['align']=="left") { |
|
567 | - $figclass = 'alignleft'; |
|
568 | - } else if ($atts['align']=="right") { |
|
569 | - $figclass = 'alignright'; |
|
570 | - } else { |
|
571 | - $figclass = 'aligncenter'; |
|
572 | - } |
|
565 | + $figclass = 'aligncenter'; |
|
566 | + if ($atts['align']=="left") { |
|
567 | + $figclass = 'alignleft'; |
|
568 | + } else if ($atts['align']=="right") { |
|
569 | + $figclass = 'alignright'; |
|
570 | + } else { |
|
571 | + $figclass = 'aligncenter'; |
|
572 | + } |
|
573 | 573 | |
574 | - echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
575 | - echo '<figure class="'.$figclass.' size-large">'; |
|
576 | - if (!empty($atts['link'])) { |
|
577 | - echo '<a href="'.$atts['link'].'">'; |
|
578 | - } |
|
579 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
580 | - if ($atts['caption']) |
|
581 | - { |
|
582 | - echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
583 | - } |
|
584 | - if (!empty($atts['link'])) { |
|
585 | - echo '</a>'; |
|
586 | - } |
|
587 | - echo '</figure></div>'; |
|
588 | - echo '<p><br></p>'; |
|
589 | - return; |
|
590 | - } |
|
574 | + echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
575 | + echo '<figure class="'.$figclass.' size-large">'; |
|
576 | + if (!empty($atts['link'])) { |
|
577 | + echo '<a href="'.$atts['link'].'">'; |
|
578 | + } |
|
579 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
580 | + if ($atts['caption']) |
|
581 | + { |
|
582 | + echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
583 | + } |
|
584 | + if (!empty($atts['link'])) { |
|
585 | + echo '</a>'; |
|
586 | + } |
|
587 | + echo '</figure></div>'; |
|
588 | + echo '<p><br></p>'; |
|
589 | + return; |
|
590 | + } |
|
591 | 591 | |
592 | 592 | |
593 | 593 | public function get_ase_options() |
@@ -623,12 +623,12 @@ discard block |
||
623 | 623 | exit; |
624 | 624 | } |
625 | 625 | |
626 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
627 | - public function on_publish_post( ) { |
|
626 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
627 | + public function on_publish_post( ) { |
|
628 | 628 | |
629 | 629 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
630 | 630 | |
631 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
631 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
632 | 632 | |
633 | 633 | exit; |
634 | 634 | } |
@@ -686,14 +686,14 @@ discard block |
||
686 | 686 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
687 | 687 | |
688 | 688 | if ($taxonomy =='category') { |
689 | - // convert from names to category ids |
|
689 | + // convert from names to category ids |
|
690 | 690 | $cats = array(); |
691 | 691 | foreach ($value as $cat) { |
692 | 692 | $cat_id = get_cat_ID($cat); |
693 | 693 | if ($cat_id !=0) { |
694 | 694 | $cats [] = $cat_id; |
695 | 695 | } else if ($allow_new_category) { |
696 | - $cats [] = wp_create_category($cat); |
|
696 | + $cats [] = wp_create_category($cat); |
|
697 | 697 | } |
698 | 698 | } |
699 | 699 | $value = $cats; |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | } |
714 | 714 | } |
715 | 715 | |
716 | - public function create_gallery( ) { |
|
716 | + public function create_gallery( ) { |
|
717 | 717 | |
718 | 718 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
719 | 719 | |
@@ -767,10 +767,10 @@ discard block |
||
767 | 767 | 'message' => 'gallery-created', |
768 | 768 | 'id' => $postid) |
769 | 769 | ); |
770 | - exit; |
|
770 | + exit; |
|
771 | 771 | } |
772 | 772 | |
773 | - public function update_gallery( ) { |
|
773 | + public function update_gallery( ) { |
|
774 | 774 | |
775 | 775 | $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
776 | 776 | |
@@ -786,12 +786,12 @@ discard block |
||
786 | 786 | |
787 | 787 | self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
788 | 788 | |
789 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
789 | + echo json_encode( array('message' => 'gallery-updated') ); |
|
790 | 790 | |
791 | - exit; |
|
791 | + exit; |
|
792 | 792 | } |
793 | 793 | |
794 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
794 | + public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
795 | 795 | |
796 | 796 | // gallery width |
797 | 797 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | public function set_date( $postid, $value) { |
876 | 876 | if( $value ) { |
877 | 877 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
878 | - wp_update_post( |
|
878 | + wp_update_post( |
|
879 | 879 | array ( |
880 | 880 | 'ID' => $postid, // ID of the post to update |
881 | 881 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -52,35 +52,35 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
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' ) ); |
|
63 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
64 | - add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
|
65 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
66 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
67 | - add_action( 'wp_ajax_editus_get_ase_options', array( $this, 'get_ase_options' ) ); |
|
68 | - add_action( 'wp_ajax_editus_delete_post', array( $this, 'delete_post' ) ); |
|
69 | - add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
|
70 | - add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
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')); |
|
63 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
64 | + add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post')); |
|
65 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
66 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
67 | + add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options')); |
|
68 | + add_action('wp_ajax_editus_delete_post', array($this, 'delete_post')); |
|
69 | + add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img')); |
|
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')); |
|
82 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
83 | - foreach ( $allowed_post_types as $post_type ) { |
|
81 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
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 | 84 | self::enable_metasave($post_type); |
85 | 85 | } |
86 | 86 | //enqueue assets |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public static function get_instance() { |
110 | 110 | |
111 | 111 | // If the single instance hasn't been set, set it now. |
112 | - if ( null == self::$instance ) { |
|
112 | + if (null == self::$instance) { |
|
113 | 113 | self::$instance = new self; |
114 | 114 | } |
115 | 115 | |
@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | * WPMU is disabled or plugin is |
127 | 127 | * activated on an individual blog. |
128 | 128 | */ |
129 | - public static function activate( $network_wide ) { |
|
129 | + public static function activate($network_wide) { |
|
130 | 130 | |
131 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
131 | + if (function_exists('is_multisite') && is_multisite()) { |
|
132 | 132 | |
133 | - if ( $network_wide ) { |
|
133 | + if ($network_wide) { |
|
134 | 134 | |
135 | 135 | // Get all blog ids |
136 | 136 | $blog_ids = self::get_blog_ids(); |
137 | 137 | |
138 | - foreach ( $blog_ids as $blog_id ) { |
|
138 | + foreach ($blog_ids as $blog_id) { |
|
139 | 139 | |
140 | - switch_to_blog( $blog_id ); |
|
140 | + switch_to_blog($blog_id); |
|
141 | 141 | self::single_activate(); |
142 | 142 | } |
143 | 143 | |
@@ -163,18 +163,18 @@ discard block |
||
163 | 163 | * WPMU is disabled or plugin is |
164 | 164 | * deactivated on an individual blog. |
165 | 165 | */ |
166 | - public static function deactivate( $network_wide ) { |
|
166 | + public static function deactivate($network_wide) { |
|
167 | 167 | |
168 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
168 | + if (function_exists('is_multisite') && is_multisite()) { |
|
169 | 169 | |
170 | - if ( $network_wide ) { |
|
170 | + if ($network_wide) { |
|
171 | 171 | |
172 | 172 | // Get all blog ids |
173 | 173 | $blog_ids = self::get_blog_ids(); |
174 | 174 | |
175 | - foreach ( $blog_ids as $blog_id ) { |
|
175 | + foreach ($blog_ids as $blog_id) { |
|
176 | 176 | |
177 | - switch_to_blog( $blog_id ); |
|
177 | + switch_to_blog($blog_id); |
|
178 | 178 | self::single_deactivate(); |
179 | 179 | |
180 | 180 | } |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | * |
199 | 199 | * @param int $blog_id ID of the new blog. |
200 | 200 | */ |
201 | - public function activate_new_site( $blog_id ) { |
|
201 | + public function activate_new_site($blog_id) { |
|
202 | 202 | |
203 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
203 | + if (1 !== did_action('wpmu_new_blog')) { |
|
204 | 204 | return; |
205 | 205 | } |
206 | 206 | |
207 | - switch_to_blog( $blog_id ); |
|
207 | + switch_to_blog($blog_id); |
|
208 | 208 | self::single_activate(); |
209 | 209 | restore_current_blog(); |
210 | 210 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | WHERE archived = '0' AND spam = '0' |
230 | 230 | AND deleted = '0'"; |
231 | 231 | |
232 | - return $wpdb->get_col( $sql ); |
|
232 | + return $wpdb->get_col($sql); |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | |
@@ -240,18 +240,18 @@ discard block |
||
240 | 240 | */ |
241 | 241 | private static function single_activate() { |
242 | 242 | |
243 | - $curr_version = get_option( 'lasso_version' ); |
|
243 | + $curr_version = get_option('lasso_version'); |
|
244 | 244 | |
245 | 245 | // update upgraded from |
246 | - if ( $curr_version ) { |
|
247 | - update_option( 'lasso_updated_from', $curr_version ); |
|
246 | + if ($curr_version) { |
|
247 | + update_option('lasso_updated_from', $curr_version); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | // update lasso version option |
251 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
251 | + update_option('lasso_version', LASSO_VERSION); |
|
252 | 252 | |
253 | 253 | // set transietn for activation welcome |
254 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
254 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
255 | 255 | |
256 | 256 | |
257 | 257 | } |
@@ -273,15 +273,15 @@ discard block |
||
273 | 273 | public function load_plugin_textdomain() { |
274 | 274 | |
275 | 275 | $domain = $this->plugin_slug; |
276 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
276 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
277 | 277 | |
278 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
278 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | // new ajax function to lock post for editing |
282 | 282 | public function editus_lock_post() |
283 | 283 | { |
284 | - $post_id= $_POST["postid"]; |
|
284 | + $post_id = $_POST["postid"]; |
|
285 | 285 | $locked = wp_check_post_lock($post_id); |
286 | 286 | |
287 | 287 | if (!$locked) { |
@@ -289,17 +289,17 @@ discard block |
||
289 | 289 | echo "true"; |
290 | 290 | } else { |
291 | 291 | $user_info = get_userdata($locked); |
292 | - echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name . " " . $user_info->last_name; |
|
292 | + echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name; |
|
293 | 293 | } |
294 | 294 | exit; |
295 | 295 | } |
296 | 296 | |
297 | 297 | public function editus_unlock_post() |
298 | 298 | { |
299 | - $post_id= $_POST["postid"]; |
|
299 | + $post_id = $_POST["postid"]; |
|
300 | 300 | $locked = wp_check_post_lock($post_id); |
301 | 301 | if (!$locked) { |
302 | - delete_post_meta( $post_id, '_edit_lock'); |
|
302 | + delete_post_meta($post_id, '_edit_lock'); |
|
303 | 303 | } |
304 | 304 | echo "true"; |
305 | 305 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | { |
312 | 312 | $user_id = get_current_user_ID(); |
313 | 313 | |
314 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
314 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
315 | 315 | exit; |
316 | 316 | } |
317 | 317 | |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | $data = array(); |
321 | 321 | parse_str($_POST['data'], $data); |
322 | 322 | |
323 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
323 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
324 | 324 | wp_send_json_error(); |
325 | 325 | exit; |
326 | 326 | } |
327 | 327 | |
328 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
329 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
330 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
331 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
328 | + $status = isset($data['status']) ? $data['status'] : false; |
|
329 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
330 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
331 | + $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false; |
|
332 | 332 | |
333 | 333 | |
334 | 334 | $args = array( |
@@ -340,31 +340,31 @@ discard block |
||
340 | 340 | |
341 | 341 | |
342 | 342 | |
343 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
343 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
344 | 344 | |
345 | 345 | // update categories |
346 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
346 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
347 | 347 | |
348 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
348 | + self::set_post_terms($postid, $cats, 'category'); |
|
349 | 349 | |
350 | 350 | // update tags |
351 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
352 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
351 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
352 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
353 | 353 | |
354 | 354 | // update custom taxonomy |
355 | - $custom_taxonomies = isset( $data['story_custom_taxonomies'] ) ? json_decode($data['story_custom_taxonomies']) : false; |
|
355 | + $custom_taxonomies = isset($data['story_custom_taxonomies']) ? json_decode($data['story_custom_taxonomies']) : false; |
|
356 | 356 | |
357 | 357 | foreach ($custom_taxonomies as $x => $x_value) { |
358 | - self::set_post_terms( $postid, $x_value, $x ); |
|
358 | + self::set_post_terms($postid, $x_value, $x); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | //update date |
362 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
363 | - self::set_date( $postid, $date ); |
|
362 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
363 | + self::set_date($postid, $date); |
|
364 | 364 | |
365 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
366 | - $response= array( |
|
367 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
365 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
366 | + $response = array( |
|
367 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
368 | 368 | ); |
369 | 369 | wp_send_json_success($response); |
370 | 370 | exit; |
@@ -372,11 +372,11 @@ discard block |
||
372 | 372 | |
373 | 373 | public static function enable_metasave($type) |
374 | 374 | { |
375 | - register_rest_field( $type, 'metadata', array( |
|
376 | - 'get_callback' => function ( $data ) { |
|
377 | - return get_post_meta( $data['id']);//, '', '' ); |
|
375 | + register_rest_field($type, 'metadata', array( |
|
376 | + 'get_callback' => function($data) { |
|
377 | + return get_post_meta($data['id']); //, '', '' ); |
|
378 | 378 | }, |
379 | - 'update_callback' => function( $data, $post ) { |
|
379 | + 'update_callback' => function($data, $post) { |
|
380 | 380 | foreach ($data as $key => $value) { |
381 | 381 | update_post_meta($post->ID, $key, $value); |
382 | 382 | } |
@@ -388,13 +388,13 @@ discard block |
||
388 | 388 | public function editus_do_shortcode() |
389 | 389 | { |
390 | 390 | |
391 | - $code= $_POST["code"]; |
|
391 | + $code = $_POST["code"]; |
|
392 | 392 | $code = str_replace('\"', '"', $code); |
393 | 393 | |
394 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
395 | - $out = do_shortcode($code); |
|
394 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
395 | + $out = do_shortcode($code); |
|
396 | 396 | if ($out != '') { |
397 | - $out = do_shortcode($code_wrapped); |
|
397 | + $out = do_shortcode($code_wrapped); |
|
398 | 398 | echo $out; |
399 | 399 | exit; |
400 | 400 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | /** @var \WP_Embed $wp_embed */ |
405 | 405 | global $wp_embed; |
406 | 406 | $wp_embed->post_ID = $_POST["ID"]; |
407 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
407 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
408 | 408 | |
409 | 409 | echo $out; |
410 | 410 | exit; |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | public function editus_do_block() |
414 | 414 | { |
415 | 415 | |
416 | - $code= $_POST["code"]; |
|
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; |
@@ -425,56 +425,56 @@ discard block |
||
425 | 425 | { |
426 | 426 | |
427 | 427 | |
428 | - $code= $_POST["code"]; |
|
428 | + $code = $_POST["code"]; |
|
429 | 429 | $atts = array( |
430 | 430 | ); |
431 | 431 | foreach ($_POST as $key => $value) { |
432 | - if ($key !="code" && $key !="action") { |
|
432 | + if ($key != "code" && $key != "action") { |
|
433 | 433 | $atts[$key] = $value; |
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'); |
|
437 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
438 | 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'); |
|
441 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
442 | 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'); |
|
445 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
446 | 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'); |
|
449 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
450 | 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'); |
|
453 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
454 | 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'); |
|
457 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
458 | 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'); |
|
461 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
462 | 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'); |
|
465 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
466 | 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'); |
|
473 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
474 | 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'); |
|
477 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
478 | 478 | echo aesop_document_shortcode($atts); |
479 | 479 | } |
480 | 480 | /*else if ($code == "aesop_content") { |
@@ -506,24 +506,24 @@ discard block |
||
506 | 506 | $extra = ""; |
507 | 507 | |
508 | 508 | // try to use srcset and sizes on new WP installs |
509 | - if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
|
510 | - $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
|
511 | - $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
|
509 | + if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) { |
|
510 | + $srcset = wp_get_attachment_image_srcset($attachment_id, 'full'); |
|
511 | + $sizes = wp_get_attachment_image_sizes($attachment_id, 'full'); |
|
512 | 512 | $extra = "srcset='$srcset' sizes='$sizes' "; |
513 | 513 | } |
514 | - if ($atts['align']=="left") { |
|
514 | + if ($atts['align'] == "left") { |
|
515 | 515 | $extra .= 'class="alignleft'; |
516 | - } else if ($atts['align']=="right") { |
|
516 | + } else if ($atts['align'] == "right") { |
|
517 | 517 | $extra .= 'class="alignright'; |
518 | 518 | } else { |
519 | 519 | $extra .= 'class="aligncenter'; |
520 | 520 | } |
521 | 521 | if ($atts['imgwidth'] || $atts['imgheight']) { |
522 | 522 | if ($atts['imgwidth']) { |
523 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
523 | + $extra .= 'width:'.$atts['imgwidth'].';'; |
|
524 | 524 | } |
525 | 525 | if ($atts['imgheight']) { |
526 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
526 | + $extra .= 'height:'.$atts['imgheight'].';'; |
|
527 | 527 | } |
528 | 528 | |
529 | 529 | } |
@@ -535,15 +535,15 @@ discard block |
||
535 | 535 | //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
536 | 536 | echo ' class="wp-caption lasso-component">'; |
537 | 537 | $hrefset = false; |
538 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
538 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url")) |
|
539 | 539 | { |
540 | - echo '<a href="' . $atts['link'] . '">'; |
|
540 | + echo '<a href="'.$atts['link'].'">'; |
|
541 | 541 | $hrefset = true; |
542 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
543 | - echo '<a href="' . $atts['img'] . '">'; |
|
542 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') { |
|
543 | + echo '<a href="'.$atts['img'].'">'; |
|
544 | 544 | $hrefset = true; |
545 | 545 | } |
546 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
546 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>'; |
|
547 | 547 | if ($hrefset) |
548 | 548 | { |
549 | 549 | echo '</a>'; |
@@ -563,9 +563,9 @@ discard block |
||
563 | 563 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
564 | 564 | } |
565 | 565 | $figclass = 'aligncenter'; |
566 | - if ($atts['align']=="left") { |
|
566 | + if ($atts['align'] == "left") { |
|
567 | 567 | $figclass = 'alignleft'; |
568 | - } else if ($atts['align']=="right") { |
|
568 | + } else if ($atts['align'] == "right") { |
|
569 | 569 | $figclass = 'alignright'; |
570 | 570 | } else { |
571 | 571 | $figclass = 'aligncenter'; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | if (!empty($atts['link'])) { |
577 | 577 | echo '<a href="'.$atts['link'].'">'; |
578 | 578 | } |
579 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
579 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' >'; |
|
580 | 580 | if ($atts['caption']) |
581 | 581 | { |
582 | 582 | echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
@@ -593,20 +593,20 @@ discard block |
||
593 | 593 | public function get_ase_options() |
594 | 594 | { |
595 | 595 | $blob = lasso_editor_options_blob(); |
596 | - $code= $_POST["component"]; |
|
596 | + $code = $_POST["component"]; |
|
597 | 597 | echo $blob[$code]; |
598 | 598 | exit; |
599 | 599 | } |
600 | 600 | |
601 | 601 | public function delete_post( ) { |
602 | 602 | |
603 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
603 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
604 | 604 | |
605 | 605 | // bail out if the current user can't publish posts |
606 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
606 | + if (!lasso_user_can('delete_post', $postid)) |
|
607 | 607 | return; |
608 | 608 | |
609 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
|
609 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) { |
|
610 | 610 | wp_send_json_error(); |
611 | 611 | exit; |
612 | 612 | } |
@@ -616,9 +616,9 @@ discard block |
||
616 | 616 | 'post_status' => 'trash' |
617 | 617 | ); |
618 | 618 | |
619 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
619 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
620 | 620 | |
621 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
621 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
622 | 622 | |
623 | 623 | exit; |
624 | 624 | } |
@@ -626,40 +626,40 @@ discard block |
||
626 | 626 | /* This function doesn't actually publish post, but should be called when a post is published */ |
627 | 627 | public function on_publish_post( ) { |
628 | 628 | |
629 | - $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
629 | + $post_id = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
630 | 630 | |
631 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
631 | + do_action('transition_post_status', 'publish', 'draft', get_post($post_id)); |
|
632 | 632 | |
633 | 633 | exit; |
634 | 634 | } |
635 | 635 | |
636 | 636 | public function set_featured_img( ) { |
637 | 637 | |
638 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
639 | - $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false; |
|
640 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
638 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
639 | + $image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false; |
|
640 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
641 | 641 | wp_send_json_error(); |
642 | 642 | exit; |
643 | 643 | } |
644 | 644 | |
645 | - set_post_thumbnail( $postid, $image_id ); |
|
645 | + set_post_thumbnail($postid, $image_id); |
|
646 | 646 | |
647 | - do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() ); |
|
647 | + do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID()); |
|
648 | 648 | |
649 | 649 | exit; |
650 | 650 | } |
651 | 651 | |
652 | 652 | public function del_featured_img( ) { |
653 | 653 | |
654 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
655 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
654 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
655 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
656 | 656 | wp_send_json_error(); |
657 | 657 | exit; |
658 | 658 | } |
659 | 659 | |
660 | - delete_post_thumbnail( $postid ); |
|
660 | + delete_post_thumbnail($postid); |
|
661 | 661 | |
662 | - do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() ); |
|
662 | + do_action('lasso_featured_image_deleted', $postid, get_current_user_ID()); |
|
663 | 663 | |
664 | 664 | exit; |
665 | 665 | } |
@@ -680,17 +680,17 @@ discard block |
||
680 | 680 | return self::$revisions; |
681 | 681 | }*/ |
682 | 682 | |
683 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
684 | - if( $value ) { |
|
685 | - $value = explode( ',', $value ); |
|
686 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
683 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
684 | + if ($value) { |
|
685 | + $value = explode(',', $value); |
|
686 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
687 | 687 | |
688 | - if ($taxonomy =='category') { |
|
688 | + if ($taxonomy == 'category') { |
|
689 | 689 | // convert from names to category ids |
690 | 690 | $cats = array(); |
691 | 691 | foreach ($value as $cat) { |
692 | 692 | $cat_id = get_cat_ID($cat); |
693 | - if ($cat_id !=0) { |
|
693 | + if ($cat_id != 0) { |
|
694 | 694 | $cats [] = $cat_id; |
695 | 695 | } else if ($allow_new_category) { |
696 | 696 | $cats [] = wp_create_category($cat); |
@@ -699,71 +699,71 @@ discard block |
||
699 | 699 | $value = $cats; |
700 | 700 | } |
701 | 701 | |
702 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
702 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
703 | 703 | } |
704 | - else { |
|
704 | + else { |
|
705 | 705 | //remove all terms from post |
706 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
706 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
707 | 707 | } |
708 | 708 | |
709 | - if ( ! is_wp_error( $result ) ) { |
|
709 | + if (!is_wp_error($result)) { |
|
710 | 710 | return true; |
711 | - }else{ |
|
711 | + } else { |
|
712 | 712 | return false; |
713 | 713 | } |
714 | 714 | } |
715 | 715 | |
716 | 716 | public function create_gallery( ) { |
717 | 717 | |
718 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
718 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
719 | 719 | |
720 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
720 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
721 | 721 | wp_send_json_error(); |
722 | 722 | exit; |
723 | 723 | } |
724 | 724 | |
725 | - if ( ! lasso_user_can( 'publish_posts' ) ) { |
|
725 | + if (!lasso_user_can('publish_posts')) { |
|
726 | 726 | return false; |
727 | 727 | |
728 | 728 | } |
729 | 729 | |
730 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
730 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
731 | 731 | |
732 | 732 | // bail if no gallery ids |
733 | - if ( empty( $gallery_ids ) ) { |
|
733 | + if (empty($gallery_ids)) { |
|
734 | 734 | return false; |
735 | 735 | } |
736 | 736 | |
737 | - $type = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false; |
|
738 | - $edgallerytitle = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
737 | + $type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false; |
|
738 | + $edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
739 | 739 | |
740 | 740 | // insert a new gallery |
741 | 741 | $args = array( |
742 | - 'post_title' => $edgallerytitle , |
|
742 | + 'post_title' => $edgallerytitle, |
|
743 | 743 | 'post_status' => 'publish', |
744 | 744 | 'post_type' => 'ai_galleries' |
745 | 745 | ); |
746 | 746 | |
747 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) ); |
|
747 | + $postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args)); |
|
748 | 748 | |
749 | 749 | // update gallery ids |
750 | - if ( $gallery_ids ) { |
|
750 | + if ($gallery_ids) { |
|
751 | 751 | |
752 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
752 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
753 | 753 | |
754 | 754 | } |
755 | 755 | |
756 | 756 | // update the gallery type |
757 | - if ( !empty( $type ) ) { |
|
757 | + if (!empty($type)) { |
|
758 | 758 | |
759 | - update_post_meta( $postid, 'aesop_gallery_type', $type ); |
|
759 | + update_post_meta($postid, 'aesop_gallery_type', $type); |
|
760 | 760 | |
761 | 761 | } |
762 | 762 | |
763 | - do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() ); |
|
763 | + do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID()); |
|
764 | 764 | |
765 | 765 | |
766 | - echo json_encode( array( |
|
766 | + echo json_encode(array( |
|
767 | 767 | 'message' => 'gallery-created', |
768 | 768 | 'id' => $postid) |
769 | 769 | ); |
@@ -772,114 +772,114 @@ discard block |
||
772 | 772 | |
773 | 773 | public function update_gallery( ) { |
774 | 774 | |
775 | - $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
|
775 | + $options = isset($_POST['fields']) ? $_POST['fields'] : false; |
|
776 | 776 | |
777 | - $postid = !empty( $options ) ? (int) $options['id'] : false; |
|
778 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
779 | - if ( $_POST[ 'gallery_type' ] ) { |
|
780 | - $type = $_POST[ 'gallery_type' ]; |
|
781 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
782 | - $type = $options[ 'galleryType' ]; |
|
783 | - }else{ |
|
777 | + $postid = !empty($options) ? (int) $options['id'] : false; |
|
778 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
779 | + if ($_POST['gallery_type']) { |
|
780 | + $type = $_POST['gallery_type']; |
|
781 | + }elseif (!empty($options) && $options['galleryType']) { |
|
782 | + $type = $options['galleryType']; |
|
783 | + } else { |
|
784 | 784 | $type = false; |
785 | 785 | } |
786 | 786 | |
787 | - self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
|
787 | + self::save_gallery_options($postid, $gallery_ids, $options, $type); |
|
788 | 788 | |
789 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
789 | + echo json_encode(array('message' => 'gallery-updated')); |
|
790 | 790 | |
791 | 791 | exit; |
792 | 792 | } |
793 | 793 | |
794 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
794 | + public function save_gallery_options($postid, $gallery_ids, $options, $type = false) { |
|
795 | 795 | |
796 | 796 | // gallery width |
797 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
797 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
798 | 798 | |
799 | 799 | // gallery grid item width |
800 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
800 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
801 | 801 | |
802 | 802 | // caption |
803 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
803 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
804 | 804 | |
805 | 805 | // gallery transition |
806 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
806 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
807 | 807 | |
808 | 808 | // gallery transition speed |
809 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
809 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
810 | 810 | |
811 | 811 | // gallery hide thumbs |
812 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
812 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
813 | 813 | |
814 | 814 | // photoset layout hardwired to on for now |
815 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
815 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
816 | 816 | |
817 | 817 | // photoset layout |
818 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
818 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
819 | 819 | |
820 | 820 | // hero gallery height |
821 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
821 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
822 | 822 | |
823 | 823 | // update gallery ids |
824 | - if ( !empty( $gallery_ids ) ) { |
|
824 | + if (!empty($gallery_ids)) { |
|
825 | 825 | |
826 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
826 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
827 | 827 | |
828 | 828 | } |
829 | 829 | |
830 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
830 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
831 | 831 | |
832 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
832 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
833 | 833 | |
834 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
834 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
835 | 835 | |
836 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
836 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
837 | 837 | |
838 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
838 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
839 | 839 | |
840 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
840 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
841 | 841 | |
842 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
842 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
843 | 843 | |
844 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
844 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
845 | 845 | |
846 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
846 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
847 | 847 | |
848 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
848 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
849 | 849 | |
850 | 850 | //hardwired for now |
851 | 851 | |
852 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
852 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
853 | 853 | |
854 | 854 | } |
855 | 855 | |
856 | - function getEnglishMonthName($foreignMonthName){ |
|
856 | + function getEnglishMonthName($foreignMonthName) { |
|
857 | 857 | |
858 | 858 | setlocale(LC_ALL, 'en_US'); |
859 | 859 | |
860 | - $month_numbers = range(1,12); |
|
860 | + $month_numbers = range(1, 12); |
|
861 | 861 | |
862 | - foreach($month_numbers as $month) |
|
863 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
862 | + foreach ($month_numbers as $month) |
|
863 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
864 | 864 | |
865 | 865 | setlocale(LC_ALL, get_locale()); |
866 | 866 | |
867 | - foreach($month_numbers as $month) |
|
868 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
867 | + foreach ($month_numbers as $month) |
|
868 | + $foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011))); |
|
869 | 869 | |
870 | 870 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
871 | 871 | } |
872 | 872 | |
873 | 873 | |
874 | 874 | |
875 | - public function set_date( $postid, $value) { |
|
876 | - if( $value ) { |
|
877 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
875 | + public function set_date($postid, $value) { |
|
876 | + if ($value) { |
|
877 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
878 | 878 | wp_update_post( |
879 | - array ( |
|
879 | + array( |
|
880 | 880 | 'ID' => $postid, // ID of the post to update |
881 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
882 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
881 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
882 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
883 | 883 | ) |
884 | 884 | ); |
885 | 885 | } |
@@ -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 | } |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - $options = apply_filters( 'editus_filter_options', $options ); |
|
30 | + $options = apply_filters('editus_filter_options', $options); |
|
31 | 31 | |
32 | - if ( isset( $options[$option] ) ) { |
|
32 | + if (isset($options[$option])) { |
|
33 | 33 | return $options[$option]; |
34 | 34 | } |
35 | 35 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function lasso_editor_galleries_exist() { |
46 | 46 | |
47 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
47 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
48 | 48 | |
49 | - if ( $q->have_posts() ) |
|
49 | + if ($q->have_posts()) |
|
50 | 50 | return true; |
51 | 51 | else |
52 | 52 | return false; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | function lasso_get_supported_theme_class() { |
62 | 62 | |
63 | 63 | $name = wp_get_theme()->get('Name'); |
64 | - $slug = lasso_clean_string( $name ); |
|
64 | + $slug = lasso_clean_string($name); |
|
65 | 65 | |
66 | - switch ( $slug ) { |
|
66 | + switch ($slug) { |
|
67 | 67 | case 'aesop-story-theme': // aesop |
68 | 68 | $out = '.aesop-entry-content'; |
69 | 69 | break; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | } |
114 | 114 | |
115 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
115 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
116 | 116 | //return !empty( $out ) ? $out : false; |
117 | 117 | } |
118 | 118 | |
119 | 119 | function lasso_get_supported_theme_title_class() { |
120 | 120 | |
121 | 121 | $name = wp_get_theme()->get('Name'); |
122 | - $slug = lasso_clean_string( $name ); |
|
122 | + $slug = lasso_clean_string($name); |
|
123 | 123 | |
124 | - switch ( $slug ) { |
|
124 | + switch ($slug) { |
|
125 | 125 | |
126 | 126 | case 'aesop-story-theme': // aesop |
127 | 127 | $out = '.aesop-entry-title'; |
@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | |
152 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
152 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | //since 0.9.9.6 |
156 | 156 | function lasso_get_supported_theme_featured_image_class() { |
157 | 157 | |
158 | 158 | $name = wp_get_theme()->get('Name'); |
159 | - $slug = lasso_clean_string( $name ); |
|
159 | + $slug = lasso_clean_string($name); |
|
160 | 160 | |
161 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
161 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @since 0.8.7 |
170 | 170 | * @return string of comma separated classes |
171 | 171 | */ |
172 | -function lasso_supported_no_save(){ |
|
172 | +function lasso_supported_no_save() { |
|
173 | 173 | |
174 | 174 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel'); |
175 | 175 | } |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return array|mixed|object|string|void |
185 | 185 | */ |
186 | -function lasso_sanitize_data( $data ) { |
|
187 | - return \lasso\sanatize::do_sanitize( $data ); |
|
186 | +function lasso_sanitize_data($data) { |
|
187 | + return \lasso\sanatize::do_sanitize($data); |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
@@ -194,24 +194,24 @@ discard block |
||
194 | 194 | * @since 0.9.3 |
195 | 195 | * @return string of comma delimited category slugs |
196 | 196 | */ |
197 | -function lasso_get_post_objects( $postid, $taxonomy) { |
|
197 | +function lasso_get_post_objects($postid, $taxonomy) { |
|
198 | 198 | |
199 | - if ( empty( $postid ) ) |
|
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 ); |
|
202 | + if ('category' == $taxonomy) { |
|
203 | + $objects = get_the_category($postid); |
|
204 | + } else if ('tag' == $taxonomy) { |
|
205 | + $objects = get_the_tags($postid); |
|
206 | 206 | } else { |
207 | - $objects = get_the_terms( $postid, $taxonomy ); |
|
207 | + $objects = get_the_terms($postid, $taxonomy); |
|
208 | 208 | } |
209 | 209 | |
210 | - if ( empty( $objects) ) |
|
210 | + if (empty($objects)) |
|
211 | 211 | return; |
212 | 212 | |
213 | 213 | $out = ''; |
214 | - foreach( $objects as $object ) { |
|
214 | + foreach ($objects as $object) { |
|
215 | 215 | $out .= $object->name.','; |
216 | 216 | } |
217 | 217 | |
@@ -225,24 +225,24 @@ discard block |
||
225 | 225 | * @since 0.9.3 |
226 | 226 | * @return array all categoiries |
227 | 227 | */ |
228 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
228 | +function lasso_get_objects($taxonomy = 'category') { |
|
229 | 229 | |
230 | - if ('category' == $taxonomy) { |
|
230 | + if ('category' == $taxonomy) { |
|
231 | 231 | $objects = get_categories(array('hide_empty' => 0)); |
232 | - } else if ('tag' == $taxonomy) { |
|
232 | + } else if ('tag' == $taxonomy) { |
|
233 | 233 | $objects = get_tags(array('hide_empty' => 0)); |
234 | 234 | } else { |
235 | - $objects = get_terms( array( |
|
235 | + $objects = get_terms(array( |
|
236 | 236 | 'taxonomy' => $taxonomy, |
237 | 237 | 'hide_empty' => false, |
238 | 238 | )); |
239 | 239 | } |
240 | 240 | |
241 | - if ( empty( $objects) ) |
|
241 | + if (empty($objects)) |
|
242 | 242 | return; |
243 | 243 | |
244 | 244 | $out = ""; |
245 | - foreach( $objects as $object ) { |
|
245 | + foreach ($objects as $object) { |
|
246 | 246 | $out .= $object->name.','; |
247 | 247 | } |
248 | 248 | |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | * @since 0.9.4 |
258 | 258 | */ |
259 | 259 | function lasso_post_types_names() { |
260 | - $post_types = get_post_types( array( |
|
260 | + $post_types = get_post_types(array( |
|
261 | 261 | 'public' => true, |
262 | - ), 'objects' ); |
|
263 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
264 | - unset( $post_types[ 'attachment' ] ); |
|
262 | + ), 'objects'); |
|
263 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
264 | + unset($post_types['attachment']); |
|
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Set which post types are allowed |
@@ -270,14 +270,14 @@ discard block |
||
270 | 270 | * |
271 | 271 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
272 | 272 | */ |
273 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
274 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
273 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
274 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
275 | 275 | if (!current_user_can('edit_pages')) { |
276 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
276 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
277 | 277 | } |
278 | - foreach( $post_types as $name => $label ) { |
|
279 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
280 | - unset( $post_types[ $name ] ); |
|
278 | + foreach ($post_types as $name => $label) { |
|
279 | + if (!in_array($name, $allowed_post_types)) { |
|
280 | + unset($post_types[$name]); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $post_types; |
@@ -285,10 +285,10 @@ discard block |
||
285 | 285 | |
286 | 286 | |
287 | 287 | function lasso_post_types() { |
288 | - $post_types = get_post_types( array( |
|
288 | + $post_types = get_post_types(array( |
|
289 | 289 | 'public' => true, |
290 | - ), 'names' ); |
|
291 | - unset( $post_types[ 'attachment' ] ); |
|
290 | + ), 'names'); |
|
291 | + unset($post_types['attachment']); |
|
292 | 292 | |
293 | 293 | /** |
294 | 294 | * Set which post types are allowed |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | * |
298 | 298 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
299 | 299 | */ |
300 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
301 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
302 | - foreach( $post_types as $name => $label ) { |
|
303 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
304 | - unset( $post_types[ $name ] ); |
|
300 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
301 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
302 | + foreach ($post_types as $name => $label) { |
|
303 | + if (!in_array($name, $allowed_post_types)) { |
|
304 | + unset($post_types[$name]); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | return $post_types; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | global $wp_post_types; |
312 | 312 | $post_types = lasso_post_types(); |
313 | 313 | $rest_base = array(); |
314 | - foreach ( $post_types as $post_type) { |
|
314 | + foreach ($post_types as $post_type) { |
|
315 | 315 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
316 | 316 | } |
317 | 317 | |
@@ -329,22 +329,22 @@ discard block |
||
329 | 329 | * @uses lasso_modal_addons() |
330 | 330 | * @since 0.9.4 |
331 | 331 | */ |
332 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
332 | +function lasso_modal_addons_content($tab = '', $type) { |
|
333 | 333 | |
334 | - $name = lasso_clean_string( $tab['name'] ); |
|
334 | + $name = lasso_clean_string($tab['name']); |
|
335 | 335 | |
336 | - if ( 'tab' == $type ) { |
|
336 | + if ('tab' == $type) { |
|
337 | 337 | |
338 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
338 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
339 | 339 | |
340 | - } else if ( 'content' == $type ){ |
|
340 | + } else if ('content' == $type) { |
|
341 | 341 | |
342 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
343 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
342 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
343 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
344 | 344 | |
345 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
345 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
346 | 346 | %s%s |
347 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
347 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
348 | 348 | |
349 | 349 | } |
350 | 350 | |
@@ -359,12 +359,12 @@ discard block |
||
359 | 359 | * |
360 | 360 | * @return void|string |
361 | 361 | */ |
362 | -function lasso_clean_string( $string = '' ) { |
|
362 | +function lasso_clean_string($string = '') { |
|
363 | 363 | |
364 | - if ( empty( $string ) ) |
|
364 | + if (empty($string)) |
|
365 | 365 | return; |
366 | 366 | |
367 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
367 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -377,13 +377,13 @@ discard block |
||
377 | 377 | * |
378 | 378 | * @return void|string |
379 | 379 | */ |
380 | -function lasso_unclean_string( $string = '' ) { |
|
380 | +function lasso_unclean_string($string = '') { |
|
381 | 381 | |
382 | - if ( empty( $string ) ) { |
|
382 | + if (empty($string)) { |
|
383 | 383 | return; |
384 | 384 | } |
385 | 385 | |
386 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
386 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | |
@@ -398,40 +398,40 @@ discard block |
||
398 | 398 | * @param unknown $postid int the id of the post object to check against |
399 | 399 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
400 | 400 | */ |
401 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
402 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
401 | +if (!function_exists('lasso_user_can')): |
|
402 | + function lasso_user_can($action = '', $postid = 0) { |
|
403 | 403 | $result = false; |
404 | - if ( empty( $action ) ) |
|
404 | + if (empty($action)) |
|
405 | 405 | $action = 'edit_posts'; |
406 | 406 | |
407 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
407 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
408 | 408 | $postid = get_the_ID(); |
409 | 409 | |
410 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
410 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
411 | 411 | // check against post types: |
412 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
412 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
413 | 413 | |
414 | 414 | if (!current_user_can('edit_pages')) { |
415 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
415 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if (!empty($allowed_post_types) && !empty($postid)) { |
419 | - $type = get_post_type( $postid ); |
|
420 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
419 | + $type = get_post_type($postid); |
|
420 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
421 | 421 | |
422 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
423 | - $result = true; |
|
422 | + if (in_array($type, $allowed_post_types)) { |
|
423 | + $result = true; |
|
424 | 424 | } |
425 | 425 | } else { |
426 | 426 | //we are not checking against a post, return true |
427 | - $result = true; |
|
427 | + $result = true; |
|
428 | 428 | } |
429 | 429 | } else { |
430 | 430 | $result = false; |
431 | 431 | } |
432 | 432 | //if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false; |
433 | 433 | |
434 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
434 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
435 | 435 | } |
436 | 436 | endif; |
437 | 437 | |
@@ -440,25 +440,25 @@ discard block |
||
440 | 440 | * |
441 | 441 | * @since 0.9.5 |
442 | 442 | */ |
443 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
443 | +if (!function_exists('lasso_editor_empty_results')): |
|
444 | 444 | |
445 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
445 | + function lasso_editor_empty_results($type = 'posts') { |
|
446 | 446 | |
447 | - if ( 'posts' == $type ) { |
|
447 | + if ('posts' == $type) { |
|
448 | 448 | |
449 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
449 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
450 | 450 | $icon = 'lasso-icon-file-text2'; |
451 | 451 | $button = false; |
452 | 452 | |
453 | - } elseif ( 'revision' == $type ) { |
|
453 | + } elseif ('revision' == $type) { |
|
454 | 454 | |
455 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
455 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
456 | 456 | $icon = 'lasso-icon-history'; |
457 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
457 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
458 | 458 | |
459 | 459 | } |
460 | 460 | |
461 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
461 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | endif; |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
19 | - return; |
|
18 | + if ( empty( $option ) ) { |
|
19 | + return; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
22 | 23 | |
@@ -46,11 +47,12 @@ discard block |
||
46 | 47 | |
47 | 48 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
48 | 49 | |
49 | - if ( $q->have_posts() ) |
|
50 | - return true; |
|
51 | - else |
|
52 | - return false; |
|
53 | -} |
|
50 | + if ( $q->have_posts() ) { |
|
51 | + return true; |
|
52 | + } else { |
|
53 | + return false; |
|
54 | + } |
|
55 | + } |
|
54 | 56 | |
55 | 57 | /** |
56 | 58 | * Return a CSS class of an automatically supported theme |
@@ -196,8 +198,9 @@ discard block |
||
196 | 198 | */ |
197 | 199 | function lasso_get_post_objects( $postid, $taxonomy) { |
198 | 200 | |
199 | - if ( empty( $postid ) ) |
|
200 | - $postid = get_the_ID(); |
|
201 | + if ( empty( $postid ) ) { |
|
202 | + $postid = get_the_ID(); |
|
203 | + } |
|
201 | 204 | |
202 | 205 | if ('category' == $taxonomy) { |
203 | 206 | $objects = get_the_category( $postid ); |
@@ -207,8 +210,9 @@ discard block |
||
207 | 210 | $objects = get_the_terms( $postid, $taxonomy ); |
208 | 211 | } |
209 | 212 | |
210 | - if ( empty( $objects) ) |
|
211 | - return; |
|
213 | + if ( empty( $objects) ) { |
|
214 | + return; |
|
215 | + } |
|
212 | 216 | |
213 | 217 | $out = ''; |
214 | 218 | foreach( $objects as $object ) { |
@@ -238,8 +242,9 @@ discard block |
||
238 | 242 | )); |
239 | 243 | } |
240 | 244 | |
241 | - if ( empty( $objects) ) |
|
242 | - return; |
|
245 | + if ( empty( $objects) ) { |
|
246 | + return; |
|
247 | + } |
|
243 | 248 | |
244 | 249 | $out = ""; |
245 | 250 | foreach( $objects as $object ) { |
@@ -361,8 +366,9 @@ discard block |
||
361 | 366 | */ |
362 | 367 | function lasso_clean_string( $string = '' ) { |
363 | 368 | |
364 | - if ( empty( $string ) ) |
|
365 | - return; |
|
369 | + if ( empty( $string ) ) { |
|
370 | + return; |
|
371 | + } |
|
366 | 372 | |
367 | 373 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
368 | 374 | } |
@@ -401,11 +407,13 @@ discard block |
||
401 | 407 | if ( !function_exists( 'lasso_user_can' ) ): |
402 | 408 | function lasso_user_can( $action = '', $postid = 0 ) { |
403 | 409 | $result = false; |
404 | - if ( empty( $action ) ) |
|
405 | - $action = 'edit_posts'; |
|
410 | + if ( empty( $action ) ) { |
|
411 | + $action = 'edit_posts'; |
|
412 | + } |
|
406 | 413 | |
407 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
408 | - $postid = get_the_ID(); |
|
414 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
415 | + $postid = get_the_ID(); |
|
416 | + } |
|
409 | 417 | |
410 | 418 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
411 | 419 | // check against post types: |
@@ -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 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
234 | 234 | |
235 | 235 | // mobile styles |
236 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
236 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
237 | 237 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
238 | 238 | |
239 | 239 | //show color |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
250 | 250 | |
251 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
251 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
252 | 252 | |
253 | 253 | ?> |
254 | 254 | <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | |
462 | 462 | //editor options |
463 | 463 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
464 | - $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
464 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
465 | 465 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
466 | 466 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
467 | 467 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | // do we support pending status |
483 | 483 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
484 | 484 | |
485 | - $excerpt = $post->post_excerpt; |
|
485 | + $excerpt = $post->post_excerpt; |
|
486 | 486 | |
487 | 487 | ?> |
488 | 488 | <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | }?> |
580 | 580 | <?php |
581 | 581 | if ($allow_change_date) { |
582 | - $dateformat = get_option( 'date_format' ); |
|
582 | + $dateformat = get_option( 'date_format' ); |
|
583 | 583 | ?> |
584 | 584 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
585 | 585 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -673,8 +673,8 @@ discard block |
||
673 | 673 | $types = lasso_post_types_names(); |
674 | 674 | if ( !empty( $types ) ) { |
675 | 675 | foreach( $types as $name => $label ) |
676 | - { |
|
677 | - $type = $name; |
|
676 | + { |
|
677 | + $type = $name; |
|
678 | 678 | //$type = preg_replace( '/s\b/','', $name ); |
679 | 679 | if ($type == 'page' && !current_user_can('edit_pages')) { |
680 | 680 | continue; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | if ( !empty( $types ) ) { |
697 | 697 | // get the first element |
698 | 698 | $keys = array_keys($types); |
699 | - $type =$keys[0]; |
|
699 | + $type =$keys[0]; |
|
700 | 700 | $type = preg_replace( '/s\b/','', $type ); |
701 | 701 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
702 | 702 | } |
@@ -724,8 +724,8 @@ discard block |
||
724 | 724 | global $post; |
725 | 725 | |
726 | 726 | global $wp_post_types; |
727 | - $labels = &$wp_post_types['post']->labels; |
|
728 | - $labels->name = 'Articles'; |
|
727 | + $labels = &$wp_post_types['post']->labels; |
|
728 | + $labels->name = 'Articles'; |
|
729 | 729 | |
730 | 730 | ob_start(); |
731 | 731 | |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | ob_start(); |
786 | 786 | |
787 | 787 | |
788 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
788 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
789 | 789 | |
790 | 790 | // let users add custom css classes |
791 | 791 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -887,9 +887,9 @@ discard block |
||
887 | 887 | function lasso_editor_options_blob() { |
888 | 888 | |
889 | 889 | $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
890 | - $codes = add_wpimg_options( $codes ); |
|
890 | + $codes = add_wpimg_options( $codes ); |
|
891 | 891 | $codes = add_wpimg_block_options( $codes ); |
892 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
892 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
893 | 893 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
894 | 894 | |
895 | 895 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -991,9 +991,9 @@ discard block |
||
991 | 991 | $return .= '</form>'; |
992 | 992 | |
993 | 993 | // extra JS codes |
994 | - if (isset($shortcode['codes'])) { |
|
995 | - $return .= $shortcode['codes']; |
|
996 | - } |
|
994 | + if (isset($shortcode['codes'])) { |
|
995 | + $return .= $shortcode['codes']; |
|
996 | + } |
|
997 | 997 | $blob[$slug] = $return; |
998 | 998 | } |
999 | 999 | |
@@ -1002,95 +1002,95 @@ discard block |
||
1002 | 1002 | |
1003 | 1003 | |
1004 | 1004 | function add_wpimg_options( $shortcodes ) { |
1005 | - $custom = array( |
|
1006 | - 'wpimg' => array( |
|
1007 | - 'name' => __( 'Image', 'lasso' ), |
|
1008 | - 'type' => 'single', |
|
1009 | - 'atts' => array( |
|
1010 | - 'img' => array( |
|
1011 | - 'type' => 'media_upload', |
|
1012 | - 'default' => '', |
|
1013 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1014 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1015 | - ), |
|
1016 | - 'align' => array( |
|
1017 | - 'type' => 'select', |
|
1018 | - 'values' => array( |
|
1019 | - array( |
|
1020 | - 'value' => 'center', |
|
1021 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1022 | - ), |
|
1023 | - array( |
|
1024 | - 'value' => 'left', |
|
1025 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1026 | - ), |
|
1027 | - array( |
|
1028 | - 'value' => 'right', |
|
1029 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1030 | - ), |
|
1031 | - ), |
|
1032 | - 'default' => 'center', |
|
1033 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1034 | - 'tip'=>'' |
|
1035 | - ), |
|
1005 | + $custom = array( |
|
1006 | + 'wpimg' => array( |
|
1007 | + 'name' => __( 'Image', 'lasso' ), |
|
1008 | + 'type' => 'single', |
|
1009 | + 'atts' => array( |
|
1010 | + 'img' => array( |
|
1011 | + 'type' => 'media_upload', |
|
1012 | + 'default' => '', |
|
1013 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1014 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1015 | + ), |
|
1016 | + 'align' => array( |
|
1017 | + 'type' => 'select', |
|
1018 | + 'values' => array( |
|
1019 | + array( |
|
1020 | + 'value' => 'center', |
|
1021 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1022 | + ), |
|
1023 | + array( |
|
1024 | + 'value' => 'left', |
|
1025 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1026 | + ), |
|
1027 | + array( |
|
1028 | + 'value' => 'right', |
|
1029 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1030 | + ), |
|
1031 | + ), |
|
1032 | + 'default' => 'center', |
|
1033 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1034 | + 'tip'=>'' |
|
1035 | + ), |
|
1036 | 1036 | |
1037 | - 'imgwidth' => array( |
|
1038 | - 'type' => 'text_small', |
|
1039 | - 'default' => '300px', |
|
1040 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1041 | - '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' ) |
|
1042 | - ), |
|
1043 | - 'imgheight' => array( |
|
1044 | - 'type' => 'text_small', |
|
1045 | - 'default' => '', |
|
1046 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1047 | - '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' ) |
|
1048 | - ), |
|
1049 | - 'linkoption' => array( |
|
1050 | - 'type' => 'select', |
|
1051 | - 'values' => array( |
|
1052 | - array( |
|
1053 | - 'value' => 'none', |
|
1054 | - 'name' => __( 'None', 'aesop-core' ) |
|
1055 | - ), |
|
1056 | - array( |
|
1057 | - 'value' => 'img', |
|
1058 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1059 | - ), |
|
1060 | - array( |
|
1061 | - 'value' => 'url', |
|
1062 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1063 | - ), |
|
1064 | - ), |
|
1065 | - 'default' => 'none', |
|
1066 | - 'desc' => __( 'Link', 'lasso' ), |
|
1067 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1068 | - ), |
|
1037 | + 'imgwidth' => array( |
|
1038 | + 'type' => 'text_small', |
|
1039 | + 'default' => '300px', |
|
1040 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
1041 | + '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' ) |
|
1042 | + ), |
|
1043 | + 'imgheight' => array( |
|
1044 | + 'type' => 'text_small', |
|
1045 | + 'default' => '', |
|
1046 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
1047 | + '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' ) |
|
1048 | + ), |
|
1049 | + 'linkoption' => array( |
|
1050 | + 'type' => 'select', |
|
1051 | + 'values' => array( |
|
1052 | + array( |
|
1053 | + 'value' => 'none', |
|
1054 | + 'name' => __( 'None', 'aesop-core' ) |
|
1055 | + ), |
|
1056 | + array( |
|
1057 | + 'value' => 'img', |
|
1058 | + 'name' => __( 'Image', 'aesop-core' ) |
|
1059 | + ), |
|
1060 | + array( |
|
1061 | + 'value' => 'url', |
|
1062 | + 'name' => __( 'URL', 'aesop-core' ) |
|
1063 | + ), |
|
1064 | + ), |
|
1065 | + 'default' => 'none', |
|
1066 | + 'desc' => __( 'Link', 'lasso' ), |
|
1067 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1068 | + ), |
|
1069 | 1069 | |
1070 | - 'link' => array( |
|
1071 | - 'type' => 'text', |
|
1072 | - 'default' => '', |
|
1073 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1074 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1075 | - ), |
|
1076 | - 'alt' => array( |
|
1077 | - 'type' => 'text', |
|
1078 | - 'default' => '', |
|
1079 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1080 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1081 | - ), |
|
1070 | + 'link' => array( |
|
1071 | + 'type' => 'text', |
|
1072 | + 'default' => '', |
|
1073 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
1074 | + 'tip' => __( 'URL link', 'lasso' ) |
|
1075 | + ), |
|
1076 | + 'alt' => array( |
|
1077 | + 'type' => 'text', |
|
1078 | + 'default' => '', |
|
1079 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1080 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1081 | + ), |
|
1082 | 1082 | |
1083 | - 'caption' => array( |
|
1084 | - 'type' => 'text_area', |
|
1085 | - 'default' => '', |
|
1086 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1087 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1088 | - ), |
|
1083 | + 'caption' => array( |
|
1084 | + 'type' => 'text_area', |
|
1085 | + 'default' => '', |
|
1086 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1087 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1088 | + ), |
|
1089 | 1089 | |
1090 | 1090 | |
1091 | - ), |
|
1092 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1093 | - 'codes' => '<script> |
|
1091 | + ), |
|
1092 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
1093 | + 'codes' => '<script> |
|
1094 | 1094 | jQuery(document).ready(function($){ |
1095 | 1095 | function linkSetting(l){ |
1096 | 1096 | if ( l=="url") { |
@@ -1110,75 +1110,75 @@ discard block |
||
1110 | 1110 | }) |
1111 | 1111 | }); |
1112 | 1112 | </script>' |
1113 | - ) |
|
1114 | - ); |
|
1113 | + ) |
|
1114 | + ); |
|
1115 | 1115 | |
1116 | - return array_merge( $shortcodes, $custom ); |
|
1116 | + return array_merge( $shortcodes, $custom ); |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | function add_wpimg_block_options( $shortcodes ) { |
1120 | - $custom = array( |
|
1121 | - 'wpimg-block' => array( |
|
1122 | - 'name' => __( 'Image', 'lasso' ), |
|
1123 | - 'type' => 'single', |
|
1124 | - 'atts' => array( |
|
1125 | - 'img' => array( |
|
1126 | - 'type' => 'media_upload', |
|
1127 | - 'default' => '', |
|
1128 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1129 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1130 | - ), |
|
1131 | - 'align' => array( |
|
1132 | - 'type' => 'select', |
|
1133 | - 'values' => array( |
|
1134 | - array( |
|
1135 | - 'value' => 'center', |
|
1136 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1137 | - ), |
|
1138 | - array( |
|
1139 | - 'value' => 'left', |
|
1140 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1141 | - ), |
|
1142 | - array( |
|
1143 | - 'value' => 'right', |
|
1144 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1145 | - ), |
|
1146 | - ), |
|
1147 | - 'default' => 'center', |
|
1148 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1149 | - 'tip'=>'' |
|
1150 | - ), |
|
1151 | - 'alt' => array( |
|
1152 | - 'type' => 'text', |
|
1153 | - 'default' => '', |
|
1154 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1155 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1156 | - ), |
|
1157 | - 'caption' => array( |
|
1158 | - 'type' => 'text', |
|
1159 | - 'default' => '', |
|
1160 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1161 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1162 | - ), |
|
1163 | - 'link' => array( |
|
1164 | - 'type' => 'text', |
|
1165 | - 'default' => '', |
|
1166 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1167 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1168 | - ), |
|
1120 | + $custom = array( |
|
1121 | + 'wpimg-block' => array( |
|
1122 | + 'name' => __( 'Image', 'lasso' ), |
|
1123 | + 'type' => 'single', |
|
1124 | + 'atts' => array( |
|
1125 | + 'img' => array( |
|
1126 | + 'type' => 'media_upload', |
|
1127 | + 'default' => '', |
|
1128 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1129 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1130 | + ), |
|
1131 | + 'align' => array( |
|
1132 | + 'type' => 'select', |
|
1133 | + 'values' => array( |
|
1134 | + array( |
|
1135 | + 'value' => 'center', |
|
1136 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1137 | + ), |
|
1138 | + array( |
|
1139 | + 'value' => 'left', |
|
1140 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1141 | + ), |
|
1142 | + array( |
|
1143 | + 'value' => 'right', |
|
1144 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1145 | + ), |
|
1146 | + ), |
|
1147 | + 'default' => 'center', |
|
1148 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1149 | + 'tip'=>'' |
|
1150 | + ), |
|
1151 | + 'alt' => array( |
|
1152 | + 'type' => 'text', |
|
1153 | + 'default' => '', |
|
1154 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1155 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1156 | + ), |
|
1157 | + 'caption' => array( |
|
1158 | + 'type' => 'text', |
|
1159 | + 'default' => '', |
|
1160 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1161 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1162 | + ), |
|
1163 | + 'link' => array( |
|
1164 | + 'type' => 'text', |
|
1165 | + 'default' => '', |
|
1166 | + 'desc' => __( 'Link URL', 'lasso' ), |
|
1167 | + 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1168 | + ), |
|
1169 | 1169 | |
1170 | 1170 | |
1171 | - ), |
|
1172 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1173 | - 'codes' => '<script> |
|
1171 | + ), |
|
1172 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1173 | + 'codes' => '<script> |
|
1174 | 1174 | jQuery(document).ready(function($){ |
1175 | 1175 | |
1176 | 1176 | }); |
1177 | 1177 | </script>' |
1178 | - ) |
|
1179 | - ); |
|
1178 | + ) |
|
1179 | + ); |
|
1180 | 1180 | |
1181 | - return array_merge( $shortcodes, $custom ); |
|
1181 | + return array_merge( $shortcodes, $custom ); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1223,23 +1223,23 @@ discard block |
||
1223 | 1223 | * @return string |
1224 | 1224 | */ |
1225 | 1225 | function lasso_editor_adjustBrightness($hex, $steps) { |
1226 | - $steps = max(-255, min(255, $steps)); |
|
1226 | + $steps = max(-255, min(255, $steps)); |
|
1227 | 1227 | |
1228 | - // Normalize into a six character long hex string |
|
1229 | - $hex = str_replace('#', '', $hex); |
|
1230 | - if (strlen($hex) == 3) { |
|
1231 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1232 | - } |
|
1228 | + // Normalize into a six character long hex string |
|
1229 | + $hex = str_replace('#', '', $hex); |
|
1230 | + if (strlen($hex) == 3) { |
|
1231 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1232 | + } |
|
1233 | 1233 | |
1234 | - // Split into three parts: R, G and B |
|
1235 | - $color_parts = str_split($hex, 2); |
|
1236 | - $return = '#'; |
|
1234 | + // Split into three parts: R, G and B |
|
1235 | + $color_parts = str_split($hex, 2); |
|
1236 | + $return = '#'; |
|
1237 | 1237 | |
1238 | - foreach ($color_parts as $color) { |
|
1239 | - $color = hexdec($color); // Convert to decimal |
|
1240 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1241 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1242 | - } |
|
1238 | + foreach ($color_parts as $color) { |
|
1239 | + $color = hexdec($color); // Convert to decimal |
|
1240 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1241 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1242 | + } |
|
1243 | 1243 | |
1244 | - return $return; |
|
1244 | + return $return; |
|
1245 | 1245 | } |
@@ -11,39 +11,39 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @since 1.0 |
13 | 13 | */ |
14 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
14 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
15 | 15 | function lasso_editor_controls() { |
16 | 16 | |
17 | 17 | global $post; |
18 | 18 | |
19 | - if ( lasso_user_can('edit_posts') ) { |
|
19 | + if (lasso_user_can('edit_posts')) { |
|
20 | 20 | |
21 | - $status = get_post_status( get_the_ID() ); |
|
22 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
23 | - $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff'); |
|
24 | - $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000'); |
|
25 | - $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055'); |
|
26 | - $text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff'); |
|
21 | + $status = get_post_status(get_the_ID()); |
|
22 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
23 | + $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff'); |
|
24 | + $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000'); |
|
25 | + $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055'); |
|
26 | + $text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff'); |
|
27 | 27 | $hover_color1 = lasso_editor_adjustBrightness($button_color1, 50); |
28 | 28 | $hover_color2 = lasso_editor_adjustBrightness($button_color2, 50); |
29 | 29 | |
30 | 30 | // let users add custom css classes |
31 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
31 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
32 | 32 | |
33 | 33 | $post_access_class = ''; |
34 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
35 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
36 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
34 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
35 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
36 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // CSS class if adding new post objects is disabled |
40 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
40 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if adjust settings is disabled |
43 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
43 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
44 | 44 | |
45 | 45 | // CSS class if adding new post objects AND settings are disabled |
46 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
46 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
47 | 47 | |
48 | 48 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
49 | 49 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ?> |
58 | 58 | <style> |
59 | 59 | #lasso-html--table:before { |
60 | - content: "<?php esc_attr_e( 'Table', 'lasso' );?>"; |
|
60 | + content: "<?php esc_attr_e('Table', 'lasso'); ?>"; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -67,32 +67,32 @@ discard block |
||
67 | 67 | ?> |
68 | 68 | |
69 | 69 | .lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish { |
70 | - background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
71 | - background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
72 | - background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
73 | - color: <?php echo $text_color;?>; |
|
70 | + background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
71 | + background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
72 | + background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
73 | + color: <?php echo $text_color; ?>; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | .lasso--controls__right a:before, #lasso-toolbar--html__footer_desc, ul.lasso-editor-controls li:before,#lasso-side-comp-button.toolbar--side li:before |
77 | 77 | { |
78 | - color: <?php echo $text_color;?> !important; |
|
78 | + color: <?php echo $text_color; ?> !important; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | 83 | ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover { |
84 | - background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
85 | - background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
86 | - background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
84 | + background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
85 | + background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
86 | + background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | .lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap, |
90 | 90 | #lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap { |
91 | - background: <?php echo $dialog_color;?>; |
|
92 | - color: <?php echo $text_color;?>; |
|
91 | + background: <?php echo $dialog_color; ?>; |
|
92 | + color: <?php echo $text_color; ?>; |
|
93 | 93 | } |
94 | 94 | .sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label { |
95 | - color: <?php echo $text_color;?> !important; |
|
95 | + color: <?php echo $text_color; ?> !important; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | <?php if (!$is_mobile) { ?> |
@@ -126,48 +126,48 @@ discard block |
||
126 | 126 | } |
127 | 127 | ?> |
128 | 128 | </style> |
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();?>" > |
|
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 | |
131 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
131 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
132 | 132 | |
133 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
133 | + <?php do_action('lasso_editor_controls_before'); |
|
134 | 134 | |
135 | - if ( $is_capable ) { ?> |
|
135 | + if ($is_capable) { ?> |
|
136 | 136 | |
137 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
137 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
138 | 138 | |
139 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
140 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
139 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
140 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
141 | 141 | <?php } |
142 | 142 | |
143 | 143 | } ?> |
144 | 144 | |
145 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
145 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
146 | 146 | |
147 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
148 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
147 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
148 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
149 | 149 | <?php } ?> |
150 | 150 | |
151 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?> |
|
152 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
151 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?> |
|
152 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
153 | 153 | <?php } ?> |
154 | 154 | |
155 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
155 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
156 | 156 | |
157 | 157 | </ul> |
158 | 158 | |
159 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
159 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
160 | 160 | |
161 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
161 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
162 | 162 | |
163 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
164 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
163 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
164 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
165 | 165 | |
166 | 166 | |
167 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
167 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
168 | 168 | |
169 | - <?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?> |
|
170 | - <a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
169 | + <?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?> |
|
170 | + <a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
171 | 171 | <?php } ?> |
172 | 172 | |
173 | 173 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | </div> |
179 | 179 | |
180 | 180 | |
181 | - <?php do_action( 'lasso_editor_controls_after_outside' );?> |
|
181 | + <?php do_action('lasso_editor_controls_after_outside'); ?> |
|
182 | 182 | |
183 | 183 | <?php } |
184 | 184 | } |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | |
197 | 197 | |
198 | 198 | // let users add custom css classes |
199 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
199 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
200 | 200 | ?> |
201 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
201 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
202 | 202 | <div class="lasso--sidebar__inner"> |
203 | 203 | <div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div> |
204 | 204 | </div> |
@@ -220,21 +220,21 @@ discard block |
||
220 | 220 | $is_mobile = wp_is_mobile(); |
221 | 221 | |
222 | 222 | // check for lasso story engine and add a class doniting this |
223 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
223 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
224 | 224 | |
225 | 225 | // let users add custom css classes |
226 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
226 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
227 | 227 | |
228 | 228 | // are toolbar headings enabled |
229 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
230 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
231 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
229 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
230 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
231 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
232 | 232 | |
233 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
233 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
234 | 234 | |
235 | 235 | // mobile styles |
236 | 236 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
237 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
237 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
238 | 238 | |
239 | 239 | //show color |
240 | 240 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -242,131 +242,131 @@ discard block |
||
242 | 242 | //show alignment |
243 | 243 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
244 | 244 | |
245 | - $status = get_post_status( get_the_ID() ); |
|
245 | + $status = get_post_status(get_the_ID()); |
|
246 | 246 | |
247 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
247 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
248 | 248 | |
249 | - $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
249 | + $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
250 | 250 | |
251 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
251 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
252 | 252 | |
253 | 253 | ?> |
254 | - <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 ?>> |
|
255 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
256 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
257 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
258 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
259 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
260 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
261 | - <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
254 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
255 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
256 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
257 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
258 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
259 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
260 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
261 | + <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
262 | 262 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
263 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
264 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
265 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
266 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
267 | - <!--li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li--> |
|
268 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
269 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
270 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
271 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
272 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
273 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
274 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
275 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
276 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
277 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
278 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
263 | + <?php if ('ase-active' == $ase_status): ?> |
|
264 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
265 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
266 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
267 | + <!--li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li--> |
|
268 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
269 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
270 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
271 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
272 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
273 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
274 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
275 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
276 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
277 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
278 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
279 | 279 | <?php }?> |
280 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
281 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
280 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
281 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
282 | 282 | <?php }?> |
283 | 283 | <?php else: ?> |
284 | 284 | <?php if ($use_wp_block_image == 'on') { ?> |
285 | - <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
285 | + <li data-type="wpimg-block" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
286 | 286 | <?php } else { ?> |
287 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
287 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
288 | 288 | <?php } ?> |
289 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
290 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
289 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
290 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
291 | 291 | <?php endif; ?> |
292 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
292 | + <?php do_action('lasso_toolbar_components'); ?> |
|
293 | 293 | </ul> |
294 | 294 | </li> |
295 | - <?php if ( $toolbar_headings ): ?> |
|
296 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
297 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
295 | + <?php if ($toolbar_headings): ?> |
|
296 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
297 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
298 | 298 | <?php endif; ?> |
299 | 299 | |
300 | 300 | |
301 | 301 | |
302 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
303 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
304 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
305 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
302 | + <?php if ($toolbar_headings_h4): ?> |
|
303 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
304 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
305 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
306 | 306 | <?php endif; ?> |
307 | 307 | |
308 | - <?php if ( $show_color ): ?> |
|
309 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
310 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
308 | + <?php if ($show_color): ?> |
|
309 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
310 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
311 | 311 | <?php endif; ?> |
312 | 312 | |
313 | - <?php if ( $toolbar_list ): ?> |
|
314 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
315 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
313 | + <?php if ($toolbar_list): ?> |
|
314 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
315 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
316 | 316 | <?php endif; ?> |
317 | 317 | |
318 | 318 | |
319 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
319 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
320 | 320 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
321 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
322 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
321 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
322 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
323 | 323 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
324 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
324 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
325 | 325 | </div> |
326 | 326 | </li> |
327 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
328 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
327 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
328 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
329 | 329 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
330 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
330 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
331 | 331 | <div id="lasso-toolbar--html__footer"> |
332 | 332 | <div id="lasso-toolbar--html__footer_desc" > |
333 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
334 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
335 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
333 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
334 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
335 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
336 | 336 | </div> |
337 | 337 | <ul class="lasso-toolbar--html-snips"> |
338 | 338 | |
339 | - <?php if ( !$toolbar_headings ): ?> |
|
340 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
341 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
339 | + <?php if (!$toolbar_headings): ?> |
|
340 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
341 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
342 | 342 | <?php endif; ?> |
343 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
344 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
343 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
344 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
345 | 345 | |
346 | - <li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>"> |
|
346 | + <li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>"> |
|
347 | 347 | </ul> |
348 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
349 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
348 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
349 | + <a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
350 | 350 | </div> |
351 | 351 | </div> |
352 | 352 | </li> |
353 | - <?php if ( $show_align ): ?> |
|
354 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
355 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
356 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
353 | + <?php if ($show_align): ?> |
|
354 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
355 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
356 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
357 | 357 | <?php endif; ?> |
358 | 358 | </ul> |
359 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
359 | + <?php if (is_singular() && $is_mobile) { ?> |
|
360 | 360 | |
361 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
361 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
362 | 362 | |
363 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
364 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
363 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
364 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
365 | 365 | |
366 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
366 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
367 | 367 | |
368 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
369 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
368 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
369 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
370 | 370 | <?php } ?> |
371 | 371 | |
372 | 372 | </div> |
@@ -384,20 +384,20 @@ discard block |
||
384 | 384 | */ |
385 | 385 | function lasso_editor_settings_toolbar() { |
386 | 386 | |
387 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
387 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
388 | 388 | |
389 | 389 | ob_start(); |
390 | 390 | |
391 | 391 | |
392 | 392 | // let users add custom css classes |
393 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
393 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
394 | 394 | |
395 | 395 | ?> |
396 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
397 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
398 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
399 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
400 | - <li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
396 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
397 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
398 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
399 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
400 | + <li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
401 | 401 | </ul> |
402 | 402 | |
403 | 403 | <?php return ob_get_clean(); |
@@ -415,13 +415,13 @@ discard block |
||
415 | 415 | |
416 | 416 | |
417 | 417 | // has post thumbnail |
418 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
418 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
419 | 419 | |
420 | 420 | ?> |
421 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
422 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
423 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
424 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
421 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
422 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
423 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
424 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
425 | 425 | </ul> |
426 | 426 | |
427 | 427 | <?php return ob_get_clean(); |
@@ -445,39 +445,39 @@ discard block |
||
445 | 445 | |
446 | 446 | $postid = get_the_ID(); |
447 | 447 | |
448 | - $status = get_post_status( $postid ); |
|
449 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
448 | + $status = get_post_status($postid); |
|
449 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
450 | 450 | |
451 | 451 | // let users add custom css classes |
452 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
452 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
453 | 453 | |
454 | 454 | // objects categories |
455 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
456 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
455 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
456 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
457 | 457 | |
458 | 458 | // modal tabs |
459 | - $tabs = lasso_modal_addons('tab'); |
|
460 | - $content = lasso_modal_addons('content'); |
|
459 | + $tabs = lasso_modal_addons('tab'); |
|
460 | + $content = lasso_modal_addons('content'); |
|
461 | 461 | |
462 | 462 | //editor options |
463 | 463 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
464 | 464 | $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
465 | 465 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
466 | - $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
|
466 | + $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
|
467 | 467 | |
468 | 468 | //get custom taxonomy |
469 | 469 | if ($support_custom_taxonomy) { |
470 | - $custom_taxonomies = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']); |
|
470 | + $custom_taxonomies = array_diff(get_object_taxonomies(get_post_type($postid), 'names'), ['category', 'post_tag', 'post_format']); |
|
471 | 471 | } else { |
472 | 472 | $custom_taxonomies = []; |
473 | 473 | } |
474 | 474 | |
475 | 475 | // are we singular |
476 | - $is_singular = is_singular(); |
|
476 | + $is_singular = is_singular(); |
|
477 | 477 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
478 | 478 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
479 | 479 | $theme_supports = current_theme_supports('post-thumbnails'); |
480 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
480 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
481 | 481 | |
482 | 482 | // do we support pending status |
483 | 483 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -485,26 +485,26 @@ discard block |
||
485 | 485 | $excerpt = $post->post_excerpt; |
486 | 486 | |
487 | 487 | ?> |
488 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
488 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
489 | 489 | <div class="lasso--modal__inner"> |
490 | 490 | |
491 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
491 | + <?php if ($tabs) { echo $tabs; } ?> |
|
492 | 492 | |
493 | 493 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
494 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
494 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
495 | 495 | |
496 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
496 | + <?php if ($is_singular && $theme_supports) : ?> |
|
497 | 497 | <div class="lasso--postsettings__left"> |
498 | - <label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
499 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
498 | + <label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
499 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
500 | 500 | |
501 | 501 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
502 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
503 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
502 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
503 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
504 | 504 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
505 | 505 | </div> |
506 | 506 | |
507 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
507 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
508 | 508 | |
509 | 509 | </div> |
510 | 510 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -514,15 +514,15 @@ discard block |
||
514 | 514 | |
515 | 515 | <div class="lasso--postsettings__right"> |
516 | 516 | |
517 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
517 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
518 | 518 | <div class="lasso--postsettings__option story-status-option"> |
519 | - <label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
520 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
521 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
522 | - <?php if( !$no_pending_status ): ?> |
|
523 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
519 | + <label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
520 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
521 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
522 | + <?php if (!$no_pending_status): ?> |
|
523 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
524 | 524 | <?php endif; ?> |
525 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
525 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
526 | 526 | </ul> |
527 | 527 | <div class="lasso--slider_wrap"> |
528 | 528 | <div id="lasso--slider"></div> |
@@ -530,10 +530,10 @@ discard block |
||
530 | 530 | </div> |
531 | 531 | <?php endif; ?> |
532 | 532 | |
533 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
533 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
534 | 534 | <div class="lasso--postsettings__option story-slug-option"> |
535 | - <label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
536 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
535 | + <label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
536 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
537 | 537 | </div> |
538 | 538 | <?php endif; ?> |
539 | 539 | |
@@ -542,20 +542,20 @@ discard block |
||
542 | 542 | <div class="lasso--postsettings__middle"> |
543 | 543 | |
544 | 544 | <div class="lasso--postsettings__option story-categories-option"> |
545 | - <label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
546 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
545 | + <label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
546 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
547 | 547 | </div> |
548 | 548 | |
549 | 549 | <div class="lasso--postsettings__option story-tags-option"> |
550 | - <label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
551 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
550 | + <label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
551 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
552 | 552 | </div> |
553 | 553 | |
554 | 554 | <?php |
555 | 555 | if (!empty($custom_taxonomies)) { |
556 | 556 | ?> |
557 | 557 | <div class="lasso--postsettings__option story-custom-taxonomy-option"> |
558 | - <label><?php _e( 'Custom Taxonomy', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Choose custom taxonomy.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
558 | + <label><?php _e('Custom Taxonomy', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Choose custom taxonomy.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
559 | 559 | <select id="lasso--custom-taxo-select" class="lasso--modal__trigger-footer" name="custom_taxo"> |
560 | 560 | <?php foreach ($custom_taxonomies as $taxonomy) {?> |
561 | 561 | <option value="<?php echo $taxonomy?>"><?php echo $taxonomy?></option> |
@@ -572,18 +572,18 @@ discard block |
||
572 | 572 | if ($allow_edit_excerpt) { |
573 | 573 | ?> |
574 | 574 | <div class="lasso--postsettings__option story-excerpt-option"> |
575 | - <label><?php _e( 'Excerpt', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Edit excerpt', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
576 | - <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%"> |
|
575 | + <label><?php _e('Excerpt', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Edit excerpt', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
576 | + <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%"> |
|
577 | 577 | </div> |
578 | 578 | <?php |
579 | 579 | }?> |
580 | 580 | <?php |
581 | 581 | if ($allow_change_date) { |
582 | - $dateformat = get_option( 'date_format' ); |
|
582 | + $dateformat = get_option('date_format'); |
|
583 | 583 | ?> |
584 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
585 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
586 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
584 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
585 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
586 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
587 | 587 | <?php |
588 | 588 | }?> |
589 | 589 | |
@@ -605,23 +605,23 @@ discard block |
||
605 | 605 | ?> |
606 | 606 | <!--/div--> |
607 | 607 | |
608 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
608 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
609 | 609 | |
610 | 610 | <div class="lasso--postsettings__footer" > |
611 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
611 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
612 | 612 | <input type="hidden" name="status" value=""> |
613 | 613 | <input type="hidden" name="categories" value=""> |
614 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
614 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
615 | 615 | <input type="hidden" name="action" value="process_update-object_post"> |
616 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
617 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
618 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
616 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
617 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
618 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
619 | 619 | </div> |
620 | 620 | |
621 | 621 | </form> |
622 | 622 | </div> |
623 | 623 | |
624 | - <?php if( $tabs ) { echo $content; } ?> |
|
624 | + <?php if ($tabs) { echo $content; } ?> |
|
625 | 625 | |
626 | 626 | </div> |
627 | 627 | |
@@ -643,43 +643,43 @@ discard block |
||
643 | 643 | ob_start(); |
644 | 644 | |
645 | 645 | |
646 | - $status = get_post_status( get_the_ID() ); |
|
646 | + $status = get_post_status(get_the_ID()); |
|
647 | 647 | |
648 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
648 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
649 | 649 | |
650 | 650 | // let users add custom css classes |
651 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
651 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
652 | 652 | |
653 | 653 | // return the post type |
654 | - $type = get_post_type( get_the_ID() ); |
|
654 | + $type = get_post_type(get_the_ID()); |
|
655 | 655 | |
656 | 656 | $mobile_style = ""; |
657 | 657 | if (wp_is_mobile()) { |
658 | 658 | //$mobile_style = 'style="top:140px !important;"'; |
659 | 659 | } |
660 | 660 | ?> |
661 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
661 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
662 | 662 | <div class="lasso--modal__inner lasso--hasnewform"> |
663 | 663 | |
664 | 664 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
665 | 665 | |
666 | 666 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
667 | - <label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
668 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
667 | + <label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
668 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
669 | 669 | <div class="lasso--select-wrap" style="width:90px"> |
670 | 670 | <select id="lasso--select-type" name="story_type"> |
671 | 671 | |
672 | 672 | <?php |
673 | 673 | $types = lasso_post_types_names(); |
674 | - if ( !empty( $types ) ) { |
|
675 | - foreach( $types as $name => $label ) |
|
674 | + if (!empty($types)) { |
|
675 | + foreach ($types as $name => $label) |
|
676 | 676 | { |
677 | 677 | $type = $name; |
678 | 678 | //$type = preg_replace( '/s\b/','', $name ); |
679 | 679 | if ($type == 'page' && !current_user_can('edit_pages')) { |
680 | 680 | continue; |
681 | 681 | } |
682 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
682 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
683 | 683 | } |
684 | 684 | |
685 | 685 | } |
@@ -690,19 +690,19 @@ discard block |
||
690 | 690 | </div> |
691 | 691 | |
692 | 692 | <div class="lasso--postsettings__footer"> |
693 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
693 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
694 | 694 | <input type="hidden" name="action" value="process_new-object_post"> |
695 | 695 | <?php |
696 | - if ( !empty( $types ) ) { |
|
696 | + if (!empty($types)) { |
|
697 | 697 | // get the first element |
698 | 698 | $keys = array_keys($types); |
699 | - $type =$keys[0]; |
|
700 | - $type = preg_replace( '/s\b/','', $type ); |
|
701 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
699 | + $type = $keys[0]; |
|
700 | + $type = preg_replace('/s\b/', '', $type); |
|
701 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
702 | 702 | } |
703 | 703 | ?> |
704 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
705 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
704 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
705 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
706 | 706 | </div> |
707 | 707 | |
708 | 708 | </form> |
@@ -730,18 +730,18 @@ discard block |
||
730 | 730 | ob_start(); |
731 | 731 | |
732 | 732 | // post status |
733 | - $status = get_post_status( get_the_ID() ); |
|
733 | + $status = get_post_status(get_the_ID()); |
|
734 | 734 | |
735 | 735 | // let users add custom css classes |
736 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
736 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
737 | 737 | |
738 | 738 | ?> |
739 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
739 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
740 | 740 | <div class="lasso--modal__inner"> |
741 | 741 | |
742 | 742 | <div class="lasso--post-filtering not-visible"> |
743 | 743 | <div class="lasso--search__results"> |
744 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
744 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
745 | 745 | </div> |
746 | 746 | <div class="lasso--search"> |
747 | 747 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -755,18 +755,18 @@ discard block |
||
755 | 755 | $post_types = lasso_post_types_names(); |
756 | 756 | $rest_bases = lasso_post_types_rest_base(); |
757 | 757 | |
758 | - if ( ! empty( $post_types ) ) { |
|
758 | + if (!empty($post_types)) { |
|
759 | 759 | $first = 'active'; |
760 | - foreach( $post_types as $name => $label ) { |
|
760 | + foreach ($post_types as $name => $label) { |
|
761 | 761 | if (array_key_exists($name, $rest_bases)) { |
762 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
762 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
763 | 763 | } |
764 | 764 | $first = ''; |
765 | 765 | } |
766 | 766 | |
767 | 767 | } |
768 | 768 | |
769 | - do_action('lasso_modal_post_objects');?> |
|
769 | + do_action('lasso_modal_post_objects'); ?> |
|
770 | 770 | |
771 | 771 | </ul> |
772 | 772 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -785,21 +785,21 @@ discard block |
||
785 | 785 | ob_start(); |
786 | 786 | |
787 | 787 | |
788 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
788 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
789 | 789 | |
790 | 790 | // let users add custom css classes |
791 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
791 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
792 | 792 | |
793 | 793 | ?> |
794 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
795 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
796 | - <?php if ($use_old_wpimg=='on') {?> |
|
797 | - <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
794 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
795 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
796 | + <?php if ($use_old_wpimg == 'on') {?> |
|
797 | + <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
798 | 798 | <?php } else {?> |
799 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
799 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
800 | 800 | <?php } ?> |
801 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
802 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
801 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
802 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
803 | 803 | </ul> |
804 | 804 | |
805 | 805 | <?php return ob_get_clean(); |
@@ -810,10 +810,10 @@ discard block |
||
810 | 810 | |
811 | 811 | ?> |
812 | 812 | <ul class="lasso-component--controls editus-center" contenteditable="false"> |
813 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
814 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
815 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
816 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
813 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
814 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
815 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
816 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
817 | 817 | </ul> |
818 | 818 | |
819 | 819 | <?php return ob_get_clean(); |
@@ -825,14 +825,14 @@ discard block |
||
825 | 825 | |
826 | 826 | |
827 | 827 | // let users add custom css classes |
828 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
828 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
829 | 829 | |
830 | 830 | ?> |
831 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
832 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
833 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
834 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
835 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
831 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
832 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
833 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
834 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
835 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
836 | 836 | </ul> |
837 | 837 | |
838 | 838 | <?php return ob_get_clean(); |
@@ -845,16 +845,16 @@ discard block |
||
845 | 845 | */ |
846 | 846 | function lasso_map_form_footer() { |
847 | 847 | |
848 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
848 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
849 | 849 | |
850 | 850 | ob_start(); |
851 | 851 | |
852 | 852 | ?> |
853 | 853 | <div class="lasso--map-form__footer"> |
854 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
855 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
854 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
855 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
856 | 856 | <input type="hidden" name="action" value="process_map_save"> |
857 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
857 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
858 | 858 | </div> |
859 | 859 | |
860 | 860 | <?php return ob_get_clean(); |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | |
873 | 873 | ?> |
874 | 874 | <div id="lasso--pagerefresh" class="visible"> |
875 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
875 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
876 | 876 | </div> |
877 | 877 | |
878 | 878 | <?php return ob_get_clean(); |
@@ -886,46 +886,46 @@ discard block |
||
886 | 886 | */ |
887 | 887 | function lasso_editor_options_blob() { |
888 | 888 | |
889 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
|
890 | - $codes = add_wpimg_options( $codes ); |
|
891 | - $codes = add_wpimg_block_options( $codes ); |
|
892 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
893 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
889 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array(); |
|
890 | + $codes = add_wpimg_options($codes); |
|
891 | + $codes = add_wpimg_block_options($codes); |
|
892 | + $codes = apply_filters('lasso_custom_options', $codes); |
|
893 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
894 | 894 | |
895 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
895 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
896 | 896 | |
897 | 897 | $blob = array(); |
898 | 898 | |
899 | - if ( empty( $codes ) ) |
|
899 | + if (empty($codes)) |
|
900 | 900 | return; |
901 | 901 | |
902 | - foreach ( $codes as $slug => $shortcode ) { |
|
902 | + foreach ($codes as $slug => $shortcode) { |
|
903 | 903 | $return = ''; |
904 | 904 | // Shortcode has atts |
905 | 905 | |
906 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
906 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
907 | 907 | |
908 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
908 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
909 | 909 | |
910 | 910 | |
911 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
911 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
912 | 912 | |
913 | 913 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
914 | 914 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
915 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
915 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
916 | 916 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
917 | 917 | // Select |
918 | 918 | |
919 | - if ( isset( $attr_info['values'] ) ) { |
|
919 | + if (isset($attr_info['values'])) { |
|
920 | 920 | |
921 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
921 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
922 | 922 | |
923 | - $i=0; |
|
923 | + $i = 0; |
|
924 | 924 | |
925 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
925 | + foreach ($attr_info['values'] as $attr_value) { |
|
926 | 926 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
927 | 927 | |
928 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
928 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
929 | 929 | |
930 | 930 | $i++; |
931 | 931 | } |
@@ -934,24 +934,24 @@ discard block |
||
934 | 934 | |
935 | 935 | } else { |
936 | 936 | |
937 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
937 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
938 | 938 | |
939 | 939 | // image upload |
940 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
940 | + if ('media_upload' == $attr_info['type']) { |
|
941 | 941 | |
942 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
942 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
943 | 943 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
944 | 944 | |
945 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
945 | + } elseif ('color' == $attr_info['type']) { |
|
946 | 946 | |
947 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
947 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
948 | 948 | |
949 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
949 | + } elseif ('text_area' == $attr_info['type']) { |
|
950 | 950 | |
951 | - $return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
951 | + $return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
952 | 952 | |
953 | 953 | } else { |
954 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
954 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
955 | 955 | } |
956 | 956 | } |
957 | 957 | $return .= '</p>'; |
@@ -962,9 +962,9 @@ discard block |
||
962 | 962 | /////////////////////////// |
963 | 963 | // START GALLERY AND MAP FRONT END STUFFS |
964 | 964 | /////////////////////////// |
965 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
965 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
966 | 966 | |
967 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
967 | + if ('gallery' == $shortcode['front_type']) { |
|
968 | 968 | |
969 | 969 | $return .= lasso_gallery_editor_module(); |
970 | 970 | |
@@ -975,13 +975,13 @@ discard block |
||
975 | 975 | /////////////////////////// |
976 | 976 | |
977 | 977 | // Single shortcode (not closed) |
978 | - if ( 'single' == $shortcode['type'] ) { |
|
978 | + if ('single' == $shortcode['type']) { |
|
979 | 979 | |
980 | 980 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
981 | 981 | |
982 | 982 | } else { |
983 | 983 | |
984 | - $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>'; |
|
984 | + $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>'; |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>'; |
@@ -1001,95 +1001,95 @@ discard block |
||
1001 | 1001 | } |
1002 | 1002 | |
1003 | 1003 | |
1004 | -function add_wpimg_options( $shortcodes ) { |
|
1004 | +function add_wpimg_options($shortcodes) { |
|
1005 | 1005 | $custom = array( |
1006 | 1006 | 'wpimg' => array( |
1007 | - 'name' => __( 'Image', 'lasso' ), |
|
1007 | + 'name' => __('Image', 'lasso'), |
|
1008 | 1008 | 'type' => 'single', |
1009 | 1009 | 'atts' => array( |
1010 | 1010 | 'img' => array( |
1011 | 1011 | 'type' => 'media_upload', |
1012 | 1012 | 'default' => '', |
1013 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1014 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1013 | + 'desc' => __('Image URL', 'lasso'), |
|
1014 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
1015 | 1015 | ), |
1016 | 1016 | 'align' => array( |
1017 | 1017 | 'type' => 'select', |
1018 | 1018 | 'values' => array( |
1019 | 1019 | array( |
1020 | 1020 | 'value' => 'center', |
1021 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1021 | + 'name' => __('Center', 'aesop-core') |
|
1022 | 1022 | ), |
1023 | 1023 | array( |
1024 | 1024 | 'value' => 'left', |
1025 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1025 | + 'name' => __('Left', 'aesop-core') |
|
1026 | 1026 | ), |
1027 | 1027 | array( |
1028 | 1028 | 'value' => 'right', |
1029 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1029 | + 'name' => __('Right', 'aesop-core') |
|
1030 | 1030 | ), |
1031 | 1031 | ), |
1032 | 1032 | 'default' => 'center', |
1033 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1033 | + 'desc' => __('Alignment', 'lasso'), |
|
1034 | 1034 | 'tip'=>'' |
1035 | 1035 | ), |
1036 | 1036 | |
1037 | 1037 | 'imgwidth' => array( |
1038 | 1038 | 'type' => 'text_small', |
1039 | 1039 | 'default' => '300px', |
1040 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1041 | - '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' ) |
|
1040 | + 'desc' => __('Image Width', 'lasso'), |
|
1041 | + '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') |
|
1042 | 1042 | ), |
1043 | 1043 | 'imgheight' => array( |
1044 | 1044 | 'type' => 'text_small', |
1045 | 1045 | 'default' => '', |
1046 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1047 | - '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' ) |
|
1046 | + 'desc' => __('Image Height', 'lasso'), |
|
1047 | + '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') |
|
1048 | 1048 | ), |
1049 | 1049 | 'linkoption' => array( |
1050 | 1050 | 'type' => 'select', |
1051 | 1051 | 'values' => array( |
1052 | 1052 | array( |
1053 | 1053 | 'value' => 'none', |
1054 | - 'name' => __( 'None', 'aesop-core' ) |
|
1054 | + 'name' => __('None', 'aesop-core') |
|
1055 | 1055 | ), |
1056 | 1056 | array( |
1057 | 1057 | 'value' => 'img', |
1058 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1058 | + 'name' => __('Image', 'aesop-core') |
|
1059 | 1059 | ), |
1060 | 1060 | array( |
1061 | 1061 | 'value' => 'url', |
1062 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1062 | + 'name' => __('URL', 'aesop-core') |
|
1063 | 1063 | ), |
1064 | 1064 | ), |
1065 | 1065 | 'default' => 'none', |
1066 | - 'desc' => __( 'Link', 'lasso' ), |
|
1067 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1066 | + 'desc' => __('Link', 'lasso'), |
|
1067 | + 'tip' => __('Click leads to:', 'lasso') |
|
1068 | 1068 | ), |
1069 | 1069 | |
1070 | 1070 | 'link' => array( |
1071 | 1071 | 'type' => 'text', |
1072 | 1072 | 'default' => '', |
1073 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1074 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1073 | + 'desc' => __('URL Link', 'lasso'), |
|
1074 | + 'tip' => __('URL link', 'lasso') |
|
1075 | 1075 | ), |
1076 | 1076 | 'alt' => array( |
1077 | 1077 | 'type' => 'text', |
1078 | 1078 | 'default' => '', |
1079 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1080 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1079 | + 'desc' => __('Image ALT', 'lasso'), |
|
1080 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1081 | 1081 | ), |
1082 | 1082 | |
1083 | 1083 | 'caption' => array( |
1084 | 1084 | 'type' => 'text_area', |
1085 | 1085 | 'default' => '', |
1086 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1087 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1086 | + 'desc' => __('Caption', 'lasso'), |
|
1087 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
1088 | 1088 | ), |
1089 | 1089 | |
1090 | 1090 | |
1091 | 1091 | ), |
1092 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1092 | + 'desc' => __('An image.', 'aesop-core'), |
|
1093 | 1093 | 'codes' => '<script> |
1094 | 1094 | jQuery(document).ready(function($){ |
1095 | 1095 | function linkSetting(l){ |
@@ -1113,63 +1113,63 @@ discard block |
||
1113 | 1113 | ) |
1114 | 1114 | ); |
1115 | 1115 | |
1116 | - return array_merge( $shortcodes, $custom ); |
|
1116 | + return array_merge($shortcodes, $custom); |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | -function add_wpimg_block_options( $shortcodes ) { |
|
1119 | +function add_wpimg_block_options($shortcodes) { |
|
1120 | 1120 | $custom = array( |
1121 | 1121 | 'wpimg-block' => array( |
1122 | - 'name' => __( 'Image', 'lasso' ), |
|
1122 | + 'name' => __('Image', 'lasso'), |
|
1123 | 1123 | 'type' => 'single', |
1124 | 1124 | 'atts' => array( |
1125 | 1125 | 'img' => array( |
1126 | 1126 | 'type' => 'media_upload', |
1127 | 1127 | 'default' => '', |
1128 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1129 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1128 | + 'desc' => __('Image URL', 'lasso'), |
|
1129 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
1130 | 1130 | ), |
1131 | 1131 | 'align' => array( |
1132 | 1132 | 'type' => 'select', |
1133 | 1133 | 'values' => array( |
1134 | 1134 | array( |
1135 | 1135 | 'value' => 'center', |
1136 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1136 | + 'name' => __('Center', 'aesop-core') |
|
1137 | 1137 | ), |
1138 | 1138 | array( |
1139 | 1139 | 'value' => 'left', |
1140 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1140 | + 'name' => __('Left', 'aesop-core') |
|
1141 | 1141 | ), |
1142 | 1142 | array( |
1143 | 1143 | 'value' => 'right', |
1144 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1144 | + 'name' => __('Right', 'aesop-core') |
|
1145 | 1145 | ), |
1146 | 1146 | ), |
1147 | 1147 | 'default' => 'center', |
1148 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1148 | + 'desc' => __('Alignment', 'lasso'), |
|
1149 | 1149 | 'tip'=>'' |
1150 | 1150 | ), |
1151 | 1151 | 'alt' => array( |
1152 | 1152 | 'type' => 'text', |
1153 | 1153 | 'default' => '', |
1154 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1155 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1154 | + 'desc' => __('Image ALT', 'lasso'), |
|
1155 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1156 | 1156 | ), |
1157 | 1157 | 'caption' => array( |
1158 | 1158 | 'type' => 'text', |
1159 | 1159 | 'default' => '', |
1160 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1161 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1160 | + 'desc' => __('Caption', 'lasso'), |
|
1161 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
1162 | 1162 | ), |
1163 | 1163 | 'link' => array( |
1164 | 1164 | 'type' => 'text', |
1165 | 1165 | 'default' => '', |
1166 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1167 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1166 | + 'desc' => __('Link URL', 'lasso'), |
|
1167 | + 'tip' => __('Optional URL to link.', 'lasso') |
|
1168 | 1168 | ), |
1169 | 1169 | |
1170 | 1170 | |
1171 | 1171 | ), |
1172 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1172 | + 'desc' => __('A WP Image Block.', 'aesop-core'), |
|
1173 | 1173 | 'codes' => '<script> |
1174 | 1174 | jQuery(document).ready(function($){ |
1175 | 1175 | |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | ) |
1179 | 1179 | ); |
1180 | 1180 | |
1181 | - return array_merge( $shortcodes, $custom ); |
|
1181 | + return array_merge($shortcodes, $custom); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1198,14 +1198,14 @@ discard block |
||
1198 | 1198 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
1199 | 1199 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
1200 | 1200 | <i class="lasso-icon lasso-icon-move"></i> |
1201 | - <label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
1201 | + <label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
1202 | 1202 | <div class="lasso--slider_wrap"> |
1203 | 1203 | <div id="lasso--slider"></div> |
1204 | 1204 | </div> |
1205 | 1205 | <ul id="lasso--revision-list"></ul> |
1206 | 1206 | <div class="lasso--btn-group lasso--btn-group-small"> |
1207 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
1208 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
1207 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
1208 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
1209 | 1209 | </div> |
1210 | 1210 | </div> |
1211 | 1211 | |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | // Normalize into a six character long hex string |
1229 | 1229 | $hex = str_replace('#', '', $hex); |
1230 | 1230 | if (strlen($hex) == 3) { |
1231 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1231 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | // Split into three parts: R, G and B |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | |
1238 | 1238 | foreach ($color_parts as $color) { |
1239 | 1239 | $color = hexdec($color); // Convert to decimal |
1240 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1240 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
1241 | 1241 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
1242 | 1242 | } |
1243 | 1243 |
@@ -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,11 +90,11 @@ 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 | - $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off'); |
|
97 | + $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor', 'off'); |
|
98 | 98 | |
99 | 99 | |
100 | 100 | //text alignement |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | // allow change date for post |
110 | 110 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
111 | 111 | |
112 | - // support custom taxonomy |
|
112 | + // support custom taxonomy |
|
113 | 113 | $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
114 | 114 | |
115 | 115 | if ($show_color) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $tz_offset = get_UTC_offset(); |
136 | 136 | $post_date = get_the_time('U', $postid); |
137 | 137 | $time = (time()+$tz_offset); |
138 | - $delta = $time - $post_date; |
|
138 | + $delta = $time - $post_date; |
|
139 | 139 | |
140 | 140 | $strings = array( |
141 | 141 | 'save' => __('Save','lasso'), |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | 'catsPlaceholder' => __('add categories...'), |
181 | 181 | 'tagsPlaceholder' => __('add tags...'), |
182 | - 'taxoPlaceholder' => __('add taxonomy terms...'), |
|
182 | + 'taxoPlaceholder' => __('add taxonomy terms...'), |
|
183 | 183 | |
184 | 184 | |
185 | 185 | ); |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
192 | 192 | |
193 | 193 | |
194 | - if ($allow_change_date) { |
|
195 | - $permalink = get_site_url().'/?p='.$postid; |
|
196 | - } else { |
|
197 | - $permalink = get_permalink($postid); |
|
198 | - } |
|
194 | + if ($allow_change_date) { |
|
195 | + $permalink = get_site_url().'/?p='.$postid; |
|
196 | + } else { |
|
197 | + $permalink = get_permalink($postid); |
|
198 | + } |
|
199 | 199 | |
200 | 200 | // rest api |
201 | 201 | $rest_nonce = ''; |
@@ -215,17 +215,17 @@ discard block |
||
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | - //excerpt |
|
219 | - $post_excerpt = ""; |
|
220 | - $post_excerpt = $post->post_excerpt; |
|
218 | + //excerpt |
|
219 | + $post_excerpt = ""; |
|
220 | + $post_excerpt = $post->post_excerpt; |
|
221 | 221 | |
222 | - //find if this is multi page. -1 if not |
|
223 | - $multipage = self::is_multipage(); |
|
224 | - $post_content = ""; |
|
225 | - //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
226 | - //if ($multipage != -1) { |
|
227 | - $post_content = $post->post_content; |
|
228 | - //} |
|
222 | + //find if this is multi page. -1 if not |
|
223 | + $multipage = self::is_multipage(); |
|
224 | + $post_content = ""; |
|
225 | + //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
226 | + //if ($multipage != -1) { |
|
227 | + $post_content = $post->post_content; |
|
228 | + //} |
|
229 | 229 | |
230 | 230 | //get custom taxonomy |
231 | 231 | $custom_taxonomies = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']); |
@@ -315,19 +315,19 @@ discard block |
||
315 | 315 | 'customFields' => $custom_fields, |
316 | 316 | 'clickToInsert' => ($insert_comp_ui =='click'), |
317 | 317 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
318 | - 'rtl' => is_rtl(), |
|
318 | + 'rtl' => is_rtl(), |
|
319 | 319 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
320 | 320 | 'linksEditable' => $links_editable, |
321 | 321 | 'supportPendingStatus' => !$no_pending_status, |
322 | 322 | '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>'), |
323 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
324 | - 'multipages'=> $multipage, |
|
325 | - 'post_content'=>$post_content, |
|
326 | - 'post_excerpt'=>$post_excerpt, |
|
327 | - 'supCustTaxo' => $support_custom_taxonomy == 'on', |
|
328 | - 'oldWPimg'=> $use_old_wpimg =='on', |
|
329 | - 'useWPImgBlk'=> $use_wpimgblock, |
|
330 | - 'prefixHTTP'=> $link_prefix_http =='on' |
|
323 | + 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
324 | + 'multipages'=> $multipage, |
|
325 | + 'post_content'=>$post_content, |
|
326 | + 'post_excerpt'=>$post_excerpt, |
|
327 | + 'supCustTaxo' => $support_custom_taxonomy == 'on', |
|
328 | + 'oldWPimg'=> $use_old_wpimg =='on', |
|
329 | + 'useWPImgBlk'=> $use_wpimgblock, |
|
330 | + 'prefixHTTP'=> $link_prefix_http =='on' |
|
331 | 331 | ); |
332 | 332 | |
333 | 333 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | |
336 | 336 | |
337 | 337 | if (!$using_restapiv2) { |
338 | - // enqueue REST API V1 |
|
338 | + // enqueue REST API V1 |
|
339 | 339 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
340 | 340 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
341 | 341 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | if ($show_color) { |
352 | 352 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
353 | 353 | } else { |
354 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
354 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
355 | 355 | } |
356 | 356 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
357 | 357 | |
@@ -360,44 +360,44 @@ discard block |
||
360 | 360 | |
361 | 361 | } |
362 | 362 | |
363 | - function gutenberg_active() { |
|
363 | + function gutenberg_active() { |
|
364 | 364 | |
365 | - // Gutenberg plugin is installed and activated. |
|
366 | - $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
367 | - |
|
368 | - // Block editor since 5.0. |
|
369 | - $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
370 | - |
|
371 | - if ( ! $gutenberg && ! $block_editor ) { |
|
372 | - return false; |
|
373 | - } |
|
374 | - |
|
375 | - if ( self::is_classic_editor_plugin_active() ) { |
|
376 | - $editor_option = get_option( 'classic-editor-replace' ); |
|
377 | - $block_editor_active = array( 'no-replace', 'block' ); |
|
378 | - |
|
379 | - return in_array( $editor_option, $block_editor_active, true ); |
|
380 | - } |
|
381 | - |
|
382 | - return true; |
|
383 | - } |
|
384 | - |
|
385 | - /** |
|
386 | - * Check if Classic Editor plugin is active. |
|
387 | - * |
|
388 | - * @return bool |
|
389 | - */ |
|
390 | - function is_classic_editor_plugin_active() { |
|
391 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
392 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
393 | - } |
|
394 | - |
|
395 | - if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
396 | - return true; |
|
397 | - } |
|
398 | - |
|
399 | - return false; |
|
400 | - } |
|
365 | + // Gutenberg plugin is installed and activated. |
|
366 | + $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
367 | + |
|
368 | + // Block editor since 5.0. |
|
369 | + $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
370 | + |
|
371 | + if ( ! $gutenberg && ! $block_editor ) { |
|
372 | + return false; |
|
373 | + } |
|
374 | + |
|
375 | + if ( self::is_classic_editor_plugin_active() ) { |
|
376 | + $editor_option = get_option( 'classic-editor-replace' ); |
|
377 | + $block_editor_active = array( 'no-replace', 'block' ); |
|
378 | + |
|
379 | + return in_array( $editor_option, $block_editor_active, true ); |
|
380 | + } |
|
381 | + |
|
382 | + return true; |
|
383 | + } |
|
384 | + |
|
385 | + /** |
|
386 | + * Check if Classic Editor plugin is active. |
|
387 | + * |
|
388 | + * @return bool |
|
389 | + */ |
|
390 | + function is_classic_editor_plugin_active() { |
|
391 | + if ( ! function_exists( 'is_plugin_active' ) ) { |
|
392 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
393 | + } |
|
394 | + |
|
395 | + if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
396 | + return true; |
|
397 | + } |
|
398 | + |
|
399 | + return false; |
|
400 | + } |
|
401 | 401 | |
402 | 402 | } |
403 | 403 |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | class assets { |
12 | 12 | |
13 | - public function __construct(){ |
|
13 | + public function __construct() { |
|
14 | 14 | |
15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | function is_multipage() |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | if (!$pos) return -1; |
23 | 23 | |
24 | 24 | global $wp; |
25 | - $url = home_url( $wp->request ); |
|
26 | - $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1; |
|
25 | + $url = home_url($wp->request); |
|
26 | + $index = intval(basename($url)) == 0 ? 0 : intval(basename($url)) - 1; |
|
27 | 27 | return $index; |
28 | 28 | } |
29 | 29 | |
30 | - public function scripts(){ |
|
30 | + public function scripts() { |
|
31 | 31 | |
32 | 32 | |
33 | 33 | global $post; |
34 | - if ( lasso_user_can('edit_posts') |
|
34 | + if (lasso_user_can('edit_posts') |
|
35 | 35 | /* uncomment this line to disable Editus on Gutenberg posts*/ |
36 | 36 | /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
37 | 37 | ) { |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | /** Returns the time offset from UTC |
40 | 40 | */ |
41 | 41 | function get_UTC_offset() { |
42 | - $timezone_string = get_option( 'timezone_string' ); |
|
43 | - if (empty( $timezone_string ) ) { |
|
44 | - return get_option('gmt_offset')*3600; |
|
42 | + $timezone_string = get_option('timezone_string'); |
|
43 | + if (empty($timezone_string)) { |
|
44 | + return get_option('gmt_offset') * 3600; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $origin_dtz = new \DateTimeZone($timezone_string); |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
54 | 54 | |
55 | 55 | //don't load autocomplete if it's a stockholm theme |
56 | - $themename = wp_get_theme()->get('Name'); |
|
57 | - if ($themename !='Stockholm' ) { |
|
56 | + $themename = wp_get_theme()->get('Name'); |
|
57 | + if ($themename != 'Stockholm') { |
|
58 | 58 | wp_enqueue_script('jquery-ui-autocomplete'); |
59 | 59 | } |
60 | 60 | wp_enqueue_script('jquery-ui-draggable'); |
@@ -67,30 +67,30 @@ discard block |
||
67 | 67 | // url for json api |
68 | 68 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
69 | 69 | |
70 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
70 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
71 | 71 | |
72 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
72 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
73 | 73 | |
74 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
75 | - if (empty( $featImgClass )) { |
|
74 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
75 | + if (empty($featImgClass)) { |
|
76 | 76 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
77 | 77 | } |
78 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
79 | - if (empty( $titleClass )) { |
|
78 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
79 | + if (empty($titleClass)) { |
|
80 | 80 | $titleClass = lasso_get_supported_theme_title_class(); |
81 | 81 | } |
82 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
83 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
82 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
83 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
84 | 84 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
85 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
85 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
86 | 86 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
87 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
88 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
87 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
88 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
89 | 89 | |
90 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
91 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
90 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
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 | 95 | $use_wpimgblock = false; |
96 | 96 | |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | |
115 | 115 | if ($show_color) { |
116 | 116 | //color picker |
117 | - wp_enqueue_style( 'wp-color-picker' ); |
|
118 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
117 | + wp_enqueue_style('wp-color-picker'); |
|
118 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // click to insert components, not drag and drop |
@@ -127,54 +127,54 @@ discard block |
||
127 | 127 | |
128 | 128 | // custom fields |
129 | 129 | |
130 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); |
|
130 | + $custom_fields = apply_filters('editus_custom_fields', null); |
|
131 | 131 | |
132 | 132 | |
133 | 133 | // post id reference |
134 | 134 | $postid = get_the_ID(); |
135 | 135 | $tz_offset = get_UTC_offset(); |
136 | 136 | $post_date = get_the_time('U', $postid); |
137 | - $time = (time()+$tz_offset); |
|
137 | + $time = (time() + $tz_offset); |
|
138 | 138 | $delta = $time - $post_date; |
139 | 139 | |
140 | 140 | $strings = array( |
141 | - 'save' => __('Save','lasso'), |
|
142 | - 'selectText' => __('Please Select Text First.','lasso'), |
|
143 | - 'cancel' => __('Cancel','lasso'), |
|
144 | - 'exiteditor' => __('Exit Editor','lasso'), |
|
145 | - 'saving' => __('Saving...','lasso'), |
|
146 | - 'saved' => __('Saved!','lasso'), |
|
147 | - 'adding' => __('Adding...','lasso'), |
|
148 | - 'added' => __('Added!','lasso'), |
|
149 | - 'loading' => __('Loading...','lasso'), |
|
150 | - 'loadMore' => __('Load More','lasso'), |
|
151 | - 'close' => __('Close','lasso'), |
|
152 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
153 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
154 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
155 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
156 | - 'justWrite' => __('Just write...','lasso'), |
|
157 | - 'chooseImage' => __('Choose an image','lasso'), |
|
158 | - 'updateImage' => __('Update Image','lasso'), |
|
159 | - 'insertImage' => __('Insert Image','lasso'), |
|
160 | - 'selectImage' => __('Select Image','lasso'), |
|
161 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
162 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
163 | - 'chooseImages' => __('Choose images','lasso'), |
|
164 | - 'editImage' => __('Edit Image','lasso'), |
|
165 | - 'addImages' => __('Add Images','lasso'), |
|
166 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
167 | - 'selectGallery' => __('Select Editus Gallery Image','lasso'), |
|
168 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
169 | - 'publishPost' => __('Publish Post?','lasso'), |
|
170 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
171 | - 'deletePost' => __('Trash Post?','lasso'), |
|
172 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
173 | - 'warning' => __('Oh snap!','laso'), |
|
174 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
175 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
141 | + 'save' => __('Save', 'lasso'), |
|
142 | + 'selectText' => __('Please Select Text First.', 'lasso'), |
|
143 | + 'cancel' => __('Cancel', 'lasso'), |
|
144 | + 'exiteditor' => __('Exit Editor', 'lasso'), |
|
145 | + 'saving' => __('Saving...', 'lasso'), |
|
146 | + 'saved' => __('Saved!', 'lasso'), |
|
147 | + 'adding' => __('Adding...', 'lasso'), |
|
148 | + 'added' => __('Added!', 'lasso'), |
|
149 | + 'loading' => __('Loading...', 'lasso'), |
|
150 | + 'loadMore' => __('Load More', 'lasso'), |
|
151 | + 'close' => __('Close', 'lasso'), |
|
152 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
153 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
154 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
155 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
156 | + 'justWrite' => __('Just write...', 'lasso'), |
|
157 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
158 | + 'updateImage' => __('Update Image', 'lasso'), |
|
159 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
160 | + 'selectImage' => __('Select Image', 'lasso'), |
|
161 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
162 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
163 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
164 | + 'editImage' => __('Edit Image', 'lasso'), |
|
165 | + 'addImages' => __('Add Images', 'lasso'), |
|
166 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
167 | + 'selectGallery' => __('Select Editus Gallery Image', 'lasso'), |
|
168 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
169 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
170 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
171 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
172 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
173 | + 'warning' => __('Oh snap!', 'laso'), |
|
174 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
175 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
176 | 176 | 'missingConfirm' => __('Update Settings', 'lasso'), |
177 | - 'helperText' => __('one more letter','lasso'), |
|
177 | + 'helperText' => __('one more letter', 'lasso'), |
|
178 | 178 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
179 | 179 | |
180 | 180 | 'catsPlaceholder' => __('add categories...'), |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | |
185 | 185 | ); |
186 | 186 | |
187 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
187 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
188 | 188 | |
189 | 189 | $gallery_class = new gallery(); |
190 | 190 | $gallery_nonce_action = $gallery_class->nonce_action; |
191 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
191 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
192 | 192 | |
193 | 193 | |
194 | 194 | if ($allow_change_date) { |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | |
204 | 204 | if (function_exists('rest_url')) { |
205 | 205 | //$rest_root = esc_url_raw( rest_url()); |
206 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
207 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
208 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
209 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
210 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
206 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
207 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
208 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
209 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
210 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
211 | 211 | |
212 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
212 | + if (class_exists('WP_REST_Controller')) { |
|
213 | 213 | // we are using REST API V2 |
214 | 214 | $using_restapiv2 = true; |
215 | 215 | } |
@@ -228,20 +228,20 @@ discard block |
||
228 | 228 | //} |
229 | 229 | |
230 | 230 | //get custom taxonomy |
231 | - $custom_taxonomies = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']); |
|
232 | - $post_taxo_arr = array(); |
|
231 | + $custom_taxonomies = array_diff(get_object_taxonomies(get_post_type($postid), 'names'), ['category', 'post_tag', 'post_format']); |
|
232 | + $post_taxo_arr = array(); |
|
233 | 233 | foreach ($custom_taxonomies as $taxonomy) { |
234 | - $post_taxo_arr[$taxonomy] = lasso_get_post_objects( $postid, $taxonomy ); |
|
234 | + $post_taxo_arr[$taxonomy] = lasso_get_post_objects($postid, $taxonomy); |
|
235 | 235 | } |
236 | - $existing_taxo_arr = array(); |
|
236 | + $existing_taxo_arr = array(); |
|
237 | 237 | foreach ($custom_taxonomies as $taxonomy) { |
238 | - $existing_taxo_arr[$taxonomy] = lasso_get_objects( $taxonomy ); |
|
238 | + $existing_taxo_arr[$taxonomy] = lasso_get_objects($taxonomy); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | // localized objects |
242 | 242 | $objects = array( |
243 | - 'ajaxurl' => esc_url( $api_url ), |
|
244 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
243 | + 'ajaxurl' => esc_url($api_url), |
|
244 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
245 | 245 | 'siteUrl' => site_url(), |
246 | 246 | 'rest_root' => $rest_root, |
247 | 247 | 'rest_nonce' => $rest_nonce, |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | 'featImgClass' => $featImgClass, |
251 | 251 | 'titleClass' => $titleClass, |
252 | 252 | 'strings' => $strings, |
253 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
254 | - 'post_status' => get_post_status( $postid ), |
|
253 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
254 | + 'post_status' => get_post_status($postid), |
|
255 | 255 | 'postid' => $postid, |
256 | 256 | 'permalink' => $permalink, |
257 | 257 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
258 | 258 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
259 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
259 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
260 | 260 | 'can_publish' => is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'), |
261 | 261 | //'can_publish_posts' => current_user_can('publish_posts'), |
262 | 262 | //'can_publish_pages' => current_user_can('publish_pages'), |
@@ -295,39 +295,39 @@ discard block |
||
295 | 295 | 'extCusTaxonomies' => $existing_taxo_arr, |
296 | 296 | 'noResultsDiv' => lasso_editor_empty_results(), |
297 | 297 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
298 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
299 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
300 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
301 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
298 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
299 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
300 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
301 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
302 | 302 | 'revisionModal' => lasso_editor_revision_modal(), |
303 | 303 | 'isMobile' => wp_is_mobile(), |
304 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
304 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
305 | 305 | 'showColor' => $show_color, |
306 | 306 | 'showAlignment' => $show_align, |
307 | 307 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
308 | 308 | 'restapi2' => $using_restapiv2, |
309 | 309 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
310 | - 'newObjectContent' => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>', |
|
310 | + 'newObjectContent' => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>', |
|
311 | 311 | 'disableSavePost' => $save_to_post_disabled, |
312 | 312 | 'disableEditPost' => $edit_post_disabled, |
313 | 313 | 'boldTag' => $bold_tag, |
314 | 314 | 'iTag' => $i_tag, |
315 | 315 | 'customFields' => $custom_fields, |
316 | - 'clickToInsert' => ($insert_comp_ui =='click'), |
|
317 | - 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
|
316 | + 'clickToInsert' => ($insert_comp_ui == 'click'), |
|
317 | + 'buttonOnEmptyP' => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph |
|
318 | 318 | 'rtl' => is_rtl(), |
319 | - 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
|
319 | + 'skipToEdit' =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode |
|
320 | 320 | 'linksEditable' => $links_editable, |
321 | 321 | 'supportPendingStatus' => !$no_pending_status, |
322 | - '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>'), |
|
323 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
322 | + '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>'), |
|
323 | + 'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //, |
|
324 | 324 | 'multipages'=> $multipage, |
325 | 325 | 'post_content'=>$post_content, |
326 | 326 | 'post_excerpt'=>$post_excerpt, |
327 | 327 | 'supCustTaxo' => $support_custom_taxonomy == 'on', |
328 | - 'oldWPimg'=> $use_old_wpimg =='on', |
|
328 | + 'oldWPimg'=> $use_old_wpimg == 'on', |
|
329 | 329 | 'useWPImgBlk'=> $use_wpimgblock, |
330 | - 'prefixHTTP'=> $link_prefix_http =='on' |
|
330 | + 'prefixHTTP'=> $link_prefix_http == 'on' |
|
331 | 331 | ); |
332 | 332 | |
333 | 333 | |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | |
337 | 337 | if (!$using_restapiv2) { |
338 | 338 | // enqueue REST API V1 |
339 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
340 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
341 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
339 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
340 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
341 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | if ($allow_change_date) { |
@@ -347,13 +347,13 @@ discard block |
||
347 | 347 | wp_enqueue_style('jquery-ui'); |
348 | 348 | } |
349 | 349 | |
350 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
350 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
351 | 351 | if ($show_color) { |
352 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
352 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
353 | 353 | } else { |
354 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
354 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
355 | 355 | } |
356 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
356 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
357 | 357 | |
358 | 358 | |
359 | 359 | } |
@@ -363,20 +363,20 @@ discard block |
||
363 | 363 | function gutenberg_active() { |
364 | 364 | |
365 | 365 | // Gutenberg plugin is installed and activated. |
366 | - $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
366 | + $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init')); |
|
367 | 367 | |
368 | 368 | // Block editor since 5.0. |
369 | - $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
369 | + $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>'); |
|
370 | 370 | |
371 | - if ( ! $gutenberg && ! $block_editor ) { |
|
371 | + if (!$gutenberg && !$block_editor) { |
|
372 | 372 | return false; |
373 | 373 | } |
374 | 374 | |
375 | - if ( self::is_classic_editor_plugin_active() ) { |
|
376 | - $editor_option = get_option( 'classic-editor-replace' ); |
|
377 | - $block_editor_active = array( 'no-replace', 'block' ); |
|
375 | + if (self::is_classic_editor_plugin_active()) { |
|
376 | + $editor_option = get_option('classic-editor-replace'); |
|
377 | + $block_editor_active = array('no-replace', 'block'); |
|
378 | 378 | |
379 | - return in_array( $editor_option, $block_editor_active, true ); |
|
379 | + return in_array($editor_option, $block_editor_active, true); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | return true; |
@@ -388,11 +388,11 @@ discard block |
||
388 | 388 | * @return bool |
389 | 389 | */ |
390 | 390 | function is_classic_editor_plugin_active() { |
391 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
392 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
391 | + if (!function_exists('is_plugin_active')) { |
|
392 | + include_once ABSPATH.'wp-admin/includes/plugin.php'; |
|
393 | 393 | } |
394 | 394 | |
395 | - if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
395 | + if (is_plugin_active('classic-editor/classic-editor.php')) { |
|
396 | 396 | return true; |
397 | 397 | } |
398 | 398 |
@@ -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,37 +169,37 @@ discard block |
||
169 | 169 | //table codes to be added |
170 | 170 | class editus_paragraph { |
171 | 171 | |
172 | - public function __construct(){ |
|
173 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
172 | + public function __construct(){ |
|
173 | + add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
174 | 174 | } |
175 | 175 | |
176 | - function scripts() |
|
177 | - { |
|
178 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | - add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
181 | - //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
182 | - //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
183 | - } |
|
176 | + function scripts() |
|
177 | + { |
|
178 | + add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | + add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | + add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
181 | + //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
182 | + //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
183 | + } |
|
184 | 184 | |
185 | - function editus_components_add_paragraph( $array ){ |
|
186 | - $custom = array( |
|
187 | - 'htmlparagraph' => array( |
|
188 | - 'name' => __('HTML Paragraph','lasso'), |
|
189 | - 'content' => self::editus_html_paragraph(), |
|
190 | - ) |
|
191 | - ); |
|
192 | - return array_merge( $array, $custom ); |
|
193 | - } |
|
185 | + function editus_components_add_paragraph( $array ){ |
|
186 | + $custom = array( |
|
187 | + 'htmlparagraph' => array( |
|
188 | + 'name' => __('HTML Paragraph','lasso'), |
|
189 | + 'content' => self::editus_html_paragraph(), |
|
190 | + ) |
|
191 | + ); |
|
192 | + return array_merge( $array, $custom ); |
|
193 | + } |
|
194 | 194 | |
195 | 195 | |
196 | - function editus_html_paragraph() |
|
197 | - { |
|
198 | - return '<p contenteditable="true"><br></p>'; |
|
199 | - } |
|
196 | + function editus_html_paragraph() |
|
197 | + { |
|
198 | + return '<p contenteditable="true"><br></p>'; |
|
199 | + } |
|
200 | 200 | |
201 | - function editus_paragraph_style() |
|
202 | - { ?> |
|
201 | + function editus_paragraph_style() |
|
202 | + { ?> |
|
203 | 203 | <style> |
204 | 204 | #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before |
205 | 205 | { |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | } |
209 | 209 | </style> |
210 | 210 | <?php |
211 | - } |
|
211 | + } |
|
212 | 212 | |
213 | 213 | |
214 | - function editus_toolbar_components_add_paragraph( ) { |
|
215 | - ?> |
|
214 | + function editus_toolbar_components_add_paragraph( ) { |
|
215 | + ?> |
|
216 | 216 | <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
217 | 217 | <?php |
218 | - } |
|
218 | + } |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | //Disable |
@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '1.4.0' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '1.4.0'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
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( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
66 | + if (empty($option)) |
|
67 | 67 | return; |
68 | 68 | |
69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
70 | 70 | |
71 | - $options = get_site_option( $section ); |
|
71 | + $options = get_site_option($section); |
|
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - $options = get_option( $section ); |
|
75 | + $options = get_option($section); |
|
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $options[$option] ) ) { |
|
78 | + if (isset($options[$option])) { |
|
79 | 79 | return $options[$option]; |
80 | 80 | } |
81 | 81 | |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | )); |
89 | 89 | |
90 | 90 | // Gutenberg |
91 | -if( function_exists( 'is_gutenberg_page' ) ) { |
|
92 | - function add_raw_to_post( $response, $post, $request ) { |
|
91 | +if (function_exists('is_gutenberg_page')) { |
|
92 | + function add_raw_to_post($response, $post, $request) { |
|
93 | 93 | $response_data = $response->get_data(); |
94 | - if ( is_array( $response_data['content'] )) { |
|
95 | - $response_data['content']['raw'] = $post->post_content ; |
|
96 | - $response->set_data( $response_data ); |
|
94 | + if (is_array($response_data['content'])) { |
|
95 | + $response_data['content']['raw'] = $post->post_content; |
|
96 | + $response->set_data($response_data); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $response; |
100 | 100 | } |
101 | - add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 ); |
|
101 | + add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -106,32 +106,32 @@ discard block |
||
106 | 106 | //table codes to be added |
107 | 107 | class editus_table { |
108 | 108 | |
109 | - public function __construct(){ |
|
109 | + public function __construct() { |
|
110 | 110 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
111 | 111 | if ($add_table) { |
112 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
112 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
113 | 113 | |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | 117 | function scripts() |
118 | 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 ); |
|
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 | 124 | } |
125 | 125 | |
126 | 126 | function editus_table_edit_menu() |
127 | 127 | { ?> |
128 | 128 | |
129 | 129 | <ul class='editus-table-menu'> |
130 | - <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li> |
|
131 | - <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li> |
|
132 | - <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li> |
|
133 | - <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li> |
|
134 | - <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li |
|
130 | + <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li> |
|
131 | + <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li> |
|
132 | + <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li> |
|
133 | + <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li> |
|
134 | + <li data-action="deltable"><?php echo __('Delete Table', 'lasso')?></li |
|
135 | 135 | </ul> |
136 | 136 | <?php |
137 | 137 | } |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | |
146 | - function editus_components_add_table( $array ){ |
|
146 | + function editus_components_add_table($array) { |
|
147 | 147 | $custom = array( |
148 | 148 | 'htmltable' => array( |
149 | - 'name' => __('HTML Table','lasso'), |
|
149 | + 'name' => __('HTML Table', 'lasso'), |
|
150 | 150 | 'content' => self::editus_html_table(), |
151 | 151 | ) |
152 | 152 | ); |
153 | - return array_merge( $array, $custom ); |
|
153 | + return array_merge($array, $custom); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
157 | 157 | function editus_toolbar_components_add_table( ) { |
158 | 158 | ?> |
159 | - <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
|
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 | } |
@@ -169,27 +169,27 @@ discard block |
||
169 | 169 | //table codes to be added |
170 | 170 | class editus_paragraph { |
171 | 171 | |
172 | - public function __construct(){ |
|
173 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
172 | + public function __construct() { |
|
173 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | function scripts() |
177 | 177 | { |
178 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | - add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
178 | + add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style')); |
|
179 | + add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1); |
|
180 | + add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10); |
|
181 | 181 | //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
182 | 182 | //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
183 | 183 | } |
184 | 184 | |
185 | - function editus_components_add_paragraph( $array ){ |
|
185 | + function editus_components_add_paragraph($array) { |
|
186 | 186 | $custom = array( |
187 | 187 | 'htmlparagraph' => array( |
188 | - 'name' => __('HTML Paragraph','lasso'), |
|
188 | + 'name' => __('HTML Paragraph', 'lasso'), |
|
189 | 189 | 'content' => self::editus_html_paragraph(), |
190 | 190 | ) |
191 | 191 | ); |
192 | - return array_merge( $array, $custom ); |
|
192 | + return array_merge($array, $custom); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | function editus_toolbar_components_add_paragraph( ) { |
215 | 215 | ?> |
216 | - <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
216 | + <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
217 | 217 | <?php |
218 | 218 | } |
219 | 219 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | if ( !is_user_logged_in() ) |
99 | 99 | return; |
100 | 100 | |
101 | - // check for lasso story engine and add a class doniting this |
|
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
101 | + // check for lasso story engine and add a class doniting this |
|
102 | + $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | 103 | |
104 | 104 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
105 | 105 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
111 | 111 | $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
112 | 112 | $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | 114 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
115 | 115 | $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
116 | 116 | $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
136 | 136 | $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
137 | 137 | |
138 | - $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
138 | + $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
139 | 139 | |
140 | 140 | // do we support pending status |
141 | 141 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | $insert_comp_ui = 'drag'; |
148 | 148 | } |
149 | 149 | |
150 | - $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
150 | + $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
151 | 151 | |
152 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
152 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
154 | 154 | |
155 | 155 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
156 | 156 |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | function __construct() { |
11 | 11 | |
12 | - add_action( 'admin_menu', array( $this, 'menu' ) ); |
|
13 | - add_action( 'network_admin_menu', array( $this, 'menu' ) ); |
|
14 | - add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) ); |
|
12 | + add_action('admin_menu', array($this, 'menu')); |
|
13 | + add_action('network_admin_menu', array($this, 'menu')); |
|
14 | + add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings')); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function menu() { |
24 | 24 | |
25 | 25 | // CHANGED Removed condition. |
26 | - add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) ); |
|
26 | + add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings')); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
48 | + if (!current_user_can('manage_options') || !is_user_logged_in()) |
|
49 | 49 | return; |
50 | 50 | |
51 | - if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
|
51 | + if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) { |
|
52 | 52 | |
53 | - $options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false; |
|
53 | + $options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false; |
|
54 | 54 | |
55 | 55 | $arr = $options['allowed_post_types']; |
56 | - $options = array_map( 'sanitize_text_field', $options ); |
|
57 | - $options['allowed_post_types'] = array_keys( $arr); |
|
56 | + $options = array_map('sanitize_text_field', $options); |
|
57 | + $options['allowed_post_types'] = array_keys($arr); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
61 | + if (function_exists('is_multisite') && is_multisite()) { |
|
62 | 62 | |
63 | - update_site_option( 'lasso_editor', $options ); |
|
63 | + update_site_option('lasso_editor', $options); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | |
67 | - update_option( 'lasso_editor', $options ); |
|
67 | + update_option('lasso_editor', $options); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | wp_send_json_success(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | - $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
|
83 | + $color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue); |
|
84 | 84 | |
85 | 85 | echo '<div lass="lasso-editor-settings--option-inner">'."\n"; |
86 | 86 | echo '<label>'.$title.'</label>'; |
@@ -95,45 +95,45 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function lasso_editor_settings_form() { |
97 | 97 | |
98 | - if ( !is_user_logged_in() ) |
|
98 | + if (!is_user_logged_in()) |
|
99 | 99 | return; |
100 | 100 | |
101 | 101 | // check for lasso story engine and add a class doniting this |
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | - |
|
104 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
105 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
106 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
107 | - |
|
108 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
109 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
110 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
111 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
112 | - $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
|
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
115 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
116 | - $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
|
117 | - |
|
118 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
119 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
120 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
121 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
122 | - $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
|
123 | - $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
|
102 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
103 | + |
|
104 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
105 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
106 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
107 | + |
|
108 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
109 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
110 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
111 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
112 | + $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
114 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
115 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
116 | + $enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor'); |
|
117 | + |
|
118 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
119 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
120 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
121 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
122 | + $toolbar_show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
|
123 | + $toolbar_show_alignment = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
|
124 | 124 | |
125 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
126 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
125 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
126 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
127 | 127 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
128 | 128 | $show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor'); |
129 | 129 | $save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
130 | 130 | |
131 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
132 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
131 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
132 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
133 | 133 | |
134 | 134 | $links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false); |
135 | - $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
|
136 | - $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
|
135 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b"); |
|
136 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i"); |
|
137 | 137 | |
138 | 138 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
139 | 139 | |
@@ -149,39 +149,39 @@ discard block |
||
149 | 149 | |
150 | 150 | $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
151 | 151 | |
152 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
152 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
153 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
154 | 154 | |
155 | - $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
|
155 | + $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
|
156 | 156 | |
157 | 157 | ?> |
158 | 158 | <div class="wrap"> |
159 | 159 | |
160 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
160 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
161 | 161 | |
162 | 162 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
163 | 163 | |
164 | - <?php do_action('lasso_settings_before');?> |
|
164 | + <?php do_action('lasso_settings_before'); ?> |
|
165 | 165 | |
166 | 166 | |
167 | 167 | |
168 | - <h3><?php _e( 'Enable for:', 'lasso' );?></h3> |
|
168 | + <h3><?php _e('Enable for:', 'lasso'); ?></h3> |
|
169 | 169 | <div class="lasso-editor-settings--option-wrap"> |
170 | 170 | <div class="lasso-editor-settings--option-inner"> |
171 | 171 | |
172 | - <span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span> |
|
172 | + <span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span> |
|
173 | 173 | <?php |
174 | 174 | $args = array( |
175 | 175 | 'public' => true |
176 | 176 | ); |
177 | 177 | |
178 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
179 | - $post_types = get_post_types( $args, 'objects' ); |
|
178 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
179 | + $post_types = get_post_types($args, 'objects'); |
|
180 | 180 | |
181 | - foreach ( $post_types as $post_type ) { |
|
181 | + foreach ($post_types as $post_type) { |
|
182 | 182 | if ($post_type->name == 'attachment') continue; |
183 | - $checked =""; |
|
184 | - if ( in_array( $post_type->name, $allowed_post_types ) ) { |
|
183 | + $checked = ""; |
|
184 | + if (in_array($post_type->name, $allowed_post_types)) { |
|
185 | 185 | $checked = 'checked="checked"'; |
186 | 186 | } |
187 | 187 | echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>'; |
@@ -191,126 +191,126 @@ discard block |
||
191 | 191 | </div> |
192 | 192 | |
193 | 193 | |
194 | - <h3><?php _e( 'Internal Settings', 'lasso' );?></h3> |
|
194 | + <h3><?php _e('Internal Settings', 'lasso'); ?></h3> |
|
195 | 195 | <div class="lasso-editor-settings--option-wrap"> |
196 | 196 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
197 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
198 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span> |
|
199 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
197 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
198 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span> |
|
199 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
200 | 200 | </div> |
201 | 201 | |
202 | 202 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
203 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
204 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span> |
|
205 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
203 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
204 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span> |
|
205 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
206 | 206 | </div> |
207 | 207 | |
208 | 208 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
209 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
210 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span> |
|
211 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
209 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
210 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span> |
|
211 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
212 | 212 | </div> |
213 | 213 | |
214 | 214 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
215 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
216 | - <span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span> |
|
217 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
215 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
216 | + <span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span> |
|
217 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
218 | 218 | </div> |
219 | 219 | |
220 | 220 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
221 | - <label><?php _e( 'Read Only Items', 'lasso' );?></label> |
|
222 | - <span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span> |
|
223 | - <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea> |
|
221 | + <label><?php _e('Read Only Items', 'lasso'); ?></label> |
|
222 | + <span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span> |
|
223 | + <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea> |
|
224 | 224 | </div> |
225 | 225 | |
226 | 226 | <div class="lasso-editor-settings--option-inner" > |
227 | - <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> > |
|
228 | - <label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label> |
|
229 | - <span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span> |
|
227 | + <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> > |
|
228 | + <label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label> |
|
229 | + <span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span> |
|
230 | 230 | </div> |
231 | 231 | </div> |
232 | 232 | |
233 | - <h3><?php _e( 'Editor UI', 'lasso' );?></h3> |
|
233 | + <h3><?php _e('Editor UI', 'lasso'); ?></h3> |
|
234 | 234 | <div class="lasso-editor-settings--option-wrap"> |
235 | 235 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
236 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> > |
|
237 | - <label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label> |
|
238 | - <span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span> |
|
236 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> > |
|
237 | + <label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label> |
|
238 | + <span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span> |
|
239 | 239 | </div> |
240 | 240 | <div id="lasso-editor-settings--colors"> |
241 | 241 | <?php |
242 | - self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff'); |
|
243 | - self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030'); |
|
244 | - self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055'); |
|
245 | - self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff'); |
|
242 | + self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff'); |
|
243 | + self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030'); |
|
244 | + self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055'); |
|
245 | + self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff'); |
|
246 | 246 | ?> |
247 | - <button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button> |
|
247 | + <button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button> |
|
248 | 248 | <div style="height:50px;"></div> |
249 | 249 | </div> |
250 | 250 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
251 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
252 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label> |
|
253 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span> |
|
251 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
252 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label> |
|
253 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span> |
|
254 | 254 | |
255 | 255 | </div> |
256 | 256 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
257 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> > |
|
258 | - <label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label> |
|
259 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span> |
|
257 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> > |
|
258 | + <label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label> |
|
259 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span> |
|
260 | 260 | |
261 | 261 | </div> |
262 | 262 | |
263 | 263 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
264 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> > |
|
265 | - <label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label> |
|
266 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span> |
|
264 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> > |
|
265 | + <label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label> |
|
266 | + <span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span> |
|
267 | 267 | </div> |
268 | 268 | |
269 | 269 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
270 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> > |
|
271 | - <label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label> |
|
272 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span> |
|
270 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> > |
|
271 | + <label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label> |
|
272 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span> |
|
273 | 273 | |
274 | 274 | </div> |
275 | 275 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
276 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> > |
|
277 | - <label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label> |
|
278 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span> |
|
276 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> > |
|
277 | + <label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label> |
|
278 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span> |
|
279 | 279 | |
280 | 280 | </div> |
281 | 281 | |
282 | 282 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
283 | - <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> > |
|
284 | - <label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label> |
|
285 | - <span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span> |
|
283 | + <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> > |
|
284 | + <label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label> |
|
285 | + <span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span> |
|
286 | 286 | |
287 | 287 | </div> |
288 | 288 | <div class="lasso-editor-settings--option-inner"> |
289 | - <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label> |
|
290 | - <span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span> |
|
289 | + <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label> |
|
290 | + <span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span> |
|
291 | 291 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
292 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?> |
|
292 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?> |
|
293 | 293 | </div> |
294 | 294 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
295 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?> |
|
295 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?> |
|
296 | 296 | </div> |
297 | 297 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
298 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?> |
|
298 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?> |
|
299 | 299 | </div> |
300 | 300 | </div> |
301 | 301 | |
302 | 302 | </div> |
303 | 303 | |
304 | - <h3><?php _e( 'Component', 'lasso' );?></h3> |
|
304 | + <h3><?php _e('Component', 'lasso'); ?></h3> |
|
305 | 305 | <div class="lasso-editor-settings--option-wrap" style="border:none;" > |
306 | 306 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
307 | - <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> > |
|
308 | - <label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label> |
|
309 | - <span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span> |
|
307 | + <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> > |
|
308 | + <label for="lasso_editor[add_table]"><?php _e('Additional Component: Table', 'lasso'); ?></label> |
|
309 | + <span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span> |
|
310 | 310 | |
311 | 311 | </div> |
312 | 312 | |
313 | - <?php if ( 'ase-active' != $ase_status ) { ?> |
|
313 | + <?php if ('ase-active' != $ase_status) { ?> |
|
314 | 314 | <script> |
315 | 315 | $(document).ready(function(){ |
316 | 316 | $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){ |
@@ -336,137 +336,137 @@ discard block |
||
336 | 336 | </script> |
337 | 337 | |
338 | 338 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
339 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> > |
|
340 | - <label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label> |
|
341 | - <span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span> |
|
339 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> > |
|
340 | + <label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label> |
|
341 | + <span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span> |
|
342 | 342 | |
343 | 343 | </div> |
344 | 344 | |
345 | 345 | |
346 | 346 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
347 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked( $use_wp_block_image, 'on' );?> > |
|
348 | - <label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label> |
|
349 | - <span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span> |
|
347 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked($use_wp_block_image, 'on'); ?> > |
|
348 | + <label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label> |
|
349 | + <span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span> |
|
350 | 350 | |
351 | 351 | </div> |
352 | 352 | <?php }?> |
353 | 353 | </div> |
354 | 354 | |
355 | 355 | |
356 | - <h3><?php _e( 'Post Settings UI', 'lasso' );?></h3> |
|
356 | + <h3><?php _e('Post Settings UI', 'lasso'); ?></h3> |
|
357 | 357 | <div class="lasso-editor-settings--option-wrap" > |
358 | 358 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
359 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
360 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
361 | - <span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span> |
|
359 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
360 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
361 | + <span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span> |
|
362 | 362 | </div> |
363 | 363 | |
364 | 364 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
365 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> > |
|
366 | - <label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label> |
|
367 | - <span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span> |
|
365 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> > |
|
366 | + <label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label> |
|
367 | + <span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span> |
|
368 | 368 | </div> |
369 | 369 | |
370 | 370 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
371 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> > |
|
372 | - <label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label> |
|
373 | - <span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span> |
|
371 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> > |
|
372 | + <label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label> |
|
373 | + <span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span> |
|
374 | 374 | </div> |
375 | 375 | |
376 | 376 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
377 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> > |
|
378 | - <label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label> |
|
379 | - <span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span> |
|
377 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> > |
|
378 | + <label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label> |
|
379 | + <span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span> |
|
380 | 380 | </div> |
381 | 381 | |
382 | 382 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
383 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> > |
|
384 | - <label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label> |
|
385 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span> |
|
383 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> > |
|
384 | + <label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label> |
|
385 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span> |
|
386 | 386 | </div> |
387 | 387 | |
388 | 388 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
389 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> > |
|
390 | - <label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label> |
|
391 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span> |
|
389 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> > |
|
390 | + <label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label> |
|
391 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span> |
|
392 | 392 | </div> |
393 | 393 | |
394 | 394 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
395 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
396 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
397 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span> |
|
395 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
396 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
397 | + <span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span> |
|
398 | 398 | </div> |
399 | 399 | |
400 | 400 | <div class="lasso-editor-settings--option-inner" > |
401 | - <input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked( $support_custom_taxonomy, 'on' );?> > |
|
402 | - <label for="lasso_editor[support_custom_taxonomy]"><?php _e( 'Support Custom Taxonomy', 'lasso' );?></label> |
|
403 | - <span class="lasso--setting-description"><?php _e( 'Allow editing custom taxonomies, if any available.', 'lasso' );?></span> |
|
401 | + <input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked($support_custom_taxonomy, 'on'); ?> > |
|
402 | + <label for="lasso_editor[support_custom_taxonomy]"><?php _e('Support Custom Taxonomy', 'lasso'); ?></label> |
|
403 | + <span class="lasso--setting-description"><?php _e('Allow editing custom taxonomies, if any available.', 'lasso'); ?></span> |
|
404 | 404 | </div> |
405 | 405 | |
406 | 406 | |
407 | 407 | </div> |
408 | 408 | |
409 | - <h3><?php _e( 'Misc', 'lasso' );?></h3> |
|
409 | + <h3><?php _e('Misc', 'lasso'); ?></h3> |
|
410 | 410 | <div class="lasso-editor-settings--option-wrap"> |
411 | 411 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
412 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> > |
|
413 | - <label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label> |
|
414 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span> |
|
412 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> > |
|
413 | + <label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label> |
|
414 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span> |
|
415 | 415 | </div> |
416 | 416 | |
417 | 417 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
418 | - <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label> |
|
419 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span> |
|
420 | - <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b |
|
421 | - <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong |
|
418 | + <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label> |
|
419 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span> |
|
420 | + <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b |
|
421 | + <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong |
|
422 | 422 | </div> |
423 | 423 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
424 | - <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label> |
|
425 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span> |
|
426 | - <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i |
|
427 | - <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em |
|
424 | + <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label> |
|
425 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span> |
|
426 | + <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i |
|
427 | + <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em |
|
428 | 428 | </div> |
429 | 429 | <div class="lasso-editor-settings--option-inner" > |
430 | - <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> > |
|
431 | - <label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label> |
|
432 | - <span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span> |
|
430 | + <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> > |
|
431 | + <label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label> |
|
432 | + <span class="lasso--setting-description"><?php _e('When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso'); ?></span> |
|
433 | 433 | </div> |
434 | 434 | </div> |
435 | 435 | |
436 | - <h3><?php _e( 'Advanced Options', 'lasso' );?></h3> |
|
437 | - <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span> |
|
436 | + <h3><?php _e('Advanced Options', 'lasso'); ?></h3> |
|
437 | + <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span> |
|
438 | 438 | <span class="lasso--setting-description"> </span> |
439 | 439 | <div class="lasso-editor-settings--option-wrap "> |
440 | 440 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
441 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
442 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
443 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
441 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
442 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
443 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
444 | 444 | </div> |
445 | 445 | |
446 | 446 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
447 | - <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> > |
|
448 | - <label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label> |
|
449 | - <span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span> |
|
447 | + <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> > |
|
448 | + <label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label> |
|
449 | + <span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span> |
|
450 | 450 | </div> |
451 | 451 | |
452 | 452 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
453 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> > |
|
454 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
455 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span> |
|
453 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> > |
|
454 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
455 | + <span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span> |
|
456 | 456 | |
457 | 457 | </div> |
458 | 458 | |
459 | 459 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
460 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> > |
|
461 | - <label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label> |
|
462 | - <span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span> |
|
460 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> > |
|
461 | + <label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label> |
|
462 | + <span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span> |
|
463 | 463 | |
464 | 464 | </div> |
465 | 465 | |
466 | 466 | <div class="lasso-editor-settings--option-inner"> |
467 | - <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> > |
|
468 | - <label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label> |
|
469 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span> |
|
467 | + <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> > |
|
468 | + <label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label> |
|
469 | + <span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span> |
|
470 | 470 | |
471 | 471 | </div> |
472 | 472 | </div> |
@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | |
477 | 477 | <div class="lasso-editor-settings--submit"> |
478 | 478 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
479 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
480 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
479 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
480 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
481 | 481 | </div> |
482 | 482 | |
483 | - <?php do_action('lasso_settings_after');?> |
|
483 | + <?php do_action('lasso_settings_after'); ?> |
|
484 | 484 | </form> |
485 | 485 | |
486 | 486 | </div><?php |