@@ -923,6 +923,7 @@ |
||
923 | 923 | * Takes a color code and returns an adjusted value |
924 | 924 | * @since 1.0.0 |
925 | 925 | * Steps should be between -255 and 255. Negative = darker, positive = lighter |
926 | + * @param integer $steps |
|
926 | 927 | * @return string |
927 | 928 | */ |
928 | 929 | function lasso_editor_adjustBrightness($hex, $steps) { |
@@ -280,9 +280,12 @@ discard block |
||
280 | 280 | <?php if ( class_exists ('Aesop_Events') ) { ?> |
281 | 281 | <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
282 | 282 | <?php }?> |
283 | - <?php else: ?> |
|
283 | + <?php else { |
|
284 | + : ?> |
|
284 | 285 | <?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> |
|
286 | + <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
287 | +} |
|
288 | +?>" class="image lasso-toolbar--component__image"></li> |
|
286 | 289 | <?php } else { ?> |
287 | 290 | <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
288 | 291 | <?php } ?> |
@@ -868,8 +871,9 @@ discard block |
||
868 | 871 | |
869 | 872 | $blob = array(); |
870 | 873 | |
871 | - if ( empty( $codes ) ) |
|
872 | - return; |
|
874 | + if ( empty( $codes ) ) { |
|
875 | + return; |
|
876 | + } |
|
873 | 877 | |
874 | 878 | foreach ( $codes as $slug => $shortcode ) { |
875 | 879 | $return = ''; |
@@ -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 | } |
@@ -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,19 +445,19 @@ 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'); |
@@ -465,11 +465,11 @@ discard block |
||
465 | 465 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
466 | 466 | |
467 | 467 | // are we singular |
468 | - $is_singular = is_singular(); |
|
468 | + $is_singular = is_singular(); |
|
469 | 469 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
470 | 470 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
471 | 471 | $theme_supports = current_theme_supports('post-thumbnails'); |
472 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
472 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
473 | 473 | |
474 | 474 | // do we support pending status |
475 | 475 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -477,26 +477,26 @@ discard block |
||
477 | 477 | $excerpt = $post->post_excerpt; |
478 | 478 | |
479 | 479 | ?> |
480 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
480 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
481 | 481 | <div class="lasso--modal__inner"> |
482 | 482 | |
483 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
483 | + <?php if ($tabs) { echo $tabs; } ?> |
|
484 | 484 | |
485 | 485 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
486 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
486 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
487 | 487 | |
488 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
488 | + <?php if ($is_singular && $theme_supports) : ?> |
|
489 | 489 | <div class="lasso--postsettings__left"> |
490 | - <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> |
|
491 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
490 | + <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> |
|
491 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
492 | 492 | |
493 | 493 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
494 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
495 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
494 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
495 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
496 | 496 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
497 | 497 | </div> |
498 | 498 | |
499 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
499 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
500 | 500 | |
501 | 501 | </div> |
502 | 502 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -506,15 +506,15 @@ discard block |
||
506 | 506 | |
507 | 507 | <div class="lasso--postsettings__right"> |
508 | 508 | |
509 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
509 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
510 | 510 | <div class="lasso--postsettings__option story-status-option"> |
511 | - <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> |
|
512 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
513 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
514 | - <?php if( !$no_pending_status ): ?> |
|
515 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
511 | + <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> |
|
512 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
513 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
514 | + <?php if (!$no_pending_status): ?> |
|
515 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
516 | 516 | <?php endif; ?> |
517 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
517 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
518 | 518 | </ul> |
519 | 519 | <div class="lasso--slider_wrap"> |
520 | 520 | <div id="lasso--slider"></div> |
@@ -522,10 +522,10 @@ discard block |
||
522 | 522 | </div> |
523 | 523 | <?php endif; ?> |
524 | 524 | |
525 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
525 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
526 | 526 | <div class="lasso--postsettings__option story-slug-option"> |
527 | - <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> |
|
528 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
527 | + <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> |
|
528 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
529 | 529 | </div> |
530 | 530 | <?php endif; ?> |
531 | 531 | |
@@ -534,30 +534,30 @@ discard block |
||
534 | 534 | <div class="lasso--postsettings__middle"> |
535 | 535 | |
536 | 536 | <div class="lasso--postsettings__option story-categories-option"> |
537 | - <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> |
|
538 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
537 | + <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> |
|
538 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
539 | 539 | </div> |
540 | 540 | |
541 | 541 | <div class="lasso--postsettings__option story-tags-option"> |
542 | - <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> |
|
543 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
542 | + <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> |
|
543 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
544 | 544 | </div> |
545 | 545 | <?php |
546 | 546 | if ($allow_edit_excerpt) { |
547 | 547 | ?> |
548 | 548 | <div class="lasso--postsettings__option story-excerpt-option"> |
549 | - <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> |
|
550 | - <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%"> |
|
549 | + <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> |
|
550 | + <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%"> |
|
551 | 551 | </div> |
552 | 552 | <?php |
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 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
559 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
560 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
558 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
559 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
560 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
561 | 561 | <?php |
562 | 562 | }?> |
563 | 563 | |
@@ -579,23 +579,23 @@ discard block |
||
579 | 579 | ?> |
580 | 580 | <!--/div--> |
581 | 581 | |
582 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
582 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
583 | 583 | |
584 | 584 | <div class="lasso--postsettings__footer" > |
585 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
585 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
586 | 586 | <input type="hidden" name="status" value=""> |
587 | 587 | <input type="hidden" name="categories" value=""> |
588 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
588 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
589 | 589 | <input type="hidden" name="action" value="process_update-object_post"> |
590 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
591 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
592 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
590 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
591 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
592 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
593 | 593 | </div> |
594 | 594 | |
595 | 595 | </form> |
596 | 596 | </div> |
597 | 597 | |
598 | - <?php if( $tabs ) { echo $content; } ?> |
|
598 | + <?php if ($tabs) { echo $content; } ?> |
|
599 | 599 | |
600 | 600 | </div> |
601 | 601 | |
@@ -617,43 +617,43 @@ discard block |
||
617 | 617 | ob_start(); |
618 | 618 | |
619 | 619 | |
620 | - $status = get_post_status( get_the_ID() ); |
|
620 | + $status = get_post_status(get_the_ID()); |
|
621 | 621 | |
622 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
622 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
623 | 623 | |
624 | 624 | // let users add custom css classes |
625 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
625 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
626 | 626 | |
627 | 627 | // return the post type |
628 | - $type = get_post_type( get_the_ID() ); |
|
628 | + $type = get_post_type(get_the_ID()); |
|
629 | 629 | |
630 | 630 | $mobile_style = ""; |
631 | 631 | if (wp_is_mobile()) { |
632 | 632 | //$mobile_style = 'style="top:140px !important;"'; |
633 | 633 | } |
634 | 634 | ?> |
635 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
635 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
636 | 636 | <div class="lasso--modal__inner lasso--hasnewform"> |
637 | 637 | |
638 | 638 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
639 | 639 | |
640 | 640 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
641 | - <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> |
|
642 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
641 | + <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> |
|
642 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
643 | 643 | <div class="lasso--select-wrap" style="width:90px"> |
644 | 644 | <select id="lasso--select-type" name="story_type"> |
645 | 645 | |
646 | 646 | <?php |
647 | 647 | $types = lasso_post_types_names(); |
648 | - if ( !empty( $types ) ) { |
|
649 | - foreach( $types as $name => $label ) |
|
648 | + if (!empty($types)) { |
|
649 | + foreach ($types as $name => $label) |
|
650 | 650 | { |
651 | 651 | $type = $name; |
652 | 652 | //$type = preg_replace( '/s\b/','', $name ); |
653 | 653 | if ($type == 'page' && !current_user_can('edit_pages')) { |
654 | 654 | continue; |
655 | 655 | } |
656 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
656 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | } |
@@ -664,19 +664,19 @@ discard block |
||
664 | 664 | </div> |
665 | 665 | |
666 | 666 | <div class="lasso--postsettings__footer"> |
667 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
667 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
668 | 668 | <input type="hidden" name="action" value="process_new-object_post"> |
669 | 669 | <?php |
670 | - if ( !empty( $types ) ) { |
|
670 | + if (!empty($types)) { |
|
671 | 671 | // get the first element |
672 | 672 | $keys = array_keys($types); |
673 | - $type =$keys[0]; |
|
674 | - $type = preg_replace( '/s\b/','', $type ); |
|
675 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
673 | + $type = $keys[0]; |
|
674 | + $type = preg_replace('/s\b/', '', $type); |
|
675 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
676 | 676 | } |
677 | 677 | ?> |
678 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
679 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
678 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
679 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
680 | 680 | </div> |
681 | 681 | |
682 | 682 | </form> |
@@ -704,18 +704,18 @@ discard block |
||
704 | 704 | ob_start(); |
705 | 705 | |
706 | 706 | // post status |
707 | - $status = get_post_status( get_the_ID() ); |
|
707 | + $status = get_post_status(get_the_ID()); |
|
708 | 708 | |
709 | 709 | // let users add custom css classes |
710 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
710 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
711 | 711 | |
712 | 712 | ?> |
713 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
713 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
714 | 714 | <div class="lasso--modal__inner"> |
715 | 715 | |
716 | 716 | <div class="lasso--post-filtering not-visible"> |
717 | 717 | <div class="lasso--search__results"> |
718 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
718 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
719 | 719 | </div> |
720 | 720 | <div class="lasso--search"> |
721 | 721 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -729,18 +729,18 @@ discard block |
||
729 | 729 | $post_types = lasso_post_types_names(); |
730 | 730 | $rest_bases = lasso_post_types_rest_base(); |
731 | 731 | |
732 | - if ( ! empty( $post_types ) ) { |
|
732 | + if (!empty($post_types)) { |
|
733 | 733 | $first = 'active'; |
734 | - foreach( $post_types as $name => $label ) { |
|
734 | + foreach ($post_types as $name => $label) { |
|
735 | 735 | if (array_key_exists($name, $rest_bases)) { |
736 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
736 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
737 | 737 | } |
738 | 738 | $first = ''; |
739 | 739 | } |
740 | 740 | |
741 | 741 | } |
742 | 742 | |
743 | - do_action('lasso_modal_post_objects');?> |
|
743 | + do_action('lasso_modal_post_objects'); ?> |
|
744 | 744 | |
745 | 745 | </ul> |
746 | 746 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -759,21 +759,21 @@ 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 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
765 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
766 | 766 | |
767 | 767 | ?> |
768 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
769 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
770 | - <?php if ($use_old_wpimg=='on') {?> |
|
771 | - <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
768 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
769 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
770 | + <?php if ($use_old_wpimg == 'on') {?> |
|
771 | + <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
772 | 772 | <?php } else {?> |
773 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
773 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
774 | 774 | <?php } ?> |
775 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
776 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
775 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
776 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
777 | 777 | </ul> |
778 | 778 | |
779 | 779 | <?php return ob_get_clean(); |
@@ -784,10 +784,10 @@ discard block |
||
784 | 784 | |
785 | 785 | ?> |
786 | 786 | <ul class="lasso-component--controls editus-center" contenteditable="false"> |
787 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
788 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
789 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
790 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
787 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
788 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
789 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
790 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
791 | 791 | </ul> |
792 | 792 | |
793 | 793 | <?php return ob_get_clean(); |
@@ -799,14 +799,14 @@ discard block |
||
799 | 799 | |
800 | 800 | |
801 | 801 | // let users add custom css classes |
802 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
802 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
803 | 803 | |
804 | 804 | ?> |
805 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
806 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
807 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
808 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
809 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
805 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
806 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
807 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
808 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
809 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
810 | 810 | </ul> |
811 | 811 | |
812 | 812 | <?php return ob_get_clean(); |
@@ -819,16 +819,16 @@ discard block |
||
819 | 819 | */ |
820 | 820 | function lasso_map_form_footer() { |
821 | 821 | |
822 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
822 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
823 | 823 | |
824 | 824 | ob_start(); |
825 | 825 | |
826 | 826 | ?> |
827 | 827 | <div class="lasso--map-form__footer"> |
828 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
829 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
828 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
829 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
830 | 830 | <input type="hidden" name="action" value="process_map_save"> |
831 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
831 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
832 | 832 | </div> |
833 | 833 | |
834 | 834 | <?php return ob_get_clean(); |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | |
847 | 847 | ?> |
848 | 848 | <div id="lasso--pagerefresh" class="visible"> |
849 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
849 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
850 | 850 | </div> |
851 | 851 | |
852 | 852 | <?php return ob_get_clean(); |
@@ -860,46 +860,46 @@ discard block |
||
860 | 860 | */ |
861 | 861 | function lasso_editor_options_blob() { |
862 | 862 | |
863 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
|
864 | - $codes = add_wpimg_options( $codes ); |
|
865 | - $codes = add_wpimg_block_options( $codes ); |
|
866 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
867 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
863 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array(); |
|
864 | + $codes = add_wpimg_options($codes); |
|
865 | + $codes = add_wpimg_block_options($codes); |
|
866 | + $codes = apply_filters('lasso_custom_options', $codes); |
|
867 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
868 | 868 | |
869 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
869 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
870 | 870 | |
871 | 871 | $blob = array(); |
872 | 872 | |
873 | - if ( empty( $codes ) ) |
|
873 | + if (empty($codes)) |
|
874 | 874 | return; |
875 | 875 | |
876 | - foreach ( $codes as $slug => $shortcode ) { |
|
876 | + foreach ($codes as $slug => $shortcode) { |
|
877 | 877 | $return = ''; |
878 | 878 | // Shortcode has atts |
879 | 879 | |
880 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
880 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
881 | 881 | |
882 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
882 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
883 | 883 | |
884 | 884 | |
885 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
885 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
886 | 886 | |
887 | 887 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
888 | 888 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
889 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
889 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
890 | 890 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
891 | 891 | // Select |
892 | 892 | |
893 | - if ( isset( $attr_info['values'] ) ) { |
|
893 | + if (isset($attr_info['values'])) { |
|
894 | 894 | |
895 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
895 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
896 | 896 | |
897 | - $i=0; |
|
897 | + $i = 0; |
|
898 | 898 | |
899 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
899 | + foreach ($attr_info['values'] as $attr_value) { |
|
900 | 900 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
901 | 901 | |
902 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
902 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
903 | 903 | |
904 | 904 | $i++; |
905 | 905 | } |
@@ -908,24 +908,24 @@ discard block |
||
908 | 908 | |
909 | 909 | } else { |
910 | 910 | |
911 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
911 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
912 | 912 | |
913 | 913 | // image upload |
914 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
914 | + if ('media_upload' == $attr_info['type']) { |
|
915 | 915 | |
916 | - $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.'" />'; |
|
916 | + $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.'" />'; |
|
917 | 917 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
918 | 918 | |
919 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
919 | + } elseif ('color' == $attr_info['type']) { |
|
920 | 920 | |
921 | - $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.'" />'; |
|
921 | + $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.'" />'; |
|
922 | 922 | |
923 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
923 | + } elseif ('text_area' == $attr_info['type']) { |
|
924 | 924 | |
925 | - $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.''; |
|
925 | + $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.''; |
|
926 | 926 | |
927 | 927 | } else { |
928 | - $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.''; |
|
928 | + $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.''; |
|
929 | 929 | } |
930 | 930 | } |
931 | 931 | $return .= '</p>'; |
@@ -936,9 +936,9 @@ discard block |
||
936 | 936 | /////////////////////////// |
937 | 937 | // START GALLERY AND MAP FRONT END STUFFS |
938 | 938 | /////////////////////////// |
939 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
939 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
940 | 940 | |
941 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
941 | + if ('gallery' == $shortcode['front_type']) { |
|
942 | 942 | |
943 | 943 | $return .= lasso_gallery_editor_module(); |
944 | 944 | |
@@ -949,13 +949,13 @@ discard block |
||
949 | 949 | /////////////////////////// |
950 | 950 | |
951 | 951 | // Single shortcode (not closed) |
952 | - if ( 'single' == $shortcode['type'] ) { |
|
952 | + if ('single' == $shortcode['type']) { |
|
953 | 953 | |
954 | 954 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
955 | 955 | |
956 | 956 | } else { |
957 | 957 | |
958 | - $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>'; |
|
958 | + $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>'; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | $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>'; |
@@ -975,95 +975,95 @@ discard block |
||
975 | 975 | } |
976 | 976 | |
977 | 977 | |
978 | -function add_wpimg_options( $shortcodes ) { |
|
978 | +function add_wpimg_options($shortcodes) { |
|
979 | 979 | $custom = array( |
980 | 980 | 'wpimg' => array( |
981 | - 'name' => __( 'Image', 'lasso' ), |
|
981 | + 'name' => __('Image', 'lasso'), |
|
982 | 982 | 'type' => 'single', |
983 | 983 | 'atts' => array( |
984 | 984 | 'img' => array( |
985 | 985 | 'type' => 'media_upload', |
986 | 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' ) |
|
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 | 989 | ), |
990 | 990 | 'align' => array( |
991 | 991 | 'type' => 'select', |
992 | 992 | 'values' => array( |
993 | 993 | array( |
994 | 994 | 'value' => 'center', |
995 | - 'name' => __( 'Center', 'aesop-core' ) |
|
995 | + 'name' => __('Center', 'aesop-core') |
|
996 | 996 | ), |
997 | 997 | array( |
998 | 998 | 'value' => 'left', |
999 | - 'name' => __( 'Left', 'aesop-core' ) |
|
999 | + 'name' => __('Left', 'aesop-core') |
|
1000 | 1000 | ), |
1001 | 1001 | array( |
1002 | 1002 | 'value' => 'right', |
1003 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1003 | + 'name' => __('Right', 'aesop-core') |
|
1004 | 1004 | ), |
1005 | 1005 | ), |
1006 | 1006 | 'default' => 'center', |
1007 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1007 | + 'desc' => __('Alignment', 'lasso'), |
|
1008 | 1008 | 'tip'=>'' |
1009 | 1009 | ), |
1010 | 1010 | |
1011 | 1011 | 'imgwidth' => array( |
1012 | 1012 | 'type' => 'text_small', |
1013 | 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' ) |
|
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 | 1016 | ), |
1017 | 1017 | 'imgheight' => array( |
1018 | 1018 | 'type' => 'text_small', |
1019 | 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' ) |
|
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 | 1022 | ), |
1023 | 1023 | 'linkoption' => array( |
1024 | 1024 | 'type' => 'select', |
1025 | 1025 | 'values' => array( |
1026 | 1026 | array( |
1027 | 1027 | 'value' => 'none', |
1028 | - 'name' => __( 'None', 'aesop-core' ) |
|
1028 | + 'name' => __('None', 'aesop-core') |
|
1029 | 1029 | ), |
1030 | 1030 | array( |
1031 | 1031 | 'value' => 'img', |
1032 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1032 | + 'name' => __('Image', 'aesop-core') |
|
1033 | 1033 | ), |
1034 | 1034 | array( |
1035 | 1035 | 'value' => 'url', |
1036 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1036 | + 'name' => __('URL', 'aesop-core') |
|
1037 | 1037 | ), |
1038 | 1038 | ), |
1039 | 1039 | 'default' => 'none', |
1040 | - 'desc' => __( 'Link', 'lasso' ), |
|
1041 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1040 | + 'desc' => __('Link', 'lasso'), |
|
1041 | + 'tip' => __('Click leads to:', 'lasso') |
|
1042 | 1042 | ), |
1043 | 1043 | |
1044 | 1044 | 'link' => array( |
1045 | 1045 | 'type' => 'text', |
1046 | 1046 | 'default' => '', |
1047 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1048 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1047 | + 'desc' => __('URL Link', 'lasso'), |
|
1048 | + 'tip' => __('URL link', 'lasso') |
|
1049 | 1049 | ), |
1050 | 1050 | 'alt' => array( |
1051 | 1051 | 'type' => 'text', |
1052 | 1052 | 'default' => '', |
1053 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1054 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1053 | + 'desc' => __('Image ALT', 'lasso'), |
|
1054 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1055 | 1055 | ), |
1056 | 1056 | |
1057 | 1057 | 'caption' => array( |
1058 | 1058 | 'type' => 'text_area', |
1059 | 1059 | 'default' => '', |
1060 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1061 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1060 | + 'desc' => __('Caption', 'lasso'), |
|
1061 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
1062 | 1062 | ), |
1063 | 1063 | |
1064 | 1064 | |
1065 | 1065 | ), |
1066 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1066 | + 'desc' => __('An image.', 'aesop-core'), |
|
1067 | 1067 | 'codes' => '<script> |
1068 | 1068 | jQuery(document).ready(function($){ |
1069 | 1069 | function linkSetting(l){ |
@@ -1087,57 +1087,57 @@ discard block |
||
1087 | 1087 | ) |
1088 | 1088 | ); |
1089 | 1089 | |
1090 | - return array_merge( $shortcodes, $custom ); |
|
1090 | + return array_merge($shortcodes, $custom); |
|
1091 | 1091 | } |
1092 | 1092 | |
1093 | -function add_wpimg_block_options( $shortcodes ) { |
|
1093 | +function add_wpimg_block_options($shortcodes) { |
|
1094 | 1094 | $custom = array( |
1095 | 1095 | 'wpimg-block' => array( |
1096 | - 'name' => __( 'Image', 'lasso' ), |
|
1096 | + 'name' => __('Image', 'lasso'), |
|
1097 | 1097 | 'type' => 'single', |
1098 | 1098 | 'atts' => array( |
1099 | 1099 | 'img' => array( |
1100 | 1100 | 'type' => 'media_upload', |
1101 | 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' ) |
|
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 | 1104 | ), |
1105 | 1105 | 'align' => array( |
1106 | 1106 | 'type' => 'select', |
1107 | 1107 | 'values' => array( |
1108 | 1108 | array( |
1109 | 1109 | 'value' => 'center', |
1110 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1110 | + 'name' => __('Center', 'aesop-core') |
|
1111 | 1111 | ), |
1112 | 1112 | array( |
1113 | 1113 | 'value' => 'left', |
1114 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1114 | + 'name' => __('Left', 'aesop-core') |
|
1115 | 1115 | ), |
1116 | 1116 | array( |
1117 | 1117 | 'value' => 'right', |
1118 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1118 | + 'name' => __('Right', 'aesop-core') |
|
1119 | 1119 | ), |
1120 | 1120 | ), |
1121 | 1121 | 'default' => 'center', |
1122 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1122 | + 'desc' => __('Alignment', 'lasso'), |
|
1123 | 1123 | 'tip'=>'' |
1124 | 1124 | ), |
1125 | 1125 | 'alt' => array( |
1126 | 1126 | 'type' => 'text', |
1127 | 1127 | 'default' => '', |
1128 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1129 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1128 | + 'desc' => __('Image ALT', 'lasso'), |
|
1129 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1130 | 1130 | ), |
1131 | 1131 | 'caption' => array( |
1132 | 1132 | 'type' => 'text', |
1133 | 1133 | 'default' => '', |
1134 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1135 | - 'tip' => __( 'Caption for the image.', 'lasso' ) |
|
1134 | + 'desc' => __('Caption', 'lasso'), |
|
1135 | + 'tip' => __('Caption for the image.', 'lasso') |
|
1136 | 1136 | ), |
1137 | 1137 | |
1138 | 1138 | |
1139 | 1139 | ), |
1140 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1140 | + 'desc' => __('A WP Image Block.', 'aesop-core'), |
|
1141 | 1141 | 'codes' => '<script> |
1142 | 1142 | jQuery(document).ready(function($){ |
1143 | 1143 | |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | ) |
1147 | 1147 | ); |
1148 | 1148 | |
1149 | - return array_merge( $shortcodes, $custom ); |
|
1149 | + return array_merge($shortcodes, $custom); |
|
1150 | 1150 | } |
1151 | 1151 | |
1152 | 1152 | /** |
@@ -1166,14 +1166,14 @@ discard block |
||
1166 | 1166 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
1167 | 1167 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
1168 | 1168 | <i class="lasso-icon lasso-icon-move"></i> |
1169 | - <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> |
|
1169 | + <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> |
|
1170 | 1170 | <div class="lasso--slider_wrap"> |
1171 | 1171 | <div id="lasso--slider"></div> |
1172 | 1172 | </div> |
1173 | 1173 | <ul id="lasso--revision-list"></ul> |
1174 | 1174 | <div class="lasso--btn-group lasso--btn-group-small"> |
1175 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
1176 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
1175 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
1176 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
1177 | 1177 | </div> |
1178 | 1178 | </div> |
1179 | 1179 | |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | // Normalize into a six character long hex string |
1197 | 1197 | $hex = str_replace('#', '', $hex); |
1198 | 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); |
|
1199 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
1200 | 1200 | } |
1201 | 1201 | |
1202 | 1202 | // Split into three parts: R, G and B |
@@ -1205,7 +1205,7 @@ discard block |
||
1205 | 1205 | |
1206 | 1206 | foreach ($color_parts as $color) { |
1207 | 1207 | $color = hexdec($color); // Convert to decimal |
1208 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1208 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
1209 | 1209 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
1210 | 1210 | } |
1211 | 1211 |
@@ -15,21 +15,21 @@ |
||
15 | 15 | * |
16 | 16 | * @param array $fields |
17 | 17 | */ |
18 | - public function __construct( $fields ) { |
|
18 | + public function __construct($fields) { |
|
19 | 19 | $this->fields = $fields; |
20 | - add_filter( 'lasso_api_params', function( $params ) { |
|
21 | - foreach( $this->fields as $field => $cbs ) { |
|
20 | + add_filter('lasso_api_params', function($params) { |
|
21 | + foreach ($this->fields as $field => $cbs) { |
|
22 | 22 | //$field = lasso_clean_string( $field ); |
23 | - $params[ 'process_meta_update' ][ $field ] = $cbs; |
|
23 | + $params['process_meta_update'][$field] = $cbs; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return $params; |
27 | 27 | |
28 | 28 | }); |
29 | 29 | |
30 | - add_filter( 'lasso_meta_fields', function( $allowed ) { |
|
30 | + add_filter('lasso_meta_fields', function($allowed) { |
|
31 | 31 | |
32 | - foreach( array_keys( $this->fields ) as $field ) { |
|
32 | + foreach (array_keys($this->fields) as $field) { |
|
33 | 33 | //$field = lasso_clean_string( $field ); |
34 | 34 | $allowed[] = $field; |
35 | 35 |
@@ -119,8 +119,9 @@ discard block |
||
119 | 119 | |
120 | 120 | ob_start(); |
121 | 121 | |
122 | - if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) |
|
123 | - return; |
|
122 | + if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) { |
|
123 | + return; |
|
124 | + } |
|
124 | 125 | |
125 | 126 | $nonce = wp_create_nonce('lasso-process-post-meta'); |
126 | 127 | $key = sprintf('_lasso_%s_settings', $name ); |
@@ -198,8 +199,9 @@ discard block |
||
198 | 199 | $before = '<div class="lasso--postsettings__option">'; |
199 | 200 | $after = '</div>'; |
200 | 201 | |
201 | - if ( empty( $name ) || empty( $options ) ) |
|
202 | - return; |
|
202 | + if ( empty( $name ) || empty( $options ) ) { |
|
203 | + return; |
|
204 | + } |
|
203 | 205 | |
204 | 206 | foreach ( (array) $options as $option ) { |
205 | 207 | |
@@ -225,8 +227,9 @@ discard block |
||
225 | 227 | */ |
226 | 228 | function lasso_option_engine_option( $name = '', $option = '', $type = '') { |
227 | 229 | |
228 | - if ( empty( $type ) || empty( $option ) ) |
|
229 | - return; |
|
230 | + if ( empty( $type ) || empty( $option ) ) { |
|
231 | + return; |
|
232 | + } |
|
230 | 233 | |
231 | 234 | $id = isset( $option['id'] ) ? $option['id'] : false; |
232 | 235 | //$id = $id ? lasso_clean_string( $id ) : false; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Get an array of addon data for the settings modal |
44 | 44 | * @since 0.9.4 |
45 | 45 | */ |
46 | -function lasso_get_modal_tabs(){ |
|
46 | +function lasso_get_modal_tabs() { |
|
47 | 47 | |
48 | 48 | $tabs = array(); |
49 | 49 | |
@@ -60,34 +60,34 @@ discard block |
||
60 | 60 | * @uses lasso_modal_addons_content() |
61 | 61 | * @since 0.9.4 |
62 | 62 | */ |
63 | -function lasso_modal_addons( $type = 'tab' ){ |
|
63 | +function lasso_modal_addons($type = 'tab') { |
|
64 | 64 | |
65 | 65 | $tabs = lasso_get_modal_tabs(); |
66 | 66 | $out = ''; |
67 | 67 | |
68 | - if ( $tabs ): |
|
68 | + if ($tabs): |
|
69 | 69 | |
70 | - if ( 'tab' == $type ) { |
|
70 | + if ('tab' == $type) { |
|
71 | 71 | |
72 | 72 | $out = '<ul class="lasso--modal__tabs">'; |
73 | 73 | |
74 | 74 | $out .= '<li class="active-tab" data-addon-name="core">Editus</li>'; |
75 | 75 | |
76 | - foreach ( $tabs as $tab ) { |
|
76 | + foreach ($tabs as $tab) { |
|
77 | 77 | |
78 | - if ( isset( $tab ) ) { |
|
78 | + if (isset($tab)) { |
|
79 | 79 | |
80 | - $out .= lasso_modal_addons_content( $tab, $type ); |
|
80 | + $out .= lasso_modal_addons_content($tab, $type); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | $out .= '</ul>'; |
85 | 85 | |
86 | - } elseif ( 'content' == $type ) { |
|
87 | - foreach ( $tabs as $tab ) { |
|
86 | + } elseif ('content' == $type) { |
|
87 | + foreach ($tabs as $tab) { |
|
88 | 88 | |
89 | - if ( isset( $tab ) ) { |
|
90 | - $out .= lasso_modal_addons_content( $tab , $type ); |
|
89 | + if (isset($tab)) { |
|
90 | + $out .= lasso_modal_addons_content($tab, $type); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | endif; |
97 | 97 | |
98 | - return !empty( $out ) ? $out : false; |
|
98 | + return !empty($out) ? $out : false; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -115,26 +115,26 @@ discard block |
||
115 | 115 | * @since 0.9.5 |
116 | 116 | * @subpackage lasso_modal_addons_content |
117 | 117 | */ |
118 | -function lasso_option_form( $name = '', $options = array() ){ |
|
118 | +function lasso_option_form($name = '', $options = array()) { |
|
119 | 119 | |
120 | 120 | ob_start(); |
121 | 121 | |
122 | - if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) |
|
122 | + if (empty($name) || empty($options) || !is_array($options)) |
|
123 | 123 | return; |
124 | 124 | |
125 | 125 | $nonce = wp_create_nonce('lasso-process-post-meta'); |
126 | - $key = sprintf('_lasso_%s_settings', $name ); |
|
126 | + $key = sprintf('_lasso_%s_settings', $name); |
|
127 | 127 | |
128 | - $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">' ); |
|
128 | + $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">'); |
|
129 | 129 | |
130 | - $out .= lasso_option_fields( $name, $options ); |
|
131 | - $out .='<div class="form--bottom">'; |
|
132 | - $out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">'; |
|
133 | - $out .='<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | - $out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | - $out .='<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | - $out .='<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | - $out .='</div>'; |
|
130 | + $out .= lasso_option_fields($name, $options); |
|
131 | + $out .= '<div class="form--bottom">'; |
|
132 | + $out .= '<input type="submit" value="'.__('Save', 'lasso').'">'; |
|
133 | + $out .= '<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | + $out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | + $out .= '<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | + $out .= '<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | + $out .= '</div>'; |
|
138 | 138 | |
139 | 139 | $out .= '</form>'; |
140 | 140 | |
@@ -192,20 +192,20 @@ discard block |
||
192 | 192 | * @since 0.9.5 |
193 | 193 | * @subpackage lasso_modal_addons_content |
194 | 194 | */ |
195 | -function lasso_option_fields( $name = '', $options = array() ){ |
|
195 | +function lasso_option_fields($name = '', $options = array()) { |
|
196 | 196 | |
197 | - $out = ''; |
|
197 | + $out = ''; |
|
198 | 198 | $before = '<div class="lasso--postsettings__option">'; |
199 | 199 | $after = '</div>'; |
200 | 200 | |
201 | - if ( empty( $name ) || empty( $options ) ) |
|
201 | + if (empty($name) || empty($options)) |
|
202 | 202 | return; |
203 | 203 | |
204 | - foreach ( (array) $options as $option ) { |
|
204 | + foreach ((array) $options as $option) { |
|
205 | 205 | |
206 | - $type = isset( $option['type'] ) ? $option['type'] : 'text'; |
|
206 | + $type = isset($option['type']) ? $option['type'] : 'text'; |
|
207 | 207 | |
208 | - $out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,$type ), $after ); |
|
208 | + $out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, $type), $after); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | |
@@ -223,44 +223,44 @@ discard block |
||
223 | 223 | * @param $type string text, textarea, checkbox, color |
224 | 224 | * @since 5.0 |
225 | 225 | */ |
226 | -function lasso_option_engine_option( $name = '', $option = '', $type = '') { |
|
226 | +function lasso_option_engine_option($name = '', $option = '', $type = '') { |
|
227 | 227 | |
228 | - if ( empty( $type ) || empty( $option ) ) |
|
228 | + if (empty($type) || empty($option)) |
|
229 | 229 | return; |
230 | 230 | |
231 | - $id = isset( $option['id'] ) ? $option['id'] : false; |
|
231 | + $id = isset($option['id']) ? $option['id'] : false; |
|
232 | 232 | //$id = $id ? lasso_clean_string( $id ) : false; |
233 | 233 | |
234 | - $desc = isset( $option['desc'] ) ? $option['desc'] : false; |
|
234 | + $desc = isset($option['desc']) ? $option['desc'] : false; |
|
235 | 235 | |
236 | - $value = get_post_meta( get_the_id(), $option[ 'id' ], true ); |
|
236 | + $value = get_post_meta(get_the_id(), $option['id'], true); |
|
237 | 237 | |
238 | - switch ( $type ) { |
|
238 | + switch ($type) { |
|
239 | 239 | case 'text': |
240 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value ); |
|
240 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value); |
|
241 | 241 | break; |
242 | 242 | case 'textarea': |
243 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value ); |
|
243 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value); |
|
244 | 244 | break; |
245 | 245 | case 'imgurl': |
246 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id, $value ); |
|
246 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value); |
|
247 | 247 | break; |
248 | 248 | case 'checkbox': |
249 | - $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) ); |
|
249 | + $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc)); |
|
250 | 250 | break; |
251 | 251 | case 'dropdown': |
252 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">',$id, esc_html( $desc ), $id, $id); |
|
252 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">', $id, esc_html($desc), $id, $id); |
|
253 | 253 | $options = explode(";", $option['options']); |
254 | 254 | foreach ($options as &$opt) { |
255 | 255 | $opts = explode(":", $opt); |
256 | 256 | if ($opts[0] == $value) { |
257 | - $out .= sprintf('<option value = "%s" selected>%s</option>',$opts[0], $opts[1]); |
|
257 | + $out .= sprintf('<option value = "%s" selected>%s</option>', $opts[0], $opts[1]); |
|
258 | 258 | } else { |
259 | - $out .= sprintf('<option value = "%s">%s</option>',$opts[0], $opts[1]); |
|
259 | + $out .= sprintf('<option value = "%s">%s</option>', $opts[0], $opts[1]); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - $out .='</select>'; |
|
263 | + $out .= '</select>'; |
|
264 | 264 | break; |
265 | 265 | } |
266 | 266 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | // udpate start point |
48 | - $point = json_decode( $start_point, true ); |
|
48 | + $point = json_decode( $start_point, true ); |
|
49 | 49 | update_post_meta( $postid, 'ase_map_component_start_point', $point ); |
50 | 50 | |
51 | 51 | // update zoom |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function save( $data ) { |
|
31 | + public function save($data) { |
|
32 | 32 | |
33 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
34 | - $locations = isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false; |
|
35 | - $start_point = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false; |
|
36 | - $zoom = isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false; |
|
33 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
34 | + $locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false; |
|
35 | + $start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false; |
|
36 | + $zoom = isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false; |
|
37 | 37 | |
38 | - if ( is_array( $locations ) ) { |
|
39 | - delete_post_meta( $postid, 'ase_map_component_locations' ); |
|
38 | + if (is_array($locations)) { |
|
39 | + delete_post_meta($postid, 'ase_map_component_locations'); |
|
40 | 40 | |
41 | 41 | // update locations if set |
42 | - foreach ( $locations as $location ) { |
|
43 | - $point = json_decode( urldecode( $location ), true ); |
|
44 | - add_post_meta( $postid, 'ase_map_component_locations', $point ); |
|
42 | + foreach ($locations as $location) { |
|
43 | + $point = json_decode(urldecode($location), true); |
|
44 | + add_post_meta($postid, 'ase_map_component_locations', $point); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // udpate start point |
48 | - $point = json_decode( $start_point, true ); |
|
49 | - update_post_meta( $postid, 'ase_map_component_start_point', $point ); |
|
48 | + $point = json_decode($start_point, true); |
|
49 | + update_post_meta($postid, 'ase_map_component_start_point', $point); |
|
50 | 50 | |
51 | 51 | // update zoom |
52 | - update_post_meta( $postid, 'ase_map_component_zoom', $zoom ); |
|
52 | + update_post_meta($postid, 'ase_map_component_zoom', $zoom); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return true; |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
65 | 65 | */ |
66 | - public static function params(){ |
|
67 | - $params[ 'process_map_save' ] = array( |
|
66 | + public static function params() { |
|
67 | + $params['process_map_save'] = array( |
|
68 | 68 | 'postid' => 'absint', |
69 | 69 | 'ase-map-component-locations' => 'lasso_sanitize_data', |
70 | 70 | 'ase-map-component-start-point' => array( |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return array Array of additional functions to use to authorize action. |
89 | 89 | */ |
90 | 90 | public static function auth_callbacks() { |
91 | - $params[ 'process_map_save' ] = array( |
|
91 | + $params['process_map_save'] = array( |
|
92 | 92 | 'lasso_user_can' |
93 | 93 | ); |
94 | 94 |
@@ -19,7 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | global $post; |
21 | 21 | $pos = strpos($post->post_content, "<!--nextpage-->"); |
22 | - if (!$pos) return -1; |
|
22 | + if (!$pos) { |
|
23 | + return -1; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | global $wp; |
25 | 27 | $url = home_url( $wp->request ); |
@@ -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 |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $tz_offset = get_UTC_offset(); |
133 | 133 | $post_date = get_the_time('U', $postid); |
134 | 134 | $time = (time()+$tz_offset); |
135 | - $delta = $time - $post_date; |
|
135 | + $delta = $time - $post_date; |
|
136 | 136 | |
137 | 137 | $strings = array( |
138 | 138 | 'save' => __('Save','lasso'), |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
188 | 188 | |
189 | 189 | |
190 | - if ($allow_change_date) { |
|
191 | - $permalink = get_site_url().'/?p='.$postid; |
|
192 | - } else { |
|
193 | - $permalink = get_permalink($postid); |
|
194 | - } |
|
190 | + if ($allow_change_date) { |
|
191 | + $permalink = get_site_url().'/?p='.$postid; |
|
192 | + } else { |
|
193 | + $permalink = get_permalink($postid); |
|
194 | + } |
|
195 | 195 | |
196 | 196 | // rest api |
197 | 197 | $rest_nonce = ''; |
@@ -211,17 +211,17 @@ discard block |
||
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
214 | - //excerpt |
|
215 | - $post_excerpt = ""; |
|
216 | - $post_excerpt = $post->post_excerpt; |
|
214 | + //excerpt |
|
215 | + $post_excerpt = ""; |
|
216 | + $post_excerpt = $post->post_excerpt; |
|
217 | 217 | |
218 | - //find if this is multi page. -1 if not |
|
219 | - $multipage = self::is_multipage(); |
|
220 | - $post_content = ""; |
|
221 | - //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
222 | - //if ($multipage != -1) { |
|
223 | - $post_content = $post->post_content; |
|
224 | - //} |
|
218 | + //find if this is multi page. -1 if not |
|
219 | + $multipage = self::is_multipage(); |
|
220 | + $post_content = ""; |
|
221 | + //pass post_content if we need to process multipage. In future we may need to pass this for other purposes |
|
222 | + //if ($multipage != -1) { |
|
223 | + $post_content = $post->post_content; |
|
224 | + //} |
|
225 | 225 | |
226 | 226 | // localized objects |
227 | 227 | $objects = array( |
@@ -298,18 +298,18 @@ discard block |
||
298 | 298 | 'customFields' => $custom_fields, |
299 | 299 | 'clickToInsert' => ($insert_comp_ui =='click'), |
300 | 300 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
301 | - 'rtl' => is_rtl(), |
|
301 | + 'rtl' => is_rtl(), |
|
302 | 302 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
303 | 303 | 'linksEditable' => $links_editable, |
304 | 304 | 'supportPendingStatus' => !$no_pending_status, |
305 | 305 | '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>'), |
306 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
307 | - 'multipages'=> $multipage, |
|
308 | - 'post_content'=>$post_content, |
|
309 | - 'post_excerpt'=>$post_excerpt, |
|
310 | - 'oldWPimg'=> $use_old_wpimg =='on', |
|
311 | - 'useWPImgBlk'=> $use_wpimgblock, |
|
312 | - 'prefixHTTP'=> $link_prefix_http =='on' |
|
306 | + 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
307 | + 'multipages'=> $multipage, |
|
308 | + 'post_content'=>$post_content, |
|
309 | + 'post_excerpt'=>$post_excerpt, |
|
310 | + 'oldWPimg'=> $use_old_wpimg =='on', |
|
311 | + 'useWPImgBlk'=> $use_wpimgblock, |
|
312 | + 'prefixHTTP'=> $link_prefix_http =='on' |
|
313 | 313 | ); |
314 | 314 | |
315 | 315 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | |
319 | 319 | if (!$using_restapiv2) { |
320 | - // enqueue REST API V1 |
|
320 | + // enqueue REST API V1 |
|
321 | 321 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
322 | 322 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
323 | 323 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | if ($show_color) { |
334 | 334 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
335 | 335 | } else { |
336 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
336 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
337 | 337 | } |
338 | 338 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
339 | 339 | |
@@ -342,44 +342,44 @@ discard block |
||
342 | 342 | |
343 | 343 | } |
344 | 344 | |
345 | - function gutenberg_active() { |
|
345 | + function gutenberg_active() { |
|
346 | 346 | |
347 | - // Gutenberg plugin is installed and activated. |
|
348 | - $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
349 | - |
|
350 | - // Block editor since 5.0. |
|
351 | - $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
352 | - |
|
353 | - if ( ! $gutenberg && ! $block_editor ) { |
|
354 | - return false; |
|
355 | - } |
|
356 | - |
|
357 | - if ( self::is_classic_editor_plugin_active() ) { |
|
358 | - $editor_option = get_option( 'classic-editor-replace' ); |
|
359 | - $block_editor_active = array( 'no-replace', 'block' ); |
|
360 | - |
|
361 | - return in_array( $editor_option, $block_editor_active, true ); |
|
362 | - } |
|
363 | - |
|
364 | - return true; |
|
365 | - } |
|
366 | - |
|
367 | - /** |
|
368 | - * Check if Classic Editor plugin is active. |
|
369 | - * |
|
370 | - * @return bool |
|
371 | - */ |
|
372 | - function is_classic_editor_plugin_active() { |
|
373 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
374 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
375 | - } |
|
376 | - |
|
377 | - if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
378 | - return true; |
|
379 | - } |
|
380 | - |
|
381 | - return false; |
|
382 | - } |
|
347 | + // Gutenberg plugin is installed and activated. |
|
348 | + $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
349 | + |
|
350 | + // Block editor since 5.0. |
|
351 | + $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
352 | + |
|
353 | + if ( ! $gutenberg && ! $block_editor ) { |
|
354 | + return false; |
|
355 | + } |
|
356 | + |
|
357 | + if ( self::is_classic_editor_plugin_active() ) { |
|
358 | + $editor_option = get_option( 'classic-editor-replace' ); |
|
359 | + $block_editor_active = array( 'no-replace', 'block' ); |
|
360 | + |
|
361 | + return in_array( $editor_option, $block_editor_active, true ); |
|
362 | + } |
|
363 | + |
|
364 | + return true; |
|
365 | + } |
|
366 | + |
|
367 | + /** |
|
368 | + * Check if Classic Editor plugin is active. |
|
369 | + * |
|
370 | + * @return bool |
|
371 | + */ |
|
372 | + function is_classic_editor_plugin_active() { |
|
373 | + if ( ! function_exists( 'is_plugin_active' ) ) { |
|
374 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
375 | + } |
|
376 | + |
|
377 | + if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
378 | + return true; |
|
379 | + } |
|
380 | + |
|
381 | + return false; |
|
382 | + } |
|
383 | 383 | |
384 | 384 | } |
385 | 385 |
@@ -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 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | |
112 | 112 | if ($show_color) { |
113 | 113 | //color picker |
114 | - wp_enqueue_style( 'wp-color-picker' ); |
|
115 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
114 | + wp_enqueue_style('wp-color-picker'); |
|
115 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | // click to insert components, not drag and drop |
@@ -124,54 +124,54 @@ discard block |
||
124 | 124 | |
125 | 125 | // custom fields |
126 | 126 | |
127 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); |
|
127 | + $custom_fields = apply_filters('editus_custom_fields', null); |
|
128 | 128 | |
129 | 129 | |
130 | 130 | // post id reference |
131 | 131 | $postid = get_the_ID(); |
132 | 132 | $tz_offset = get_UTC_offset(); |
133 | 133 | $post_date = get_the_time('U', $postid); |
134 | - $time = (time()+$tz_offset); |
|
134 | + $time = (time() + $tz_offset); |
|
135 | 135 | $delta = $time - $post_date; |
136 | 136 | |
137 | 137 | $strings = array( |
138 | - 'save' => __('Save','lasso'), |
|
139 | - 'selectText' => __('Please Select Text First.','lasso'), |
|
140 | - 'cancel' => __('Cancel','lasso'), |
|
141 | - 'exiteditor' => __('Exit Editor','lasso'), |
|
142 | - 'saving' => __('Saving...','lasso'), |
|
143 | - 'saved' => __('Saved!','lasso'), |
|
144 | - 'adding' => __('Adding...','lasso'), |
|
145 | - 'added' => __('Added!','lasso'), |
|
146 | - 'loading' => __('Loading...','lasso'), |
|
147 | - 'loadMore' => __('Load More','lasso'), |
|
148 | - 'close' => __('Close','lasso'), |
|
149 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
150 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
151 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
152 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
153 | - 'justWrite' => __('Just write...','lasso'), |
|
154 | - 'chooseImage' => __('Choose an image','lasso'), |
|
155 | - 'updateImage' => __('Update Image','lasso'), |
|
156 | - 'insertImage' => __('Insert Image','lasso'), |
|
157 | - 'selectImage' => __('Select Image','lasso'), |
|
158 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
159 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
160 | - 'chooseImages' => __('Choose images','lasso'), |
|
161 | - 'editImage' => __('Edit Image','lasso'), |
|
162 | - 'addImages' => __('Add Images','lasso'), |
|
163 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
164 | - 'selectGallery' => __('Select Editus Gallery Image','lasso'), |
|
165 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
166 | - 'publishPost' => __('Publish Post?','lasso'), |
|
167 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
168 | - 'deletePost' => __('Trash Post?','lasso'), |
|
169 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
170 | - 'warning' => __('Oh snap!','laso'), |
|
171 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
172 | - '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'), |
|
138 | + 'save' => __('Save', 'lasso'), |
|
139 | + 'selectText' => __('Please Select Text First.', 'lasso'), |
|
140 | + 'cancel' => __('Cancel', 'lasso'), |
|
141 | + 'exiteditor' => __('Exit Editor', 'lasso'), |
|
142 | + 'saving' => __('Saving...', 'lasso'), |
|
143 | + 'saved' => __('Saved!', 'lasso'), |
|
144 | + 'adding' => __('Adding...', 'lasso'), |
|
145 | + 'added' => __('Added!', 'lasso'), |
|
146 | + 'loading' => __('Loading...', 'lasso'), |
|
147 | + 'loadMore' => __('Load More', 'lasso'), |
|
148 | + 'close' => __('Close', 'lasso'), |
|
149 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
150 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
151 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
152 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
153 | + 'justWrite' => __('Just write...', 'lasso'), |
|
154 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
155 | + 'updateImage' => __('Update Image', 'lasso'), |
|
156 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
157 | + 'selectImage' => __('Select Image', 'lasso'), |
|
158 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
159 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
160 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
161 | + 'editImage' => __('Edit Image', 'lasso'), |
|
162 | + 'addImages' => __('Add Images', 'lasso'), |
|
163 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
164 | + 'selectGallery' => __('Select Editus Gallery Image', 'lasso'), |
|
165 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
166 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
167 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
168 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
169 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
170 | + 'warning' => __('Oh snap!', 'laso'), |
|
171 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
172 | + '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'), |
|
173 | 173 | 'missingConfirm' => __('Update Settings', 'lasso'), |
174 | - 'helperText' => __('one more letter','lasso'), |
|
174 | + 'helperText' => __('one more letter', 'lasso'), |
|
175 | 175 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
176 | 176 | |
177 | 177 | 'catsPlaceholder' => __('add categories...'), |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | ); |
182 | 182 | |
183 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
183 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
184 | 184 | |
185 | 185 | $gallery_class = new gallery(); |
186 | 186 | $gallery_nonce_action = $gallery_class->nonce_action; |
187 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
187 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
188 | 188 | |
189 | 189 | |
190 | 190 | if ($allow_change_date) { |
@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | |
200 | 200 | if (function_exists('rest_url')) { |
201 | 201 | //$rest_root = esc_url_raw( rest_url()); |
202 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
203 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
204 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
205 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
206 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
202 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
203 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
204 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
205 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
206 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
207 | 207 | |
208 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
208 | + if (class_exists('WP_REST_Controller')) { |
|
209 | 209 | // we are using REST API V2 |
210 | 210 | $using_restapiv2 = true; |
211 | 211 | } |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | |
226 | 226 | // localized objects |
227 | 227 | $objects = array( |
228 | - 'ajaxurl' => esc_url( $api_url ), |
|
229 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
228 | + 'ajaxurl' => esc_url($api_url), |
|
229 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
230 | 230 | 'siteUrl' => site_url(), |
231 | 231 | 'rest_root' => $rest_root, |
232 | 232 | 'rest_nonce' => $rest_nonce, |
@@ -235,13 +235,13 @@ discard block |
||
235 | 235 | 'featImgClass' => $featImgClass, |
236 | 236 | 'titleClass' => $titleClass, |
237 | 237 | 'strings' => $strings, |
238 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
239 | - 'post_status' => get_post_status( $postid ), |
|
238 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
239 | + 'post_status' => get_post_status($postid), |
|
240 | 240 | 'postid' => $postid, |
241 | 241 | 'permalink' => $permalink, |
242 | 242 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
243 | 243 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
244 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
244 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
245 | 245 | 'can_publish' => is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'), |
246 | 246 | //'can_publish_posts' => current_user_can('publish_posts'), |
247 | 247 | //'can_publish_pages' => current_user_can('publish_pages'), |
@@ -278,38 +278,38 @@ discard block |
||
278 | 278 | 'postTags' => lasso_get_objects('tag'), |
279 | 279 | 'noResultsDiv' => lasso_editor_empty_results(), |
280 | 280 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
281 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
282 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
283 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
284 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
281 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
282 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
283 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
284 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
285 | 285 | 'revisionModal' => lasso_editor_revision_modal(), |
286 | 286 | 'isMobile' => wp_is_mobile(), |
287 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
287 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
288 | 288 | 'showColor' => $show_color, |
289 | 289 | 'showAlignment' => $show_align, |
290 | 290 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
291 | 291 | 'restapi2' => $using_restapiv2, |
292 | 292 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
293 | - 'newObjectContent' => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>', |
|
293 | + 'newObjectContent' => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>', |
|
294 | 294 | 'disableSavePost' => $save_to_post_disabled, |
295 | 295 | 'disableEditPost' => $edit_post_disabled, |
296 | 296 | 'boldTag' => $bold_tag, |
297 | 297 | 'iTag' => $i_tag, |
298 | 298 | 'customFields' => $custom_fields, |
299 | - 'clickToInsert' => ($insert_comp_ui =='click'), |
|
300 | - 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
|
299 | + 'clickToInsert' => ($insert_comp_ui == 'click'), |
|
300 | + 'buttonOnEmptyP' => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph |
|
301 | 301 | 'rtl' => is_rtl(), |
302 | - 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
|
302 | + 'skipToEdit' =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode |
|
303 | 303 | 'linksEditable' => $links_editable, |
304 | 304 | 'supportPendingStatus' => !$no_pending_status, |
305 | - '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>'), |
|
306 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) || self::gutenberg_active(),//, |
|
305 | + '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>'), |
|
306 | + 'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) || self::gutenberg_active(), //, |
|
307 | 307 | 'multipages'=> $multipage, |
308 | 308 | 'post_content'=>$post_content, |
309 | 309 | 'post_excerpt'=>$post_excerpt, |
310 | - 'oldWPimg'=> $use_old_wpimg =='on', |
|
310 | + 'oldWPimg'=> $use_old_wpimg == 'on', |
|
311 | 311 | 'useWPImgBlk'=> $use_wpimgblock, |
312 | - 'prefixHTTP'=> $link_prefix_http =='on' |
|
312 | + 'prefixHTTP'=> $link_prefix_http == 'on' |
|
313 | 313 | ); |
314 | 314 | |
315 | 315 | |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | |
319 | 319 | if (!$using_restapiv2) { |
320 | 320 | // enqueue REST API V1 |
321 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
322 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
323 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
321 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
322 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
323 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | if ($allow_change_date) { |
@@ -329,13 +329,13 @@ discard block |
||
329 | 329 | wp_enqueue_style('jquery-ui'); |
330 | 330 | } |
331 | 331 | |
332 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
332 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
333 | 333 | if ($show_color) { |
334 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
334 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
335 | 335 | } else { |
336 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
336 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
337 | 337 | } |
338 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
338 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
339 | 339 | |
340 | 340 | |
341 | 341 | } |
@@ -345,20 +345,20 @@ discard block |
||
345 | 345 | function gutenberg_active() { |
346 | 346 | |
347 | 347 | // Gutenberg plugin is installed and activated. |
348 | - $gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) ); |
|
348 | + $gutenberg = !(false === has_filter('replace_editor', 'gutenberg_init')); |
|
349 | 349 | |
350 | 350 | // Block editor since 5.0. |
351 | - $block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ); |
|
351 | + $block_editor = version_compare($GLOBALS['wp_version'], '5.0-beta', '>'); |
|
352 | 352 | |
353 | - if ( ! $gutenberg && ! $block_editor ) { |
|
353 | + if (!$gutenberg && !$block_editor) { |
|
354 | 354 | return false; |
355 | 355 | } |
356 | 356 | |
357 | - if ( self::is_classic_editor_plugin_active() ) { |
|
358 | - $editor_option = get_option( 'classic-editor-replace' ); |
|
359 | - $block_editor_active = array( 'no-replace', 'block' ); |
|
357 | + if (self::is_classic_editor_plugin_active()) { |
|
358 | + $editor_option = get_option('classic-editor-replace'); |
|
359 | + $block_editor_active = array('no-replace', 'block'); |
|
360 | 360 | |
361 | - return in_array( $editor_option, $block_editor_active, true ); |
|
361 | + return in_array($editor_option, $block_editor_active, true); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | return true; |
@@ -370,11 +370,11 @@ discard block |
||
370 | 370 | * @return bool |
371 | 371 | */ |
372 | 372 | function is_classic_editor_plugin_active() { |
373 | - if ( ! function_exists( 'is_plugin_active' ) ) { |
|
374 | - include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
373 | + if (!function_exists('is_plugin_active')) { |
|
374 | + include_once ABSPATH.'wp-admin/includes/plugin.php'; |
|
375 | 375 | } |
376 | 376 | |
377 | - if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) { |
|
377 | + if (is_plugin_active('classic-editor/classic-editor.php')) { |
|
378 | 378 | return true; |
379 | 379 | } |
380 | 380 |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | ob_start(); |
13 | 13 | |
14 | - if ( $galleries ) { ?> |
|
14 | + if ($galleries) { ?> |
|
15 | 15 | |
16 | - <?php if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
16 | + <?php if (lasso_user_can('publish_posts')): ?> |
|
17 | 17 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important"> |
18 | 18 | <div class="ase-gallery-opts--single lasso-option"> |
19 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a> |
|
19 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a> |
|
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | <?php endif; ?> |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | <div class="ase-gallery-opts ase-gallery-opts--edit-gallery" > |
25 | 25 | <div class="ase-gallery-opts--single lasso-option"> |
26 | 26 | |
27 | - <label><?php _e( 'Manage Images', 'lasso' );?> |
|
28 | - <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a> |
|
27 | + <label><?php _e('Manage Images', 'lasso'); ?> |
|
28 | + <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a> |
|
29 | 29 | |
30 | 30 | </label> |
31 | - <small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small> |
|
31 | + <small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small> |
|
32 | 32 | |
33 | 33 | <div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div> |
34 | 34 | |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | |
39 | 39 | <?php } |
40 | 40 | |
41 | - if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
41 | + if (lasso_user_can('publish_posts')): ?> |
|
42 | 42 | |
43 | 43 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery2" style="display:none;"> |
44 | 44 | |
45 | 45 | <div class="ase-gallery-opts--single lasso-option"> |
46 | 46 | |
47 | - <label><?php _e( 'Create a Gallery', 'lasso' );?></label> |
|
47 | + <label><?php _e('Create a Gallery', 'lasso'); ?></label> |
|
48 | 48 | <small class="lasso-option-desc">Gallery Name:</small> |
49 | 49 | <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br> |
50 | 50 | |
51 | - <small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small> |
|
52 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a> |
|
51 | + <small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small> |
|
52 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a> |
|
53 | 53 | |
54 | 54 | <div id="ase-gallery-images"></div> |
55 | 55 | |
56 | - <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a> |
|
56 | + <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a> |
|
57 | 57 | |
58 | 58 | </div> |
59 | 59 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | <!-- Gallery Layout/Type Chooser --> |
65 | 65 | <div class="ase-gallery-opts ase-gallery-opts--type" > |
66 | 66 | <div data-option="gallery-type" class="ase-gallery-opts--single lasso-option"> |
67 | - <label><?php _e( 'Gallery Type', 'lasso' );?></label> |
|
68 | - <small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small> |
|
67 | + <label><?php _e('Gallery Type', 'lasso'); ?></label> |
|
68 | + <small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small> |
|
69 | 69 | <fieldset> |
70 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label> |
|
71 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label> |
|
70 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label> |
|
71 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label> |
|
72 | 72 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label> |
73 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label> |
|
74 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label> |
|
73 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label> |
|
74 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label> |
|
75 | 75 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label> |
76 | 76 | </fieldset> |
77 | 77 | </div> |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | <div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;"> |
82 | 82 | |
83 | 83 | <div data-option="itemwidth" class="ase-gallery-opts--single lasso-option"> |
84 | - <label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label> |
|
85 | - <small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small> |
|
84 | + <label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label> |
|
85 | + <small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small> |
|
86 | 86 | <input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value=""> |
87 | 87 | </div> |
88 | 88 | |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | <div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;"> |
93 | 93 | |
94 | 94 | <div data-option="transition" class="ase-gallery-opts--single lasso-option"> |
95 | - <label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label> |
|
96 | - <small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small> |
|
95 | + <label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label> |
|
96 | + <small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small> |
|
97 | 97 | <select name="lasso_thumb_gallery_transition" class="lasso-generator-attr"> |
98 | - <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option> |
|
99 | - <option value="slide"><?php _e( 'Slide', 'lasso' );?></option> |
|
100 | - <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option> |
|
98 | + <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option> |
|
99 | + <option value="slide"><?php _e('Slide', 'lasso'); ?></option> |
|
100 | + <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option> |
|
101 | 101 | </select> |
102 | 102 | </div> |
103 | 103 | |
104 | 104 | <div data-option="speed" class="ase-gallery-opts--single lasso-option"> |
105 | - <label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label> |
|
106 | - <small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small> |
|
105 | + <label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label> |
|
106 | + <small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small> |
|
107 | 107 | <input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value=""> |
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option"> |
111 | 111 | <input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs"> |
112 | - <label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label> |
|
112 | + <label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label> |
|
113 | 113 | </div> |
114 | 114 | |
115 | 115 | </div> |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | <div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;"> |
119 | 119 | |
120 | 120 | <div data-option="pslayout" class="ase-gallery-opts--single lasso-option"> |
121 | - <label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label> |
|
122 | - <small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small> |
|
121 | + <label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label> |
|
122 | + <small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small> |
|
123 | 123 | <input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value=""> |
124 | 124 | </div> |
125 | 125 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | <div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;"> |
135 | 135 | |
136 | 136 | <div data-option="height" class="ase-gallery-opts--single lasso-option"> |
137 | - <label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label> |
|
138 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
137 | + <label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label> |
|
138 | + <small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
139 | 139 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value=""> |
140 | 140 | </div> |
141 | 141 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | <div class="ase-gallery-opts ase-gallery-opts--global"> |
146 | 146 | |
147 | 147 | <div data-option="width" class="ase-gallery-opts--single lasso-option"> |
148 | - <label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label> |
|
149 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
148 | + <label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label> |
|
149 | + <small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
150 | 150 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value=""> |
151 | 151 | </div> |
152 | 152 | <div data-option="caption" class="ase-gallery-opts--single lasso-option"> |
153 | - <label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label> |
|
154 | - <small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small> |
|
153 | + <label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label> |
|
154 | + <small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small> |
|
155 | 155 | <textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea> |
156 | 156 | </div> |
157 | 157 |
@@ -425,44 +425,34 @@ discard block |
||
425 | 425 | if ($code == "aesop_video") { |
426 | 426 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
427 | 427 | echo aesop_video_shortcode($atts); |
428 | - } |
|
429 | - else if ($code == "aesop_image") { |
|
428 | + } else if ($code == "aesop_image") { |
|
430 | 429 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
431 | 430 | echo aesop_image_shortcode($atts); |
432 | - } |
|
433 | - else if ($code == "aesop_quote") { |
|
431 | + } else if ($code == "aesop_quote") { |
|
434 | 432 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
435 | 433 | echo aesop_quote_shortcode($atts); |
436 | - } |
|
437 | - else if ($code == "aesop_parallax") { |
|
434 | + } else if ($code == "aesop_parallax") { |
|
438 | 435 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
439 | 436 | echo aesop_parallax_shortcode($atts); |
440 | - } |
|
441 | - else if ($code == "aesop_character") { |
|
437 | + } else if ($code == "aesop_character") { |
|
442 | 438 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
443 | 439 | echo aesop_character_shortcode($atts); |
444 | - } |
|
445 | - else if ($code == "aesop_collection") { |
|
440 | + } else if ($code == "aesop_collection") { |
|
446 | 441 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
447 | 442 | echo aesop_collection_shortcode($atts); |
448 | - } |
|
449 | - else if ($code == "aesop_chapter") { |
|
443 | + } else if ($code == "aesop_chapter") { |
|
450 | 444 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
451 | 445 | echo aesop_chapter_shortcode($atts); |
452 | - } |
|
453 | - else if ($code == "aesop_content") { |
|
446 | + } else if ($code == "aesop_content") { |
|
454 | 447 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
455 | 448 | echo aesop_content_shortcode($atts, $atts['content_data']); |
456 | - } |
|
457 | - else if ($code == "aesop_gallery") { |
|
449 | + } else if ($code == "aesop_gallery") { |
|
458 | 450 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
459 | 451 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
460 | - } |
|
461 | - else if ($code == "aesop_audio") { |
|
452 | + } else if ($code == "aesop_audio") { |
|
462 | 453 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
463 | 454 | echo aesop_audio_shortcode($atts); |
464 | - } |
|
465 | - else if ($code == "aesop_document") { |
|
455 | + } else if ($code == "aesop_document") { |
|
466 | 456 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
467 | 457 | echo aesop_document_shortcode($atts); |
468 | 458 | } |
@@ -472,11 +462,9 @@ discard block |
||
472 | 462 | }*/ |
473 | 463 | else if ($code == "aesop_wpimg") { |
474 | 464 | self::wpimg($atts); |
475 | - } |
|
476 | - else if ($code == "aesop_wpimg-block") { |
|
465 | + } else if ($code == "aesop_wpimg-block") { |
|
477 | 466 | self::wpimg_block($atts); |
478 | - } |
|
479 | - else { |
|
467 | + } else { |
|
480 | 468 | $code = '['.$code.' '; |
481 | 469 | foreach ($atts as $key => $value) { |
482 | 470 | $code = ''.$key.'="'.$value.'" '; |
@@ -585,8 +573,9 @@ discard block |
||
585 | 573 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
586 | 574 | |
587 | 575 | // bail out if the current user can't publish posts |
588 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
589 | - return; |
|
576 | + if ( !lasso_user_can( 'delete_post', $postid ) ) { |
|
577 | + return; |
|
578 | + } |
|
590 | 579 | |
591 | 580 | if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
592 | 581 | wp_send_json_error(); |
@@ -682,15 +671,14 @@ discard block |
||
682 | 671 | } |
683 | 672 | |
684 | 673 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
685 | - } |
|
686 | - else { |
|
674 | + } else { |
|
687 | 675 | //remove all terms from post |
688 | 676 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
689 | 677 | } |
690 | 678 | |
691 | 679 | if ( ! is_wp_error( $result ) ) { |
692 | 680 | return true; |
693 | - }else{ |
|
681 | + } else{ |
|
694 | 682 | return false; |
695 | 683 | } |
696 | 684 | } |
@@ -760,9 +748,9 @@ discard block |
||
760 | 748 | $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
761 | 749 | if ( $_POST[ 'gallery_type' ] ) { |
762 | 750 | $type = $_POST[ 'gallery_type' ]; |
763 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
751 | + } elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
764 | 752 | $type = $options[ 'galleryType' ]; |
765 | - }else{ |
|
753 | + } else{ |
|
766 | 754 | $type = false; |
767 | 755 | } |
768 | 756 | |
@@ -841,13 +829,15 @@ discard block |
||
841 | 829 | |
842 | 830 | $month_numbers = range(1,12); |
843 | 831 | |
844 | - foreach($month_numbers as $month) |
|
845 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
832 | + foreach($month_numbers as $month) { |
|
833 | + $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
834 | + } |
|
846 | 835 | |
847 | 836 | setlocale(LC_ALL, get_locale()); |
848 | 837 | |
849 | - foreach($month_numbers as $month) |
|
850 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
838 | + foreach($month_numbers as $month) { |
|
839 | + $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
840 | + } |
|
851 | 841 | |
852 | 842 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
853 | 843 | } |
@@ -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) ), |
@@ -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 | |
@@ -322,15 +322,15 @@ discard block |
||
322 | 322 | $data = array(); |
323 | 323 | parse_str($_POST['data'], $data); |
324 | 324 | |
325 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
325 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
326 | 326 | wp_send_json_error(); |
327 | 327 | exit; |
328 | 328 | } |
329 | 329 | |
330 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
331 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
332 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
333 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
330 | + $status = isset($data['status']) ? $data['status'] : false; |
|
331 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
332 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
333 | + $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false; |
|
334 | 334 | |
335 | 335 | |
336 | 336 | $args = array( |
@@ -342,24 +342,24 @@ discard block |
||
342 | 342 | |
343 | 343 | |
344 | 344 | |
345 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
345 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
346 | 346 | |
347 | 347 | // update categories |
348 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
348 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
349 | 349 | |
350 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
350 | + self::set_post_terms($postid, $cats, 'category'); |
|
351 | 351 | |
352 | 352 | // update tags |
353 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
354 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
353 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
354 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
355 | 355 | |
356 | 356 | //update date |
357 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
358 | - self::set_date( $postid, $date ); |
|
357 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
358 | + self::set_date($postid, $date); |
|
359 | 359 | |
360 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
361 | - $response= array( |
|
362 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
360 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
361 | + $response = array( |
|
362 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
363 | 363 | ); |
364 | 364 | wp_send_json_success($response); |
365 | 365 | exit; |
@@ -367,11 +367,11 @@ discard block |
||
367 | 367 | |
368 | 368 | public static function enable_metasave($type) |
369 | 369 | { |
370 | - register_rest_field( $type, 'metadata', array( |
|
371 | - 'get_callback' => function ( $data ) { |
|
372 | - return get_post_meta( $data['id']);//, '', '' ); |
|
370 | + register_rest_field($type, 'metadata', array( |
|
371 | + 'get_callback' => function($data) { |
|
372 | + return get_post_meta($data['id']); //, '', '' ); |
|
373 | 373 | }, |
374 | - 'update_callback' => function( $data, $post ) { |
|
374 | + 'update_callback' => function($data, $post) { |
|
375 | 375 | foreach ($data as $key => $value) { |
376 | 376 | update_post_meta($post->ID, $key, $value); |
377 | 377 | } |
@@ -383,13 +383,13 @@ discard block |
||
383 | 383 | public function editus_do_shortcode() |
384 | 384 | { |
385 | 385 | |
386 | - $code= $_POST["code"]; |
|
386 | + $code = $_POST["code"]; |
|
387 | 387 | $code = str_replace('\"', '"', $code); |
388 | 388 | |
389 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
390 | - $out = do_shortcode($code); |
|
389 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
390 | + $out = do_shortcode($code); |
|
391 | 391 | if ($out != '') { |
392 | - $out = do_shortcode($code_wrapped); |
|
392 | + $out = do_shortcode($code_wrapped); |
|
393 | 393 | echo $out; |
394 | 394 | exit; |
395 | 395 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | /** @var \WP_Embed $wp_embed */ |
400 | 400 | global $wp_embed; |
401 | 401 | $wp_embed->post_ID = $_POST["ID"]; |
402 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
402 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
403 | 403 | |
404 | 404 | echo $out; |
405 | 405 | exit; |
@@ -408,9 +408,9 @@ discard block |
||
408 | 408 | public function editus_do_block() |
409 | 409 | { |
410 | 410 | |
411 | - $code= $_POST["code"]; |
|
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; |
@@ -420,56 +420,56 @@ discard block |
||
420 | 420 | { |
421 | 421 | |
422 | 422 | |
423 | - $code= $_POST["code"]; |
|
423 | + $code = $_POST["code"]; |
|
424 | 424 | $atts = array( |
425 | 425 | ); |
426 | 426 | foreach ($_POST as $key => $value) { |
427 | - if ($key !="code" && $key !="action") { |
|
427 | + if ($key != "code" && $key != "action") { |
|
428 | 428 | $atts[$key] = $value; |
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'); |
|
432 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
433 | 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'); |
|
436 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
437 | 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'); |
|
440 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
441 | 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'); |
|
444 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
445 | 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'); |
|
448 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
449 | 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'); |
|
452 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
453 | 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'); |
|
456 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
457 | 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'); |
|
460 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
461 | 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'); |
|
468 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
469 | 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'); |
|
472 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
473 | 473 | echo aesop_document_shortcode($atts); |
474 | 474 | } |
475 | 475 | /*else if ($code == "aesop_content") { |
@@ -501,24 +501,24 @@ discard block |
||
501 | 501 | $extra = ""; |
502 | 502 | |
503 | 503 | // try to use srcset and sizes on new WP installs |
504 | - if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
|
505 | - $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
|
506 | - $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
|
504 | + if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) { |
|
505 | + $srcset = wp_get_attachment_image_srcset($attachment_id, 'full'); |
|
506 | + $sizes = wp_get_attachment_image_sizes($attachment_id, 'full'); |
|
507 | 507 | $extra = "srcset='$srcset' sizes='$sizes' "; |
508 | 508 | } |
509 | - if ($atts['align']=="left") { |
|
509 | + if ($atts['align'] == "left") { |
|
510 | 510 | $extra .= 'class="alignleft'; |
511 | - } else if ($atts['align']=="right") { |
|
511 | + } else if ($atts['align'] == "right") { |
|
512 | 512 | $extra .= 'class="alignright'; |
513 | 513 | } else { |
514 | 514 | $extra .= 'class="aligncenter'; |
515 | 515 | } |
516 | 516 | if ($atts['imgwidth'] || $atts['imgheight']) { |
517 | 517 | if ($atts['imgwidth']) { |
518 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
518 | + $extra .= 'width:'.$atts['imgwidth'].';'; |
|
519 | 519 | } |
520 | 520 | if ($atts['imgheight']) { |
521 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
521 | + $extra .= 'height:'.$atts['imgheight'].';'; |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | } |
@@ -530,15 +530,15 @@ discard block |
||
530 | 530 | //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
531 | 531 | echo ' class="wp-caption lasso-component">'; |
532 | 532 | $hrefset = false; |
533 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
533 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url")) |
|
534 | 534 | { |
535 | - echo '<a href="' . $atts['link'] . '">'; |
|
535 | + echo '<a href="'.$atts['link'].'">'; |
|
536 | 536 | $hrefset = true; |
537 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
538 | - echo '<a href="' . $atts['img'] . '">'; |
|
537 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') { |
|
538 | + echo '<a href="'.$atts['img'].'">'; |
|
539 | 539 | $hrefset = true; |
540 | 540 | } |
541 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
541 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>'; |
|
542 | 542 | if ($hrefset) |
543 | 543 | { |
544 | 544 | echo '</a>'; |
@@ -558,16 +558,16 @@ discard block |
||
558 | 558 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
559 | 559 | } |
560 | 560 | $figclass = 'aligncenter'; |
561 | - if ($atts['align']=="left") { |
|
561 | + if ($atts['align'] == "left") { |
|
562 | 562 | $figclass = 'alignleft'; |
563 | - } else if ($atts['align']=="right") { |
|
563 | + } else if ($atts['align'] == "right") { |
|
564 | 564 | $figclass = 'alignright'; |
565 | 565 | } else { |
566 | 566 | $figclass = 'aligncenter'; |
567 | 567 | } |
568 | 568 | echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
569 | 569 | echo '<figure class="'.$figclass.' size-large">'; |
570 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
570 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' >'; |
|
571 | 571 | if ($atts['caption']) |
572 | 572 | { |
573 | 573 | echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
@@ -581,20 +581,20 @@ discard block |
||
581 | 581 | public function get_ase_options() |
582 | 582 | { |
583 | 583 | $blob = lasso_editor_options_blob(); |
584 | - $code= $_POST["component"]; |
|
584 | + $code = $_POST["component"]; |
|
585 | 585 | echo $blob[$code]; |
586 | 586 | exit; |
587 | 587 | } |
588 | 588 | |
589 | 589 | public function delete_post( ) { |
590 | 590 | |
591 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
591 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
592 | 592 | |
593 | 593 | // bail out if the current user can't publish posts |
594 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
594 | + if (!lasso_user_can('delete_post', $postid)) |
|
595 | 595 | return; |
596 | 596 | |
597 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
|
597 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) { |
|
598 | 598 | wp_send_json_error(); |
599 | 599 | exit; |
600 | 600 | } |
@@ -604,9 +604,9 @@ discard block |
||
604 | 604 | 'post_status' => 'trash' |
605 | 605 | ); |
606 | 606 | |
607 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
607 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
608 | 608 | |
609 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
609 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
610 | 610 | |
611 | 611 | exit; |
612 | 612 | } |
@@ -614,40 +614,40 @@ discard block |
||
614 | 614 | /* This function doesn't actually publish post, but should be called when a post is published */ |
615 | 615 | public function on_publish_post( ) { |
616 | 616 | |
617 | - $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
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 | } |
623 | 623 | |
624 | 624 | public function set_featured_img( ) { |
625 | 625 | |
626 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
627 | - $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false; |
|
628 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
626 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
627 | + $image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false; |
|
628 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
629 | 629 | wp_send_json_error(); |
630 | 630 | exit; |
631 | 631 | } |
632 | 632 | |
633 | - set_post_thumbnail( $postid, $image_id ); |
|
633 | + set_post_thumbnail($postid, $image_id); |
|
634 | 634 | |
635 | - do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() ); |
|
635 | + do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID()); |
|
636 | 636 | |
637 | 637 | exit; |
638 | 638 | } |
639 | 639 | |
640 | 640 | public function del_featured_img( ) { |
641 | 641 | |
642 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
643 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
642 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
643 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
644 | 644 | wp_send_json_error(); |
645 | 645 | exit; |
646 | 646 | } |
647 | 647 | |
648 | - delete_post_thumbnail( $postid ); |
|
648 | + delete_post_thumbnail($postid); |
|
649 | 649 | |
650 | - do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() ); |
|
650 | + do_action('lasso_featured_image_deleted', $postid, get_current_user_ID()); |
|
651 | 651 | |
652 | 652 | exit; |
653 | 653 | } |
@@ -668,17 +668,17 @@ discard block |
||
668 | 668 | return self::$revisions; |
669 | 669 | }*/ |
670 | 670 | |
671 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
672 | - if( $value ) { |
|
673 | - $value = explode( ',', $value ); |
|
674 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
671 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
672 | + if ($value) { |
|
673 | + $value = explode(',', $value); |
|
674 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
675 | 675 | |
676 | - if ($taxonomy =='category') { |
|
676 | + if ($taxonomy == 'category') { |
|
677 | 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 | - if ($cat_id !=0) { |
|
681 | + if ($cat_id != 0) { |
|
682 | 682 | $cats [] = $cat_id; |
683 | 683 | } else if ($allow_new_category) { |
684 | 684 | $cats [] = wp_create_category($cat); |
@@ -687,71 +687,71 @@ discard block |
||
687 | 687 | $value = $cats; |
688 | 688 | } |
689 | 689 | |
690 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
690 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
691 | 691 | } |
692 | - else { |
|
692 | + else { |
|
693 | 693 | //remove all terms from post |
694 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
694 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
695 | 695 | } |
696 | 696 | |
697 | - if ( ! is_wp_error( $result ) ) { |
|
697 | + if (!is_wp_error($result)) { |
|
698 | 698 | return true; |
699 | - }else{ |
|
699 | + } else { |
|
700 | 700 | return false; |
701 | 701 | } |
702 | 702 | } |
703 | 703 | |
704 | 704 | public function create_gallery( ) { |
705 | 705 | |
706 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
706 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
707 | 707 | |
708 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
708 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
709 | 709 | wp_send_json_error(); |
710 | 710 | exit; |
711 | 711 | } |
712 | 712 | |
713 | - if ( ! lasso_user_can( 'publish_posts' ) ) { |
|
713 | + if (!lasso_user_can('publish_posts')) { |
|
714 | 714 | return false; |
715 | 715 | |
716 | 716 | } |
717 | 717 | |
718 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
718 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
719 | 719 | |
720 | 720 | // bail if no gallery ids |
721 | - if ( empty( $gallery_ids ) ) { |
|
721 | + if (empty($gallery_ids)) { |
|
722 | 722 | return false; |
723 | 723 | } |
724 | 724 | |
725 | - $type = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false; |
|
726 | - $edgallerytitle = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
725 | + $type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false; |
|
726 | + $edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
727 | 727 | |
728 | 728 | // insert a new gallery |
729 | 729 | $args = array( |
730 | - 'post_title' => $edgallerytitle , |
|
730 | + 'post_title' => $edgallerytitle, |
|
731 | 731 | 'post_status' => 'publish', |
732 | 732 | 'post_type' => 'ai_galleries' |
733 | 733 | ); |
734 | 734 | |
735 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) ); |
|
735 | + $postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args)); |
|
736 | 736 | |
737 | 737 | // update gallery ids |
738 | - if ( $gallery_ids ) { |
|
738 | + if ($gallery_ids) { |
|
739 | 739 | |
740 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
740 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
741 | 741 | |
742 | 742 | } |
743 | 743 | |
744 | 744 | // update the gallery type |
745 | - if ( !empty( $type ) ) { |
|
745 | + if (!empty($type)) { |
|
746 | 746 | |
747 | - update_post_meta( $postid, 'aesop_gallery_type', $type ); |
|
747 | + update_post_meta($postid, 'aesop_gallery_type', $type); |
|
748 | 748 | |
749 | 749 | } |
750 | 750 | |
751 | - do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() ); |
|
751 | + do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID()); |
|
752 | 752 | |
753 | 753 | |
754 | - echo json_encode( array( |
|
754 | + echo json_encode(array( |
|
755 | 755 | 'message' => 'gallery-created', |
756 | 756 | 'id' => $postid) |
757 | 757 | ); |
@@ -760,114 +760,114 @@ discard block |
||
760 | 760 | |
761 | 761 | public function update_gallery( ) { |
762 | 762 | |
763 | - $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
|
763 | + $options = isset($_POST['fields']) ? $_POST['fields'] : false; |
|
764 | 764 | |
765 | - $postid = !empty( $options ) ? (int) $options['id'] : false; |
|
766 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
767 | - if ( $_POST[ 'gallery_type' ] ) { |
|
768 | - $type = $_POST[ 'gallery_type' ]; |
|
769 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
770 | - $type = $options[ 'galleryType' ]; |
|
771 | - }else{ |
|
765 | + $postid = !empty($options) ? (int) $options['id'] : false; |
|
766 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
767 | + if ($_POST['gallery_type']) { |
|
768 | + $type = $_POST['gallery_type']; |
|
769 | + }elseif (!empty($options) && $options['galleryType']) { |
|
770 | + $type = $options['galleryType']; |
|
771 | + } else { |
|
772 | 772 | $type = false; |
773 | 773 | } |
774 | 774 | |
775 | - self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
|
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 | 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 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
785 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
786 | 786 | |
787 | 787 | // gallery grid item width |
788 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
788 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
789 | 789 | |
790 | 790 | // caption |
791 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
791 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
792 | 792 | |
793 | 793 | // gallery transition |
794 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
794 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
795 | 795 | |
796 | 796 | // gallery transition speed |
797 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
797 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
798 | 798 | |
799 | 799 | // gallery hide thumbs |
800 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
800 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
801 | 801 | |
802 | 802 | // photoset layout hardwired to on for now |
803 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
803 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
804 | 804 | |
805 | 805 | // photoset layout |
806 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
806 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
807 | 807 | |
808 | 808 | // hero gallery height |
809 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
809 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
810 | 810 | |
811 | 811 | // update gallery ids |
812 | - if ( !empty( $gallery_ids ) ) { |
|
812 | + if (!empty($gallery_ids)) { |
|
813 | 813 | |
814 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
814 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
815 | 815 | |
816 | 816 | } |
817 | 817 | |
818 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
818 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
819 | 819 | |
820 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
820 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
821 | 821 | |
822 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
822 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
823 | 823 | |
824 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
824 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
825 | 825 | |
826 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
826 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
827 | 827 | |
828 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
828 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
829 | 829 | |
830 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
830 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
831 | 831 | |
832 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
832 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
833 | 833 | |
834 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
834 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
835 | 835 | |
836 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
836 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
837 | 837 | |
838 | 838 | //hardwired for now |
839 | 839 | |
840 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
840 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
841 | 841 | |
842 | 842 | } |
843 | 843 | |
844 | - function getEnglishMonthName($foreignMonthName){ |
|
844 | + function getEnglishMonthName($foreignMonthName) { |
|
845 | 845 | |
846 | 846 | setlocale(LC_ALL, 'en_US'); |
847 | 847 | |
848 | - $month_numbers = range(1,12); |
|
848 | + $month_numbers = range(1, 12); |
|
849 | 849 | |
850 | - foreach($month_numbers as $month) |
|
851 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
850 | + foreach ($month_numbers as $month) |
|
851 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
852 | 852 | |
853 | 853 | setlocale(LC_ALL, get_locale()); |
854 | 854 | |
855 | - foreach($month_numbers as $month) |
|
856 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
855 | + foreach ($month_numbers as $month) |
|
856 | + $foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011))); |
|
857 | 857 | |
858 | 858 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
859 | 859 | } |
860 | 860 | |
861 | 861 | |
862 | 862 | |
863 | - public function set_date( $postid, $value) { |
|
864 | - if( $value ) { |
|
865 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
863 | + public function set_date($postid, $value) { |
|
864 | + if ($value) { |
|
865 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
866 | 866 | wp_update_post( |
867 | - array ( |
|
867 | + array( |
|
868 | 868 | 'ID' => $postid, // ID of the post to update |
869 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
870 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
869 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
870 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
871 | 871 | ) |
872 | 872 | ); |
873 | 873 | } |
@@ -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; |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | 44 | |
45 | - if ( ! empty( $allowed_fields ) ) { |
|
46 | - foreach( $allowed_fields as $field ) { |
|
47 | - if ( isset( $data[ $field ] ) ) { |
|
45 | + if (!empty($allowed_fields)) { |
|
46 | + foreach ($allowed_fields as $field) { |
|
47 | + if (isset($data[$field])) { |
|
48 | 48 | //this original line changed dash to underscore |
49 | 49 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
50 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
50 | + update_post_meta($post_id, $field, $data[$field]); |
|
51 | 51 | } |
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; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return array Array of keys to pull from $data per action and their sanitization callback |
68 | 68 | */ |
69 | - public static function params(){ |
|
70 | - $params[ 'process_meta_update' ] = array( |
|
69 | + public static function params() { |
|
70 | + $params['process_meta_update'] = array( |
|
71 | 71 | 'post_id' => 'absint', |
72 | 72 | 'tab_name' => 'trim' |
73 | 73 | ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return array Array of additional functions to use to authorize action. |
85 | 85 | */ |
86 | 86 | public static function auth_callbacks() { |
87 | - $params[ 'process_meta_update' ] = array( |
|
87 | + $params['process_meta_update'] = array( |
|
88 | 88 | 'lasso_user_can' |
89 | 89 | ); |
90 | 90 |