@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
| 61 | 61 | add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
| 62 | - add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
| 62 | + add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
| 63 | 63 | add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
| 64 | 64 | add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
| 65 | 65 | add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
@@ -69,19 +69,19 @@ discard block |
||
| 69 | 69 | add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
| 70 | 70 | add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
| 71 | 71 | |
| 72 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
| 72 | + add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
| 73 | 73 | |
| 74 | - add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
| 75 | - add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
| 74 | + add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
| 75 | + add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
| 76 | 76 | |
| 77 | 77 | // enable saving custom fields through REST API |
| 78 | 78 | self::enable_metasave('post'); |
| 79 | 79 | self::enable_metasave('page'); |
| 80 | 80 | |
| 81 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
| 81 | + $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
| 82 | 82 | $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
| 83 | - foreach ( $allowed_post_types as $post_type ) { |
|
| 84 | - self::enable_metasave($post_type); |
|
| 83 | + foreach ( $allowed_post_types as $post_type ) { |
|
| 84 | + self::enable_metasave($post_type); |
|
| 85 | 85 | } |
| 86 | 86 | //enqueue assets |
| 87 | 87 | new assets(); |
@@ -278,14 +278,14 @@ discard block |
||
| 278 | 278 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - // new ajax function to lock post for editing |
|
| 281 | + // new ajax function to lock post for editing |
|
| 282 | 282 | public function editus_lock_post() |
| 283 | 283 | { |
| 284 | 284 | $post_id= $_POST["postid"]; |
| 285 | 285 | $locked = wp_check_post_lock($post_id); |
| 286 | 286 | |
| 287 | 287 | if (!$locked) { |
| 288 | - wp_set_post_lock($post_id); |
|
| 288 | + wp_set_post_lock($post_id); |
|
| 289 | 289 | echo "true"; |
| 290 | 290 | } else { |
| 291 | 291 | $user_info = get_userdata($locked); |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | { |
| 299 | 299 | $post_id= $_POST["postid"]; |
| 300 | 300 | $locked = wp_check_post_lock($post_id); |
| 301 | - if (!$locked) { |
|
| 302 | - delete_post_meta( $post_id, '_edit_lock'); |
|
| 303 | - } |
|
| 301 | + if (!$locked) { |
|
| 302 | + delete_post_meta( $post_id, '_edit_lock'); |
|
| 303 | + } |
|
| 304 | 304 | echo "true"; |
| 305 | 305 | |
| 306 | 306 | exit; |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | $status = isset( $data['status'] ) ? $data['status'] : false; |
| 329 | 329 | $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
| 330 | 330 | $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
| 331 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
| 331 | + $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
| 332 | 332 | |
| 333 | 333 | |
| 334 | 334 | $args = array( |
| 335 | 335 | 'ID' => (int) $postid, |
| 336 | 336 | 'post_name' => $slug, |
| 337 | 337 | 'post_status' => $status, |
| 338 | - 'post_excerpt' => wp_strip_all_tags($excerpt,true) |
|
| 338 | + 'post_excerpt' => wp_strip_all_tags($excerpt,true) |
|
| 339 | 339 | ); |
| 340 | 340 | |
| 341 | 341 | |
@@ -410,12 +410,12 @@ discard block |
||
| 410 | 410 | exit; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - public function editus_do_block() |
|
| 413 | + public function editus_do_block() |
|
| 414 | 414 | { |
| 415 | 415 | |
| 416 | 416 | $code= $_POST["code"]; |
| 417 | 417 | |
| 418 | - $out = do_blocks( $code ); |
|
| 418 | + $out = do_blocks( $code ); |
|
| 419 | 419 | |
| 420 | 420 | echo $out; |
| 421 | 421 | exit; |
@@ -434,67 +434,67 @@ discard block |
||
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | if ($code == "aesop_video") { |
| 437 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 438 | - echo aesop_video_shortcode($atts); |
|
| 437 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 438 | + echo aesop_video_shortcode($atts); |
|
| 439 | 439 | } |
| 440 | 440 | else if ($code == "aesop_image") { |
| 441 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 442 | - echo aesop_image_shortcode($atts); |
|
| 441 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 442 | + echo aesop_image_shortcode($atts); |
|
| 443 | 443 | } |
| 444 | 444 | else if ($code == "aesop_quote") { |
| 445 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 446 | - echo aesop_quote_shortcode($atts); |
|
| 445 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 446 | + echo aesop_quote_shortcode($atts); |
|
| 447 | 447 | } |
| 448 | 448 | else if ($code == "aesop_parallax") { |
| 449 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 450 | - echo aesop_parallax_shortcode($atts); |
|
| 449 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 450 | + echo aesop_parallax_shortcode($atts); |
|
| 451 | 451 | } |
| 452 | 452 | else if ($code == "aesop_character") { |
| 453 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 454 | - echo aesop_character_shortcode($atts); |
|
| 453 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 454 | + echo aesop_character_shortcode($atts); |
|
| 455 | 455 | } |
| 456 | 456 | else if ($code == "aesop_collection") { |
| 457 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 458 | - echo aesop_collection_shortcode($atts); |
|
| 457 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 458 | + echo aesop_collection_shortcode($atts); |
|
| 459 | 459 | } |
| 460 | 460 | else if ($code == "aesop_chapter") { |
| 461 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 462 | - echo aesop_chapter_shortcode($atts); |
|
| 461 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 462 | + echo aesop_chapter_shortcode($atts); |
|
| 463 | 463 | } |
| 464 | 464 | else if ($code == "aesop_content") { |
| 465 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 466 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 465 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 466 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 467 | 467 | } |
| 468 | 468 | else if ($code == "aesop_gallery") { |
| 469 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 470 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 469 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 470 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 471 | 471 | } |
| 472 | 472 | else if ($code == "aesop_audio") { |
| 473 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 474 | - echo aesop_audio_shortcode($atts); |
|
| 473 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 474 | + echo aesop_audio_shortcode($atts); |
|
| 475 | 475 | } |
| 476 | 476 | else if ($code == "aesop_document") { |
| 477 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 478 | - echo aesop_document_shortcode($atts); |
|
| 477 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 478 | + echo aesop_document_shortcode($atts); |
|
| 479 | 479 | } |
| 480 | 480 | else if ($code == "aesop_timeline_stop") { |
| 481 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
| 482 | - echo aesop_timeline_stop_shortcode($atts); |
|
| 481 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
| 482 | + echo aesop_timeline_stop_shortcode($atts); |
|
| 483 | 483 | } |
| 484 | - /*else if ($code == "aesop_content") { |
|
| 484 | + /*else if ($code == "aesop_content") { |
|
| 485 | 485 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php'); |
| 486 | 486 | echo aesop_content_shortcode($atts); |
| 487 | 487 | }*/ |
| 488 | - else if ($code == "aesop_wpimg") { |
|
| 489 | - self::wpimg($atts); |
|
| 488 | + else if ($code == "aesop_wpimg") { |
|
| 489 | + self::wpimg($atts); |
|
| 490 | 490 | } |
| 491 | 491 | else if ($code == "aesop_wpimg-block") { |
| 492 | - self::wpimg_block($atts); |
|
| 492 | + self::wpimg_block($atts); |
|
| 493 | 493 | } |
| 494 | 494 | else { |
| 495 | 495 | $code = '['.$code.' '; |
| 496 | 496 | foreach ($atts as $key => $value) { |
| 497 | - $code = ''.$key.'="'.$value.'" '; |
|
| 497 | + $code = ''.$key.'="'.$value.'" '; |
|
| 498 | 498 | } |
| 499 | 499 | $code = $code.']'; |
| 500 | 500 | echo do_shortcode($code); |
@@ -503,102 +503,102 @@ discard block |
||
| 503 | 503 | exit; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | - public static function wpimg($atts) { |
|
| 506 | + public static function wpimg($atts) { |
|
| 507 | 507 | |
| 508 | - echo '<figure data-component-type="wpimg"'; |
|
| 508 | + echo '<figure data-component-type="wpimg"'; |
|
| 509 | 509 | |
| 510 | - $extra = ""; |
|
| 510 | + $extra = ""; |
|
| 511 | 511 | |
| 512 | - // try to use srcset and sizes on new WP installs |
|
| 512 | + // try to use srcset and sizes on new WP installs |
|
| 513 | 513 | if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
| 514 | 514 | $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
| 515 | 515 | $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
| 516 | - $extra = "srcset='$srcset' sizes='$sizes' "; |
|
| 517 | - } |
|
| 518 | - if ($atts['align']=="left") { |
|
| 519 | - $extra .= 'class="alignleft'; |
|
| 520 | - } else if ($atts['align']=="right") { |
|
| 521 | - $extra .= 'class="alignright'; |
|
| 522 | - } else { |
|
| 523 | - $extra .= 'class="aligncenter'; |
|
| 524 | - } |
|
| 525 | - if ($atts['imgwidth'] || $atts['imgheight']) { |
|
| 526 | - if ($atts['imgwidth']) { |
|
| 527 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
| 528 | - } |
|
| 529 | - if ($atts['imgheight']) { |
|
| 530 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
| 531 | - } |
|
| 516 | + $extra = "srcset='$srcset' sizes='$sizes' "; |
|
| 517 | + } |
|
| 518 | + if ($atts['align']=="left") { |
|
| 519 | + $extra .= 'class="alignleft'; |
|
| 520 | + } else if ($atts['align']=="right") { |
|
| 521 | + $extra .= 'class="alignright'; |
|
| 522 | + } else { |
|
| 523 | + $extra .= 'class="aligncenter'; |
|
| 524 | + } |
|
| 525 | + if ($atts['imgwidth'] || $atts['imgheight']) { |
|
| 526 | + if ($atts['imgwidth']) { |
|
| 527 | + $extra .= 'width:'. $atts['imgwidth'].';'; |
|
| 528 | + } |
|
| 529 | + if ($atts['imgheight']) { |
|
| 530 | + $extra .= 'height:'. $atts['imgheight'].';'; |
|
| 531 | + } |
|
| 532 | 532 | |
| 533 | - } |
|
| 534 | - $extra .= '"'; |
|
| 533 | + } |
|
| 534 | + $extra .= '"'; |
|
| 535 | 535 | |
| 536 | - foreach ($atts as $key => $value) { |
|
| 536 | + foreach ($atts as $key => $value) { |
|
| 537 | 537 | echo ' data-'.$key.'="'.$value.'"'; |
| 538 | 538 | } |
| 539 | - //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
| 540 | - echo ' class="wp-caption lasso-component">'; |
|
| 541 | - $hrefset = false; |
|
| 542 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
| 543 | - { |
|
| 544 | - echo '<a href="' . $atts['link'] . '">'; |
|
| 545 | - $hrefset = true; |
|
| 546 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
| 547 | - echo '<a href="' . $atts['img'] . '">'; |
|
| 548 | - $hrefset = true; |
|
| 549 | - } |
|
| 550 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
| 551 | - if ($hrefset) |
|
| 552 | - { |
|
| 553 | - echo '</a>'; |
|
| 554 | - } |
|
| 555 | - if ($atts['caption']) |
|
| 556 | - { |
|
| 557 | - echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
| 558 | - } |
|
| 559 | - echo '</figure>'; |
|
| 560 | - echo '<p><br></p>'; |
|
| 561 | - return; |
|
| 562 | - } |
|
| 539 | + //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
| 540 | + echo ' class="wp-caption lasso-component">'; |
|
| 541 | + $hrefset = false; |
|
| 542 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
| 543 | + { |
|
| 544 | + echo '<a href="' . $atts['link'] . '">'; |
|
| 545 | + $hrefset = true; |
|
| 546 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
| 547 | + echo '<a href="' . $atts['img'] . '">'; |
|
| 548 | + $hrefset = true; |
|
| 549 | + } |
|
| 550 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
| 551 | + if ($hrefset) |
|
| 552 | + { |
|
| 553 | + echo '</a>'; |
|
| 554 | + } |
|
| 555 | + if ($atts['caption']) |
|
| 556 | + { |
|
| 557 | + echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
| 558 | + } |
|
| 559 | + echo '</figure>'; |
|
| 560 | + echo '<p><br></p>'; |
|
| 561 | + return; |
|
| 562 | + } |
|
| 563 | 563 | |
| 564 | 564 | public static function wpimg_block($atts) { |
| 565 | 565 | $imgextra = ''; |
| 566 | 566 | if (!empty($atts['id'])) { |
| 567 | 567 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
| 568 | 568 | } |
| 569 | - $figclass = 'aligncenter'; |
|
| 570 | - if ($atts['align']=="left") { |
|
| 571 | - $figclass = 'alignleft'; |
|
| 572 | - } else if ($atts['align']=="right") { |
|
| 573 | - $figclass = 'alignright'; |
|
| 574 | - } else { |
|
| 575 | - $figclass = 'aligncenter'; |
|
| 576 | - } |
|
| 569 | + $figclass = 'aligncenter'; |
|
| 570 | + if ($atts['align']=="left") { |
|
| 571 | + $figclass = 'alignleft'; |
|
| 572 | + } else if ($atts['align']=="right") { |
|
| 573 | + $figclass = 'alignright'; |
|
| 574 | + } else { |
|
| 575 | + $figclass = 'aligncenter'; |
|
| 576 | + } |
|
| 577 | 577 | |
| 578 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
| 579 | - echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
| 580 | - echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; |
|
| 581 | - } else { |
|
| 582 | - echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">'; |
|
| 583 | - } |
|
| 584 | - if (!empty($atts['link'])) { |
|
| 585 | - echo '<a href="'.$atts['link'].'">'; |
|
| 586 | - } |
|
| 587 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
| 588 | - if ($atts['caption']) |
|
| 589 | - { |
|
| 590 | - echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
| 591 | - } |
|
| 592 | - if (!empty($atts['link'])) { |
|
| 593 | - echo '</a>'; |
|
| 594 | - } |
|
| 595 | - echo '</figure>'; |
|
| 596 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
| 597 | - echo '</div>'; |
|
| 598 | - } |
|
| 599 | - echo '<p><br></p>'; |
|
| 600 | - return; |
|
| 601 | - } |
|
| 578 | + if ($atts['align']=="left" || $atts['align']=="right") { |
|
| 579 | + echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
| 580 | + echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; |
|
| 581 | + } else { |
|
| 582 | + echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">'; |
|
| 583 | + } |
|
| 584 | + if (!empty($atts['link'])) { |
|
| 585 | + echo '<a href="'.$atts['link'].'">'; |
|
| 586 | + } |
|
| 587 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
| 588 | + if ($atts['caption']) |
|
| 589 | + { |
|
| 590 | + echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
| 591 | + } |
|
| 592 | + if (!empty($atts['link'])) { |
|
| 593 | + echo '</a>'; |
|
| 594 | + } |
|
| 595 | + echo '</figure>'; |
|
| 596 | + if ($atts['align']=="left" || $atts['align']=="right") { |
|
| 597 | + echo '</div>'; |
|
| 598 | + } |
|
| 599 | + echo '<p><br></p>'; |
|
| 600 | + return; |
|
| 601 | + } |
|
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | public function get_ase_options() |
@@ -634,12 +634,12 @@ discard block |
||
| 634 | 634 | exit; |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 638 | - public function on_publish_post( ) { |
|
| 637 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 638 | + public function on_publish_post( ) { |
|
| 639 | 639 | |
| 640 | 640 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 641 | 641 | |
| 642 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 642 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 643 | 643 | |
| 644 | 644 | exit; |
| 645 | 645 | } |
@@ -697,14 +697,14 @@ discard block |
||
| 697 | 697 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
| 698 | 698 | |
| 699 | 699 | if ($taxonomy =='category') { |
| 700 | - // convert from names to category ids |
|
| 700 | + // convert from names to category ids |
|
| 701 | 701 | $cats = array(); |
| 702 | 702 | foreach ($value as $cat) { |
| 703 | 703 | $cat_id = get_cat_ID($cat); |
| 704 | 704 | if ($cat_id !=0) { |
| 705 | 705 | $cats [] = $cat_id; |
| 706 | 706 | } else if ($allow_new_category) { |
| 707 | - $cats [] = wp_create_category($cat); |
|
| 707 | + $cats [] = wp_create_category($cat); |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | $value = $cats; |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | - public function create_gallery( ) { |
|
| 727 | + public function create_gallery( ) { |
|
| 728 | 728 | |
| 729 | 729 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 730 | 730 | |
@@ -778,10 +778,10 @@ discard block |
||
| 778 | 778 | 'message' => 'gallery-created', |
| 779 | 779 | 'id' => $postid) |
| 780 | 780 | ); |
| 781 | - exit; |
|
| 781 | + exit; |
|
| 782 | 782 | } |
| 783 | 783 | |
| 784 | - public function update_gallery( ) { |
|
| 784 | + public function update_gallery( ) { |
|
| 785 | 785 | |
| 786 | 786 | $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
| 787 | 787 | |
@@ -797,12 +797,12 @@ discard block |
||
| 797 | 797 | |
| 798 | 798 | self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
| 799 | 799 | |
| 800 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
| 800 | + echo json_encode( array('message' => 'gallery-updated') ); |
|
| 801 | 801 | |
| 802 | - exit; |
|
| 802 | + exit; |
|
| 803 | 803 | } |
| 804 | 804 | |
| 805 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 805 | + public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 806 | 806 | |
| 807 | 807 | // gallery width |
| 808 | 808 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | public function set_date( $postid, $value) { |
| 887 | 887 | if( $value ) { |
| 888 | 888 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
| 889 | - wp_update_post( |
|
| 889 | + wp_update_post( |
|
| 890 | 890 | array ( |
| 891 | 891 | 'ID' => $postid, // ID of the post to update |
| 892 | 892 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | height: 42px; |
| 115 | 115 | } |
| 116 | 116 | <?php |
| 117 | - } |
|
| 117 | + } |
|
| 118 | 118 | } else { |
| 119 | 119 | ?> |
| 120 | 120 | |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | <?php |
| 126 | - } |
|
| 127 | - ?> |
|
| 126 | + } |
|
| 127 | + ?> |
|
| 128 | 128 | </style> |
| 129 | 129 | <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" > |
| 130 | 130 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
| 242 | 242 | |
| 243 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
| 243 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
| 244 | 244 | |
| 245 | 245 | ?> |
| 246 | 246 | <div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" style="display:none;"> |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | function lasso_editor_text_toolbar() { |
| 299 | 299 | |
| 300 | 300 | ob_start(); |
| 301 | - $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
| 301 | + $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
| 302 | 302 | |
| 303 | 303 | |
| 304 | 304 | $is_mobile = wp_is_mobile(); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
| 318 | 318 | |
| 319 | 319 | // mobile styles |
| 320 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
| 320 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
| 321 | 321 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
| 322 | 322 | |
| 323 | 323 | //show color |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
| 334 | 334 | |
| 335 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
| 335 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
| 336 | 336 | |
| 337 | 337 | ?> |
| 338 | 338 | <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | |
| 557 | 557 | //editor options |
| 558 | 558 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
| 559 | - $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
| 559 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
| 560 | 560 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
| 561 | 561 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
| 562 | 562 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | // do we support pending status |
| 578 | 578 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
| 579 | 579 | |
| 580 | - $excerpt = $post->post_excerpt; |
|
| 580 | + $excerpt = $post->post_excerpt; |
|
| 581 | 581 | |
| 582 | 582 | ?> |
| 583 | 583 | <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | }?> |
| 675 | 675 | <?php |
| 676 | 676 | if ($allow_change_date) { |
| 677 | - $dateformat = get_option( 'date_format' ); |
|
| 677 | + $dateformat = get_option( 'date_format' ); |
|
| 678 | 678 | ?> |
| 679 | 679 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
| 680 | 680 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -768,8 +768,8 @@ discard block |
||
| 768 | 768 | $types = lasso_post_types_names(); |
| 769 | 769 | if ( !empty( $types ) ) { |
| 770 | 770 | foreach( $types as $name => $label ) |
| 771 | - { |
|
| 772 | - $type = $name; |
|
| 771 | + { |
|
| 772 | + $type = $name; |
|
| 773 | 773 | //$type = preg_replace( '/s\b/','', $name ); |
| 774 | 774 | if ($type == 'page' && !current_user_can('edit_pages')) { |
| 775 | 775 | continue; |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | if ( !empty( $types ) ) { |
| 792 | 792 | // get the first element |
| 793 | 793 | $keys = array_keys($types); |
| 794 | - $type =$keys[0]; |
|
| 794 | + $type =$keys[0]; |
|
| 795 | 795 | //$type = preg_replace( '/s\b/','', $type ); |
| 796 | 796 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
| 797 | 797 | } |
@@ -819,8 +819,8 @@ discard block |
||
| 819 | 819 | global $post; |
| 820 | 820 | |
| 821 | 821 | global $wp_post_types; |
| 822 | - $labels = &$wp_post_types['post']->labels; |
|
| 823 | - $labels->name = 'Articles'; |
|
| 822 | + $labels = &$wp_post_types['post']->labels; |
|
| 823 | + $labels->name = 'Articles'; |
|
| 824 | 824 | |
| 825 | 825 | ob_start(); |
| 826 | 826 | |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | ob_start(); |
| 881 | 881 | |
| 882 | 882 | |
| 883 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
| 883 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
| 884 | 884 | |
| 885 | 885 | // let users add custom css classes |
| 886 | 886 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -982,10 +982,10 @@ discard block |
||
| 982 | 982 | function lasso_editor_options_blob() { |
| 983 | 983 | |
| 984 | 984 | $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
| 985 | - $codes = add_wpimg_options( $codes ); |
|
| 985 | + $codes = add_wpimg_options( $codes ); |
|
| 986 | 986 | $codes = add_wpimg_block_options( $codes ); |
| 987 | 987 | $codes = add_wpcover_block_options( $codes ); |
| 988 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
| 988 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
| 989 | 989 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
| 990 | 990 | |
| 991 | 991 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -1087,9 +1087,9 @@ discard block |
||
| 1087 | 1087 | $return .= '</form>'; |
| 1088 | 1088 | |
| 1089 | 1089 | // extra JS codes |
| 1090 | - if (isset($shortcode['codes'])) { |
|
| 1091 | - $return .= $shortcode['codes']; |
|
| 1092 | - } |
|
| 1090 | + if (isset($shortcode['codes'])) { |
|
| 1091 | + $return .= $shortcode['codes']; |
|
| 1092 | + } |
|
| 1093 | 1093 | $blob[$slug] = $return; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
@@ -1098,95 +1098,95 @@ discard block |
||
| 1098 | 1098 | |
| 1099 | 1099 | |
| 1100 | 1100 | function add_wpimg_options( $shortcodes ) { |
| 1101 | - $custom = array( |
|
| 1102 | - 'wpimg' => array( |
|
| 1103 | - 'name' => __( 'Image', 'lasso' ), |
|
| 1104 | - 'type' => 'single', |
|
| 1105 | - 'atts' => array( |
|
| 1106 | - 'img' => array( |
|
| 1107 | - 'type' => 'media_upload', |
|
| 1108 | - 'default' => '', |
|
| 1109 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1110 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1111 | - ), |
|
| 1112 | - 'align' => array( |
|
| 1113 | - 'type' => 'select', |
|
| 1114 | - 'values' => array( |
|
| 1115 | - array( |
|
| 1116 | - 'value' => 'center', |
|
| 1117 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 1118 | - ), |
|
| 1119 | - array( |
|
| 1120 | - 'value' => 'left', |
|
| 1121 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 1122 | - ), |
|
| 1123 | - array( |
|
| 1124 | - 'value' => 'right', |
|
| 1125 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1126 | - ), |
|
| 1127 | - ), |
|
| 1128 | - 'default' => 'center', |
|
| 1129 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1130 | - 'tip'=>'' |
|
| 1131 | - ), |
|
| 1101 | + $custom = array( |
|
| 1102 | + 'wpimg' => array( |
|
| 1103 | + 'name' => __( 'Image', 'lasso' ), |
|
| 1104 | + 'type' => 'single', |
|
| 1105 | + 'atts' => array( |
|
| 1106 | + 'img' => array( |
|
| 1107 | + 'type' => 'media_upload', |
|
| 1108 | + 'default' => '', |
|
| 1109 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1110 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1111 | + ), |
|
| 1112 | + 'align' => array( |
|
| 1113 | + 'type' => 'select', |
|
| 1114 | + 'values' => array( |
|
| 1115 | + array( |
|
| 1116 | + 'value' => 'center', |
|
| 1117 | + 'name' => __( 'Center', 'aesop-core' ) |
|
| 1118 | + ), |
|
| 1119 | + array( |
|
| 1120 | + 'value' => 'left', |
|
| 1121 | + 'name' => __( 'Left', 'aesop-core' ) |
|
| 1122 | + ), |
|
| 1123 | + array( |
|
| 1124 | + 'value' => 'right', |
|
| 1125 | + 'name' => __( 'Right', 'aesop-core' ) |
|
| 1126 | + ), |
|
| 1127 | + ), |
|
| 1128 | + 'default' => 'center', |
|
| 1129 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1130 | + 'tip'=>'' |
|
| 1131 | + ), |
|
| 1132 | 1132 | |
| 1133 | - 'imgwidth' => array( |
|
| 1134 | - 'type' => 'text_small', |
|
| 1135 | - 'default' => '300px', |
|
| 1136 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
| 1137 | - 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
| 1138 | - ), |
|
| 1139 | - 'imgheight' => array( |
|
| 1140 | - 'type' => 'text_small', |
|
| 1141 | - 'default' => '', |
|
| 1142 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
| 1143 | - 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
| 1144 | - ), |
|
| 1145 | - 'linkoption' => array( |
|
| 1146 | - 'type' => 'select', |
|
| 1147 | - 'values' => array( |
|
| 1148 | - array( |
|
| 1149 | - 'value' => 'none', |
|
| 1150 | - 'name' => __( 'None', 'aesop-core' ) |
|
| 1151 | - ), |
|
| 1152 | - array( |
|
| 1153 | - 'value' => 'img', |
|
| 1154 | - 'name' => __( 'Image', 'aesop-core' ) |
|
| 1155 | - ), |
|
| 1156 | - array( |
|
| 1157 | - 'value' => 'url', |
|
| 1158 | - 'name' => __( 'URL', 'aesop-core' ) |
|
| 1159 | - ), |
|
| 1160 | - ), |
|
| 1161 | - 'default' => 'none', |
|
| 1162 | - 'desc' => __( 'Link', 'lasso' ), |
|
| 1163 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
| 1164 | - ), |
|
| 1133 | + 'imgwidth' => array( |
|
| 1134 | + 'type' => 'text_small', |
|
| 1135 | + 'default' => '300px', |
|
| 1136 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
| 1137 | + 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
| 1138 | + ), |
|
| 1139 | + 'imgheight' => array( |
|
| 1140 | + 'type' => 'text_small', |
|
| 1141 | + 'default' => '', |
|
| 1142 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
| 1143 | + 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
| 1144 | + ), |
|
| 1145 | + 'linkoption' => array( |
|
| 1146 | + 'type' => 'select', |
|
| 1147 | + 'values' => array( |
|
| 1148 | + array( |
|
| 1149 | + 'value' => 'none', |
|
| 1150 | + 'name' => __( 'None', 'aesop-core' ) |
|
| 1151 | + ), |
|
| 1152 | + array( |
|
| 1153 | + 'value' => 'img', |
|
| 1154 | + 'name' => __( 'Image', 'aesop-core' ) |
|
| 1155 | + ), |
|
| 1156 | + array( |
|
| 1157 | + 'value' => 'url', |
|
| 1158 | + 'name' => __( 'URL', 'aesop-core' ) |
|
| 1159 | + ), |
|
| 1160 | + ), |
|
| 1161 | + 'default' => 'none', |
|
| 1162 | + 'desc' => __( 'Link', 'lasso' ), |
|
| 1163 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
| 1164 | + ), |
|
| 1165 | 1165 | |
| 1166 | - 'link' => array( |
|
| 1167 | - 'type' => 'text', |
|
| 1168 | - 'default' => '', |
|
| 1169 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
| 1170 | - 'tip' => __( 'URL link', 'lasso' ) |
|
| 1171 | - ), |
|
| 1172 | - 'alt' => array( |
|
| 1173 | - 'type' => 'text', |
|
| 1174 | - 'default' => '', |
|
| 1175 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1176 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1177 | - ), |
|
| 1166 | + 'link' => array( |
|
| 1167 | + 'type' => 'text', |
|
| 1168 | + 'default' => '', |
|
| 1169 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
| 1170 | + 'tip' => __( 'URL link', 'lasso' ) |
|
| 1171 | + ), |
|
| 1172 | + 'alt' => array( |
|
| 1173 | + 'type' => 'text', |
|
| 1174 | + 'default' => '', |
|
| 1175 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1176 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1177 | + ), |
|
| 1178 | 1178 | |
| 1179 | - 'caption' => array( |
|
| 1180 | - 'type' => 'text_area', |
|
| 1181 | - 'default' => '', |
|
| 1182 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1183 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1184 | - ), |
|
| 1179 | + 'caption' => array( |
|
| 1180 | + 'type' => 'text_area', |
|
| 1181 | + 'default' => '', |
|
| 1182 | + 'desc' => __( 'Caption', 'lasso' ), |
|
| 1183 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1184 | + ), |
|
| 1185 | 1185 | |
| 1186 | 1186 | |
| 1187 | - ), |
|
| 1188 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
| 1189 | - 'codes' => '<script> |
|
| 1187 | + ), |
|
| 1188 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
| 1189 | + 'codes' => '<script> |
|
| 1190 | 1190 | jQuery(document).ready(function($){ |
| 1191 | 1191 | function linkSetting(l){ |
| 1192 | 1192 | if ( l=="url") { |
@@ -1206,101 +1206,101 @@ discard block |
||
| 1206 | 1206 | }) |
| 1207 | 1207 | }); |
| 1208 | 1208 | </script>' |
| 1209 | - ) |
|
| 1210 | - ); |
|
| 1209 | + ) |
|
| 1210 | + ); |
|
| 1211 | 1211 | |
| 1212 | - return array_merge( $shortcodes, $custom ); |
|
| 1212 | + return array_merge( $shortcodes, $custom ); |
|
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | function add_wpimg_block_options( $shortcodes ) { |
| 1216 | - $custom = array( |
|
| 1217 | - 'wpimg-block' => array( |
|
| 1218 | - 'name' => __( 'Image', 'lasso' ), |
|
| 1219 | - 'type' => 'single', |
|
| 1220 | - 'atts' => array( |
|
| 1221 | - 'img' => array( |
|
| 1222 | - 'type' => 'media_upload', |
|
| 1223 | - 'default' => '', |
|
| 1224 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1225 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1226 | - ), |
|
| 1227 | - 'align' => array( |
|
| 1228 | - 'type' => 'select', |
|
| 1229 | - 'values' => array( |
|
| 1230 | - array( |
|
| 1231 | - 'value' => 'center', |
|
| 1232 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 1233 | - ), |
|
| 1234 | - array( |
|
| 1235 | - 'value' => 'left', |
|
| 1236 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 1237 | - ), |
|
| 1238 | - array( |
|
| 1239 | - 'value' => 'right', |
|
| 1240 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1241 | - ), |
|
| 1242 | - ), |
|
| 1243 | - 'default' => 'center', |
|
| 1244 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1245 | - 'tip'=>'' |
|
| 1246 | - ), |
|
| 1247 | - 'alt' => array( |
|
| 1248 | - 'type' => 'text', |
|
| 1249 | - 'default' => '', |
|
| 1250 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1251 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1252 | - ), |
|
| 1253 | - 'caption' => array( |
|
| 1254 | - 'type' => 'text', |
|
| 1255 | - 'default' => '', |
|
| 1256 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1257 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1258 | - ), |
|
| 1259 | - 'link' => array( |
|
| 1260 | - 'type' => 'text', |
|
| 1261 | - 'default' => '', |
|
| 1262 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
| 1263 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
| 1264 | - ), |
|
| 1216 | + $custom = array( |
|
| 1217 | + 'wpimg-block' => array( |
|
| 1218 | + 'name' => __( 'Image', 'lasso' ), |
|
| 1219 | + 'type' => 'single', |
|
| 1220 | + 'atts' => array( |
|
| 1221 | + 'img' => array( |
|
| 1222 | + 'type' => 'media_upload', |
|
| 1223 | + 'default' => '', |
|
| 1224 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1225 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1226 | + ), |
|
| 1227 | + 'align' => array( |
|
| 1228 | + 'type' => 'select', |
|
| 1229 | + 'values' => array( |
|
| 1230 | + array( |
|
| 1231 | + 'value' => 'center', |
|
| 1232 | + 'name' => __( 'Center', 'aesop-core' ) |
|
| 1233 | + ), |
|
| 1234 | + array( |
|
| 1235 | + 'value' => 'left', |
|
| 1236 | + 'name' => __( 'Left', 'aesop-core' ) |
|
| 1237 | + ), |
|
| 1238 | + array( |
|
| 1239 | + 'value' => 'right', |
|
| 1240 | + 'name' => __( 'Right', 'aesop-core' ) |
|
| 1241 | + ), |
|
| 1242 | + ), |
|
| 1243 | + 'default' => 'center', |
|
| 1244 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1245 | + 'tip'=>'' |
|
| 1246 | + ), |
|
| 1247 | + 'alt' => array( |
|
| 1248 | + 'type' => 'text', |
|
| 1249 | + 'default' => '', |
|
| 1250 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1251 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1252 | + ), |
|
| 1253 | + 'caption' => array( |
|
| 1254 | + 'type' => 'text', |
|
| 1255 | + 'default' => '', |
|
| 1256 | + 'desc' => __( 'Caption', 'lasso' ), |
|
| 1257 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1258 | + ), |
|
| 1259 | + 'link' => array( |
|
| 1260 | + 'type' => 'text', |
|
| 1261 | + 'default' => '', |
|
| 1262 | + 'desc' => __( 'Link URL', 'lasso' ), |
|
| 1263 | + 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
| 1264 | + ), |
|
| 1265 | 1265 | |
| 1266 | 1266 | |
| 1267 | - ), |
|
| 1268 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
| 1269 | - 'codes' => '<script> |
|
| 1267 | + ), |
|
| 1268 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
| 1269 | + 'codes' => '<script> |
|
| 1270 | 1270 | jQuery(document).ready(function($){ |
| 1271 | 1271 | |
| 1272 | 1272 | }); |
| 1273 | 1273 | </script>' |
| 1274 | - ) |
|
| 1275 | - ); |
|
| 1274 | + ) |
|
| 1275 | + ); |
|
| 1276 | 1276 | |
| 1277 | - return array_merge( $shortcodes, $custom ); |
|
| 1277 | + return array_merge( $shortcodes, $custom ); |
|
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | 1280 | function add_wpcover_block_options( $shortcodes ) { |
| 1281 | - $custom = array( |
|
| 1282 | - 'wpcover-block' => array( |
|
| 1283 | - 'name' => __( 'Cover', 'lasso' ), |
|
| 1284 | - 'type' => 'single', |
|
| 1285 | - 'atts' => array( |
|
| 1286 | - 'img' => array( |
|
| 1287 | - 'type' => 'media_upload', |
|
| 1288 | - 'default' => '', |
|
| 1289 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1290 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1291 | - ) |
|
| 1292 | - |
|
| 1293 | - ), |
|
| 1294 | - 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
| 1295 | - 'codes' => '<script> |
|
| 1281 | + $custom = array( |
|
| 1282 | + 'wpcover-block' => array( |
|
| 1283 | + 'name' => __( 'Cover', 'lasso' ), |
|
| 1284 | + 'type' => 'single', |
|
| 1285 | + 'atts' => array( |
|
| 1286 | + 'img' => array( |
|
| 1287 | + 'type' => 'media_upload', |
|
| 1288 | + 'default' => '', |
|
| 1289 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1290 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1291 | + ) |
|
| 1292 | + |
|
| 1293 | + ), |
|
| 1294 | + 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
| 1295 | + 'codes' => '<script> |
|
| 1296 | 1296 | jQuery(document).ready(function($){ |
| 1297 | 1297 | |
| 1298 | 1298 | }); |
| 1299 | 1299 | </script>' |
| 1300 | - ) |
|
| 1301 | - ); |
|
| 1300 | + ) |
|
| 1301 | + ); |
|
| 1302 | 1302 | |
| 1303 | - return array_merge( $shortcodes, $custom ); |
|
| 1303 | + return array_merge( $shortcodes, $custom ); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | /** |
@@ -1345,23 +1345,23 @@ discard block |
||
| 1345 | 1345 | * @return string |
| 1346 | 1346 | */ |
| 1347 | 1347 | function lasso_editor_adjustBrightness($hex, $steps) { |
| 1348 | - $steps = max(-255, min(255, $steps)); |
|
| 1348 | + $steps = max(-255, min(255, $steps)); |
|
| 1349 | 1349 | |
| 1350 | - // Normalize into a six character long hex string |
|
| 1351 | - $hex = str_replace('#', '', $hex); |
|
| 1352 | - if (strlen($hex) == 3) { |
|
| 1353 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
| 1354 | - } |
|
| 1350 | + // Normalize into a six character long hex string |
|
| 1351 | + $hex = str_replace('#', '', $hex); |
|
| 1352 | + if (strlen($hex) == 3) { |
|
| 1353 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
| 1354 | + } |
|
| 1355 | 1355 | |
| 1356 | - // Split into three parts: R, G and B |
|
| 1357 | - $color_parts = str_split($hex, 2); |
|
| 1358 | - $return = '#'; |
|
| 1356 | + // Split into three parts: R, G and B |
|
| 1357 | + $color_parts = str_split($hex, 2); |
|
| 1358 | + $return = '#'; |
|
| 1359 | 1359 | |
| 1360 | - foreach ($color_parts as $color) { |
|
| 1361 | - $color = hexdec($color); // Convert to decimal |
|
| 1362 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
| 1363 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
| 1364 | - } |
|
| 1360 | + foreach ($color_parts as $color) { |
|
| 1361 | + $color = hexdec($color); // Convert to decimal |
|
| 1362 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
| 1363 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
| 1364 | + } |
|
| 1365 | 1365 | |
| 1366 | - return $return; |
|
| 1366 | + return $return; |
|
| 1367 | 1367 | } |