@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @since 0.0.1 |
| 95 | 95 | * |
| 96 | - * @return Plugin slug variable. |
|
| 96 | + * @return string slug variable. |
|
| 97 | 97 | */ |
| 98 | 98 | public function get_plugin_slug() { |
| 99 | 99 | return $this->plugin_slug; |
@@ -668,6 +668,9 @@ discard block |
||
| 668 | 668 | return self::$revisions; |
| 669 | 669 | }*/ |
| 670 | 670 | |
| 671 | + /** |
|
| 672 | + * @param string $taxonomy |
|
| 673 | + */ |
|
| 671 | 674 | public function set_post_terms( $postid, $value, $taxonomy ) { |
| 672 | 675 | if( $value ) { |
| 673 | 676 | $value = explode( ',', $value ); |
@@ -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; |
@@ -330,14 +330,14 @@ discard block |
||
| 330 | 330 | $status = isset( $data['status'] ) ? $data['status'] : false; |
| 331 | 331 | $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
| 332 | 332 | $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
| 333 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
| 333 | + $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | $args = array( |
| 337 | 337 | 'ID' => (int) $postid, |
| 338 | 338 | 'post_name' => $slug, |
| 339 | 339 | 'post_status' => $status, |
| 340 | - 'post_excerpt' => $excerpt |
|
| 340 | + 'post_excerpt' => $excerpt |
|
| 341 | 341 | ); |
| 342 | 342 | |
| 343 | 343 | |
@@ -405,12 +405,12 @@ discard block |
||
| 405 | 405 | exit; |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | - public function editus_do_block() |
|
| 408 | + public function editus_do_block() |
|
| 409 | 409 | { |
| 410 | 410 | |
| 411 | 411 | $code= $_POST["code"]; |
| 412 | 412 | |
| 413 | - $out = do_blocks( $code ); |
|
| 413 | + $out = do_blocks( $code ); |
|
| 414 | 414 | |
| 415 | 415 | echo $out; |
| 416 | 416 | exit; |
@@ -429,63 +429,63 @@ discard block |
||
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | if ($code == "aesop_video") { |
| 432 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 433 | - echo aesop_video_shortcode($atts); |
|
| 432 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 433 | + echo aesop_video_shortcode($atts); |
|
| 434 | 434 | } |
| 435 | 435 | else if ($code == "aesop_image") { |
| 436 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 437 | - echo aesop_image_shortcode($atts); |
|
| 436 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 437 | + echo aesop_image_shortcode($atts); |
|
| 438 | 438 | } |
| 439 | 439 | else if ($code == "aesop_quote") { |
| 440 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 441 | - echo aesop_quote_shortcode($atts); |
|
| 440 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 441 | + echo aesop_quote_shortcode($atts); |
|
| 442 | 442 | } |
| 443 | 443 | else if ($code == "aesop_parallax") { |
| 444 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 445 | - echo aesop_parallax_shortcode($atts); |
|
| 444 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 445 | + echo aesop_parallax_shortcode($atts); |
|
| 446 | 446 | } |
| 447 | 447 | else if ($code == "aesop_character") { |
| 448 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 449 | - echo aesop_character_shortcode($atts); |
|
| 448 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 449 | + echo aesop_character_shortcode($atts); |
|
| 450 | 450 | } |
| 451 | 451 | else if ($code == "aesop_collection") { |
| 452 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 453 | - echo aesop_collection_shortcode($atts); |
|
| 452 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 453 | + echo aesop_collection_shortcode($atts); |
|
| 454 | 454 | } |
| 455 | 455 | else if ($code == "aesop_chapter") { |
| 456 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 457 | - echo aesop_chapter_shortcode($atts); |
|
| 456 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 457 | + echo aesop_chapter_shortcode($atts); |
|
| 458 | 458 | } |
| 459 | 459 | else if ($code == "aesop_content") { |
| 460 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 461 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 460 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 461 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 462 | 462 | } |
| 463 | 463 | else if ($code == "aesop_gallery") { |
| 464 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 465 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 464 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 465 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 466 | 466 | } |
| 467 | 467 | else if ($code == "aesop_audio") { |
| 468 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 469 | - echo aesop_audio_shortcode($atts); |
|
| 468 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 469 | + echo aesop_audio_shortcode($atts); |
|
| 470 | 470 | } |
| 471 | 471 | else if ($code == "aesop_document") { |
| 472 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 473 | - echo aesop_document_shortcode($atts); |
|
| 472 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 473 | + echo aesop_document_shortcode($atts); |
|
| 474 | 474 | } |
| 475 | - /*else if ($code == "aesop_content") { |
|
| 475 | + /*else if ($code == "aesop_content") { |
|
| 476 | 476 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php'); |
| 477 | 477 | echo aesop_content_shortcode($atts); |
| 478 | 478 | }*/ |
| 479 | - else if ($code == "aesop_wpimg") { |
|
| 480 | - self::wpimg($atts); |
|
| 479 | + else if ($code == "aesop_wpimg") { |
|
| 480 | + self::wpimg($atts); |
|
| 481 | 481 | } |
| 482 | 482 | else if ($code == "aesop_wpimg-block") { |
| 483 | - self::wpimg_block($atts); |
|
| 483 | + self::wpimg_block($atts); |
|
| 484 | 484 | } |
| 485 | 485 | else { |
| 486 | 486 | $code = '['.$code.' '; |
| 487 | 487 | foreach ($atts as $key => $value) { |
| 488 | - $code = ''.$key.'="'.$value.'" '; |
|
| 488 | + $code = ''.$key.'="'.$value.'" '; |
|
| 489 | 489 | } |
| 490 | 490 | $code = $code.']'; |
| 491 | 491 | echo do_shortcode($code); |
@@ -494,88 +494,88 @@ discard block |
||
| 494 | 494 | exit; |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - public static function wpimg($atts) { |
|
| 497 | + public static function wpimg($atts) { |
|
| 498 | 498 | |
| 499 | - echo '<figure data-component-type="wpimg"'; |
|
| 499 | + echo '<figure data-component-type="wpimg"'; |
|
| 500 | 500 | |
| 501 | - $extra = ""; |
|
| 501 | + $extra = ""; |
|
| 502 | 502 | |
| 503 | - // try to use srcset and sizes on new WP installs |
|
| 503 | + // try to use srcset and sizes on new WP installs |
|
| 504 | 504 | if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
| 505 | 505 | $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
| 506 | 506 | $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
| 507 | - $extra = "srcset='$srcset' sizes='$sizes' "; |
|
| 508 | - } |
|
| 509 | - if ($atts['align']=="left") { |
|
| 510 | - $extra .= 'class="alignleft'; |
|
| 511 | - } else if ($atts['align']=="right") { |
|
| 512 | - $extra .= 'class="alignright'; |
|
| 513 | - } else { |
|
| 514 | - $extra .= 'class="aligncenter'; |
|
| 515 | - } |
|
| 516 | - if ($atts['imgwidth'] || $atts['imgheight']) { |
|
| 517 | - if ($atts['imgwidth']) { |
|
| 518 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
| 519 | - } |
|
| 520 | - if ($atts['imgheight']) { |
|
| 521 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
| 522 | - } |
|
| 507 | + $extra = "srcset='$srcset' sizes='$sizes' "; |
|
| 508 | + } |
|
| 509 | + if ($atts['align']=="left") { |
|
| 510 | + $extra .= 'class="alignleft'; |
|
| 511 | + } else if ($atts['align']=="right") { |
|
| 512 | + $extra .= 'class="alignright'; |
|
| 513 | + } else { |
|
| 514 | + $extra .= 'class="aligncenter'; |
|
| 515 | + } |
|
| 516 | + if ($atts['imgwidth'] || $atts['imgheight']) { |
|
| 517 | + if ($atts['imgwidth']) { |
|
| 518 | + $extra .= 'width:'. $atts['imgwidth'].';'; |
|
| 519 | + } |
|
| 520 | + if ($atts['imgheight']) { |
|
| 521 | + $extra .= 'height:'. $atts['imgheight'].';'; |
|
| 522 | + } |
|
| 523 | 523 | |
| 524 | - } |
|
| 525 | - $extra .= '"'; |
|
| 524 | + } |
|
| 525 | + $extra .= '"'; |
|
| 526 | 526 | |
| 527 | - foreach ($atts as $key => $value) { |
|
| 527 | + foreach ($atts as $key => $value) { |
|
| 528 | 528 | echo ' data-'.$key.'="'.$value.'"'; |
| 529 | 529 | } |
| 530 | - //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
| 531 | - echo ' class="wp-caption lasso-component">'; |
|
| 532 | - $hrefset = false; |
|
| 533 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
| 534 | - { |
|
| 535 | - echo '<a href="' . $atts['link'] . '">'; |
|
| 536 | - $hrefset = true; |
|
| 537 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
| 538 | - echo '<a href="' . $atts['img'] . '">'; |
|
| 539 | - $hrefset = true; |
|
| 540 | - } |
|
| 541 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
| 542 | - if ($hrefset) |
|
| 543 | - { |
|
| 544 | - echo '</a>'; |
|
| 545 | - } |
|
| 546 | - if ($atts['caption']) |
|
| 547 | - { |
|
| 548 | - echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
| 549 | - } |
|
| 550 | - echo '</figure>'; |
|
| 551 | - echo '<p><br></p>'; |
|
| 552 | - return; |
|
| 553 | - } |
|
| 530 | + //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
| 531 | + echo ' class="wp-caption lasso-component">'; |
|
| 532 | + $hrefset = false; |
|
| 533 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
| 534 | + { |
|
| 535 | + echo '<a href="' . $atts['link'] . '">'; |
|
| 536 | + $hrefset = true; |
|
| 537 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
| 538 | + echo '<a href="' . $atts['img'] . '">'; |
|
| 539 | + $hrefset = true; |
|
| 540 | + } |
|
| 541 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
| 542 | + if ($hrefset) |
|
| 543 | + { |
|
| 544 | + echo '</a>'; |
|
| 545 | + } |
|
| 546 | + if ($atts['caption']) |
|
| 547 | + { |
|
| 548 | + echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
| 549 | + } |
|
| 550 | + echo '</figure>'; |
|
| 551 | + echo '<p><br></p>'; |
|
| 552 | + return; |
|
| 553 | + } |
|
| 554 | 554 | |
| 555 | 555 | public static function wpimg_block($atts) { |
| 556 | 556 | $imgextra = ''; |
| 557 | 557 | if (!empty($atts['id'])) { |
| 558 | 558 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
| 559 | 559 | } |
| 560 | - $figclass = 'aligncenter'; |
|
| 561 | - if ($atts['align']=="left") { |
|
| 562 | - $figclass = 'alignleft'; |
|
| 563 | - } else if ($atts['align']=="right") { |
|
| 564 | - $figclass = 'alignright'; |
|
| 565 | - } else { |
|
| 566 | - $figclass = 'aligncenter'; |
|
| 567 | - } |
|
| 568 | - echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
| 569 | - echo '<figure class="'.$figclass.' size-large">'; |
|
| 570 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
| 571 | - if ($atts['caption']) |
|
| 572 | - { |
|
| 573 | - echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
| 574 | - } |
|
| 575 | - echo '</figure></div>'; |
|
| 576 | - echo '<p><br></p>'; |
|
| 577 | - return; |
|
| 578 | - } |
|
| 560 | + $figclass = 'aligncenter'; |
|
| 561 | + if ($atts['align']=="left") { |
|
| 562 | + $figclass = 'alignleft'; |
|
| 563 | + } else if ($atts['align']=="right") { |
|
| 564 | + $figclass = 'alignright'; |
|
| 565 | + } else { |
|
| 566 | + $figclass = 'aligncenter'; |
|
| 567 | + } |
|
| 568 | + echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
| 569 | + echo '<figure class="'.$figclass.' size-large">'; |
|
| 570 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
| 571 | + if ($atts['caption']) |
|
| 572 | + { |
|
| 573 | + echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
| 574 | + } |
|
| 575 | + echo '</figure></div>'; |
|
| 576 | + echo '<p><br></p>'; |
|
| 577 | + return; |
|
| 578 | + } |
|
| 579 | 579 | |
| 580 | 580 | |
| 581 | 581 | public function get_ase_options() |
@@ -611,12 +611,12 @@ discard block |
||
| 611 | 611 | exit; |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 615 | - public function on_publish_post( ) { |
|
| 614 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 615 | + public function on_publish_post( ) { |
|
| 616 | 616 | |
| 617 | 617 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 618 | 618 | |
| 619 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 619 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 620 | 620 | |
| 621 | 621 | exit; |
| 622 | 622 | } |
@@ -674,14 +674,14 @@ discard block |
||
| 674 | 674 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
| 675 | 675 | |
| 676 | 676 | if ($taxonomy =='category') { |
| 677 | - // convert from names to category ids |
|
| 677 | + // convert from names to category ids |
|
| 678 | 678 | $cats = array(); |
| 679 | 679 | foreach ($value as $cat) { |
| 680 | 680 | $cat_id = get_cat_ID($cat); |
| 681 | 681 | if ($cat_id !=0) { |
| 682 | 682 | $cats [] = $cat_id; |
| 683 | 683 | } else if ($allow_new_category) { |
| 684 | - $cats [] = wp_create_category($cat); |
|
| 684 | + $cats [] = wp_create_category($cat); |
|
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | $value = $cats; |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | - public function create_gallery( ) { |
|
| 704 | + public function create_gallery( ) { |
|
| 705 | 705 | |
| 706 | 706 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 707 | 707 | |
@@ -755,10 +755,10 @@ discard block |
||
| 755 | 755 | 'message' => 'gallery-created', |
| 756 | 756 | 'id' => $postid) |
| 757 | 757 | ); |
| 758 | - exit; |
|
| 758 | + exit; |
|
| 759 | 759 | } |
| 760 | 760 | |
| 761 | - public function update_gallery( ) { |
|
| 761 | + public function update_gallery( ) { |
|
| 762 | 762 | |
| 763 | 763 | $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
| 764 | 764 | |
@@ -774,12 +774,12 @@ discard block |
||
| 774 | 774 | |
| 775 | 775 | self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
| 776 | 776 | |
| 777 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
| 777 | + echo json_encode( array('message' => 'gallery-updated') ); |
|
| 778 | 778 | |
| 779 | - exit; |
|
| 779 | + exit; |
|
| 780 | 780 | } |
| 781 | 781 | |
| 782 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 782 | + public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 783 | 783 | |
| 784 | 784 | // gallery width |
| 785 | 785 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | public function set_date( $postid, $value) { |
| 864 | 864 | if( $value ) { |
| 865 | 865 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
| 866 | - wp_update_post( |
|
| 866 | + wp_update_post( |
|
| 867 | 867 | array ( |
| 868 | 868 | 'ID' => $postid, // ID of the post to update |
| 869 | 869 | '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 | |
@@ -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 | |
| 467 | 467 | // are we singular |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | // do we support pending status |
| 475 | 475 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
| 476 | 476 | |
| 477 | - $excerpt = $post->post_excerpt; |
|
| 477 | + $excerpt = $post->post_excerpt; |
|
| 478 | 478 | |
| 479 | 479 | ?> |
| 480 | 480 | <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | }?> |
| 554 | 554 | <?php |
| 555 | 555 | if ($allow_change_date) { |
| 556 | - $dateformat = get_option( 'date_format' ); |
|
| 556 | + $dateformat = get_option( 'date_format' ); |
|
| 557 | 557 | ?> |
| 558 | 558 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
| 559 | 559 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -647,8 +647,8 @@ discard block |
||
| 647 | 647 | $types = lasso_post_types_names(); |
| 648 | 648 | if ( !empty( $types ) ) { |
| 649 | 649 | foreach( $types as $name => $label ) |
| 650 | - { |
|
| 651 | - $type = $name; |
|
| 650 | + { |
|
| 651 | + $type = $name; |
|
| 652 | 652 | //$type = preg_replace( '/s\b/','', $name ); |
| 653 | 653 | if ($type == 'page' && !current_user_can('edit_pages')) { |
| 654 | 654 | continue; |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | if ( !empty( $types ) ) { |
| 671 | 671 | // get the first element |
| 672 | 672 | $keys = array_keys($types); |
| 673 | - $type =$keys[0]; |
|
| 673 | + $type =$keys[0]; |
|
| 674 | 674 | $type = preg_replace( '/s\b/','', $type ); |
| 675 | 675 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
| 676 | 676 | } |
@@ -698,8 +698,8 @@ discard block |
||
| 698 | 698 | global $post; |
| 699 | 699 | |
| 700 | 700 | global $wp_post_types; |
| 701 | - $labels = &$wp_post_types['post']->labels; |
|
| 702 | - $labels->name = 'Articles'; |
|
| 701 | + $labels = &$wp_post_types['post']->labels; |
|
| 702 | + $labels->name = 'Articles'; |
|
| 703 | 703 | |
| 704 | 704 | ob_start(); |
| 705 | 705 | |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | ob_start(); |
| 760 | 760 | |
| 761 | 761 | |
| 762 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
| 762 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
| 763 | 763 | |
| 764 | 764 | // let users add custom css classes |
| 765 | 765 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -861,9 +861,9 @@ discard block |
||
| 861 | 861 | function lasso_editor_options_blob() { |
| 862 | 862 | |
| 863 | 863 | $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
| 864 | - $codes = add_wpimg_options( $codes ); |
|
| 864 | + $codes = add_wpimg_options( $codes ); |
|
| 865 | 865 | $codes = add_wpimg_block_options( $codes ); |
| 866 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
| 866 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
| 867 | 867 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
| 868 | 868 | |
| 869 | 869 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -965,9 +965,9 @@ discard block |
||
| 965 | 965 | $return .= '</form>'; |
| 966 | 966 | |
| 967 | 967 | // extra JS codes |
| 968 | - if (isset($shortcode['codes'])) { |
|
| 969 | - $return .= $shortcode['codes']; |
|
| 970 | - } |
|
| 968 | + if (isset($shortcode['codes'])) { |
|
| 969 | + $return .= $shortcode['codes']; |
|
| 970 | + } |
|
| 971 | 971 | $blob[$slug] = $return; |
| 972 | 972 | } |
| 973 | 973 | |
@@ -976,95 +976,95 @@ discard block |
||
| 976 | 976 | |
| 977 | 977 | |
| 978 | 978 | function add_wpimg_options( $shortcodes ) { |
| 979 | - $custom = array( |
|
| 980 | - 'wpimg' => array( |
|
| 981 | - 'name' => __( 'Image', 'lasso' ), |
|
| 982 | - 'type' => 'single', |
|
| 983 | - 'atts' => array( |
|
| 984 | - 'img' => array( |
|
| 985 | - 'type' => 'media_upload', |
|
| 986 | - 'default' => '', |
|
| 987 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 988 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 989 | - ), |
|
| 990 | - 'align' => array( |
|
| 991 | - 'type' => 'select', |
|
| 992 | - 'values' => array( |
|
| 993 | - array( |
|
| 994 | - 'value' => 'center', |
|
| 995 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 996 | - ), |
|
| 997 | - array( |
|
| 998 | - 'value' => 'left', |
|
| 999 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 1000 | - ), |
|
| 1001 | - array( |
|
| 1002 | - 'value' => 'right', |
|
| 1003 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1004 | - ), |
|
| 1005 | - ), |
|
| 1006 | - 'default' => 'center', |
|
| 1007 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1008 | - 'tip'=>'' |
|
| 1009 | - ), |
|
| 979 | + $custom = array( |
|
| 980 | + 'wpimg' => array( |
|
| 981 | + 'name' => __( 'Image', 'lasso' ), |
|
| 982 | + 'type' => 'single', |
|
| 983 | + 'atts' => array( |
|
| 984 | + 'img' => array( |
|
| 985 | + 'type' => 'media_upload', |
|
| 986 | + 'default' => '', |
|
| 987 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
| 988 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 989 | + ), |
|
| 990 | + 'align' => array( |
|
| 991 | + 'type' => 'select', |
|
| 992 | + 'values' => array( |
|
| 993 | + array( |
|
| 994 | + 'value' => 'center', |
|
| 995 | + 'name' => __( 'Center', 'aesop-core' ) |
|
| 996 | + ), |
|
| 997 | + array( |
|
| 998 | + 'value' => 'left', |
|
| 999 | + 'name' => __( 'Left', 'aesop-core' ) |
|
| 1000 | + ), |
|
| 1001 | + array( |
|
| 1002 | + 'value' => 'right', |
|
| 1003 | + 'name' => __( 'Right', 'aesop-core' ) |
|
| 1004 | + ), |
|
| 1005 | + ), |
|
| 1006 | + 'default' => 'center', |
|
| 1007 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1008 | + 'tip'=>'' |
|
| 1009 | + ), |
|
| 1010 | 1010 | |
| 1011 | - 'imgwidth' => array( |
|
| 1012 | - 'type' => 'text_small', |
|
| 1013 | - 'default' => '300px', |
|
| 1014 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
| 1015 | - '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' ) |
|
| 1016 | - ), |
|
| 1017 | - 'imgheight' => array( |
|
| 1018 | - 'type' => 'text_small', |
|
| 1019 | - 'default' => '', |
|
| 1020 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
| 1021 | - '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' ) |
|
| 1022 | - ), |
|
| 1023 | - 'linkoption' => array( |
|
| 1024 | - 'type' => 'select', |
|
| 1025 | - 'values' => array( |
|
| 1026 | - array( |
|
| 1027 | - 'value' => 'none', |
|
| 1028 | - 'name' => __( 'None', 'aesop-core' ) |
|
| 1029 | - ), |
|
| 1030 | - array( |
|
| 1031 | - 'value' => 'img', |
|
| 1032 | - 'name' => __( 'Image', 'aesop-core' ) |
|
| 1033 | - ), |
|
| 1034 | - array( |
|
| 1035 | - 'value' => 'url', |
|
| 1036 | - 'name' => __( 'URL', 'aesop-core' ) |
|
| 1037 | - ), |
|
| 1038 | - ), |
|
| 1039 | - 'default' => 'none', |
|
| 1040 | - 'desc' => __( 'Link', 'lasso' ), |
|
| 1041 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
| 1042 | - ), |
|
| 1011 | + 'imgwidth' => array( |
|
| 1012 | + 'type' => 'text_small', |
|
| 1013 | + 'default' => '300px', |
|
| 1014 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
| 1015 | + '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' ) |
|
| 1016 | + ), |
|
| 1017 | + 'imgheight' => array( |
|
| 1018 | + 'type' => 'text_small', |
|
| 1019 | + 'default' => '', |
|
| 1020 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
| 1021 | + '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' ) |
|
| 1022 | + ), |
|
| 1023 | + 'linkoption' => array( |
|
| 1024 | + 'type' => 'select', |
|
| 1025 | + 'values' => array( |
|
| 1026 | + array( |
|
| 1027 | + 'value' => 'none', |
|
| 1028 | + 'name' => __( 'None', 'aesop-core' ) |
|
| 1029 | + ), |
|
| 1030 | + array( |
|
| 1031 | + 'value' => 'img', |
|
| 1032 | + 'name' => __( 'Image', 'aesop-core' ) |
|
| 1033 | + ), |
|
| 1034 | + array( |
|
| 1035 | + 'value' => 'url', |
|
| 1036 | + 'name' => __( 'URL', 'aesop-core' ) |
|
| 1037 | + ), |
|
| 1038 | + ), |
|
| 1039 | + 'default' => 'none', |
|
| 1040 | + 'desc' => __( 'Link', 'lasso' ), |
|
| 1041 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
| 1042 | + ), |
|
| 1043 | 1043 | |
| 1044 | - 'link' => array( |
|
| 1045 | - 'type' => 'text', |
|
| 1046 | - 'default' => '', |
|
| 1047 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
| 1048 | - 'tip' => __( 'URL link', 'lasso' ) |
|
| 1049 | - ), |
|
| 1050 | - 'alt' => array( |
|
| 1051 | - 'type' => 'text', |
|
| 1052 | - 'default' => '', |
|
| 1053 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1054 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1055 | - ), |
|
| 1044 | + 'link' => array( |
|
| 1045 | + 'type' => 'text', |
|
| 1046 | + 'default' => '', |
|
| 1047 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
| 1048 | + 'tip' => __( 'URL link', 'lasso' ) |
|
| 1049 | + ), |
|
| 1050 | + 'alt' => array( |
|
| 1051 | + 'type' => 'text', |
|
| 1052 | + 'default' => '', |
|
| 1053 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1054 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1055 | + ), |
|
| 1056 | 1056 | |
| 1057 | - 'caption' => array( |
|
| 1058 | - 'type' => 'text_area', |
|
| 1059 | - 'default' => '', |
|
| 1060 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1061 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1062 | - ), |
|
| 1057 | + 'caption' => array( |
|
| 1058 | + 'type' => 'text_area', |
|
| 1059 | + 'default' => '', |
|
| 1060 | + 'desc' => __( 'Caption', 'lasso' ), |
|
| 1061 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1062 | + ), |
|
| 1063 | 1063 | |
| 1064 | 1064 | |
| 1065 | - ), |
|
| 1066 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
| 1067 | - 'codes' => '<script> |
|
| 1065 | + ), |
|
| 1066 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
| 1067 | + 'codes' => '<script> |
|
| 1068 | 1068 | jQuery(document).ready(function($){ |
| 1069 | 1069 | function linkSetting(l){ |
| 1070 | 1070 | if ( l=="url") { |
@@ -1084,69 +1084,69 @@ discard block |
||
| 1084 | 1084 | }) |
| 1085 | 1085 | }); |
| 1086 | 1086 | </script>' |
| 1087 | - ) |
|
| 1088 | - ); |
|
| 1087 | + ) |
|
| 1088 | + ); |
|
| 1089 | 1089 | |
| 1090 | - return array_merge( $shortcodes, $custom ); |
|
| 1090 | + return array_merge( $shortcodes, $custom ); |
|
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | function add_wpimg_block_options( $shortcodes ) { |
| 1094 | - $custom = array( |
|
| 1095 | - 'wpimg-block' => array( |
|
| 1096 | - 'name' => __( 'Image', 'lasso' ), |
|
| 1097 | - 'type' => 'single', |
|
| 1098 | - 'atts' => array( |
|
| 1099 | - 'img' => array( |
|
| 1100 | - 'type' => 'media_upload', |
|
| 1101 | - 'default' => '', |
|
| 1102 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1103 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1104 | - ), |
|
| 1105 | - 'align' => array( |
|
| 1106 | - 'type' => 'select', |
|
| 1107 | - 'values' => array( |
|
| 1108 | - array( |
|
| 1109 | - 'value' => 'center', |
|
| 1110 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 1111 | - ), |
|
| 1112 | - array( |
|
| 1113 | - 'value' => 'left', |
|
| 1114 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 1115 | - ), |
|
| 1116 | - array( |
|
| 1117 | - 'value' => 'right', |
|
| 1118 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1119 | - ), |
|
| 1120 | - ), |
|
| 1121 | - 'default' => 'center', |
|
| 1122 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1123 | - 'tip'=>'' |
|
| 1124 | - ), |
|
| 1125 | - 'alt' => array( |
|
| 1126 | - 'type' => 'text', |
|
| 1127 | - 'default' => '', |
|
| 1128 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1129 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1130 | - ), |
|
| 1131 | - 'caption' => array( |
|
| 1132 | - 'type' => 'text', |
|
| 1133 | - 'default' => '', |
|
| 1134 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1135 | - 'tip' => __( 'Caption for the image.', 'lasso' ) |
|
| 1136 | - ), |
|
| 1094 | + $custom = array( |
|
| 1095 | + 'wpimg-block' => array( |
|
| 1096 | + 'name' => __( 'Image', 'lasso' ), |
|
| 1097 | + 'type' => 'single', |
|
| 1098 | + 'atts' => array( |
|
| 1099 | + 'img' => array( |
|
| 1100 | + 'type' => 'media_upload', |
|
| 1101 | + 'default' => '', |
|
| 1102 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1103 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1104 | + ), |
|
| 1105 | + 'align' => array( |
|
| 1106 | + 'type' => 'select', |
|
| 1107 | + 'values' => array( |
|
| 1108 | + array( |
|
| 1109 | + 'value' => 'center', |
|
| 1110 | + 'name' => __( 'Center', 'aesop-core' ) |
|
| 1111 | + ), |
|
| 1112 | + array( |
|
| 1113 | + 'value' => 'left', |
|
| 1114 | + 'name' => __( 'Left', 'aesop-core' ) |
|
| 1115 | + ), |
|
| 1116 | + array( |
|
| 1117 | + 'value' => 'right', |
|
| 1118 | + 'name' => __( 'Right', 'aesop-core' ) |
|
| 1119 | + ), |
|
| 1120 | + ), |
|
| 1121 | + 'default' => 'center', |
|
| 1122 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1123 | + 'tip'=>'' |
|
| 1124 | + ), |
|
| 1125 | + 'alt' => array( |
|
| 1126 | + 'type' => 'text', |
|
| 1127 | + 'default' => '', |
|
| 1128 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1129 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1130 | + ), |
|
| 1131 | + 'caption' => array( |
|
| 1132 | + 'type' => 'text', |
|
| 1133 | + 'default' => '', |
|
| 1134 | + 'desc' => __( 'Caption', 'lasso' ), |
|
| 1135 | + 'tip' => __( 'Caption for the image.', 'lasso' ) |
|
| 1136 | + ), |
|
| 1137 | 1137 | |
| 1138 | 1138 | |
| 1139 | - ), |
|
| 1140 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
| 1141 | - 'codes' => '<script> |
|
| 1139 | + ), |
|
| 1140 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
| 1141 | + 'codes' => '<script> |
|
| 1142 | 1142 | jQuery(document).ready(function($){ |
| 1143 | 1143 | |
| 1144 | 1144 | }); |
| 1145 | 1145 | </script>' |
| 1146 | - ) |
|
| 1147 | - ); |
|
| 1146 | + ) |
|
| 1147 | + ); |
|
| 1148 | 1148 | |
| 1149 | - return array_merge( $shortcodes, $custom ); |
|
| 1149 | + return array_merge( $shortcodes, $custom ); |
|
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | 1152 | /** |
@@ -1191,23 +1191,23 @@ discard block |
||
| 1191 | 1191 | * @return string |
| 1192 | 1192 | */ |
| 1193 | 1193 | function lasso_editor_adjustBrightness($hex, $steps) { |
| 1194 | - $steps = max(-255, min(255, $steps)); |
|
| 1194 | + $steps = max(-255, min(255, $steps)); |
|
| 1195 | 1195 | |
| 1196 | - // Normalize into a six character long hex string |
|
| 1197 | - $hex = str_replace('#', '', $hex); |
|
| 1198 | - if (strlen($hex) == 3) { |
|
| 1199 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
| 1200 | - } |
|
| 1196 | + // Normalize into a six character long hex string |
|
| 1197 | + $hex = str_replace('#', '', $hex); |
|
| 1198 | + if (strlen($hex) == 3) { |
|
| 1199 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
| 1200 | + } |
|
| 1201 | 1201 | |
| 1202 | - // Split into three parts: R, G and B |
|
| 1203 | - $color_parts = str_split($hex, 2); |
|
| 1204 | - $return = '#'; |
|
| 1202 | + // Split into three parts: R, G and B |
|
| 1203 | + $color_parts = str_split($hex, 2); |
|
| 1204 | + $return = '#'; |
|
| 1205 | 1205 | |
| 1206 | - foreach ($color_parts as $color) { |
|
| 1207 | - $color = hexdec($color); // Convert to decimal |
|
| 1208 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
| 1209 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
| 1210 | - } |
|
| 1206 | + foreach ($color_parts as $color) { |
|
| 1207 | + $color = hexdec($color); // Convert to decimal |
|
| 1208 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
| 1209 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
| 1210 | + } |
|
| 1211 | 1211 | |
| 1212 | - return $return; |
|
| 1212 | + return $return; |
|
| 1213 | 1213 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - do_action( 'editus_after_meta_update', $post_id, $data ); |
|
| 55 | + do_action( 'editus_after_meta_update', $post_id, $data ); |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | return true; |