@@ -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 |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
49 | - return; |
|
48 | + if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) { |
|
49 | + return; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
52 | 53 | |
@@ -95,8 +96,9 @@ discard block |
||
95 | 96 | */ |
96 | 97 | function lasso_editor_settings_form() { |
97 | 98 | |
98 | - if ( !is_user_logged_in() ) |
|
99 | - return; |
|
99 | + if ( !is_user_logged_in() ) { |
|
100 | + return; |
|
101 | + } |
|
100 | 102 | |
101 | 103 | // check for lasso story engine and add a class doniting this |
102 | 104 | $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
@@ -176,7 +178,9 @@ discard block |
||
176 | 178 | $post_types = get_post_types( $args, 'objects' ); |
177 | 179 | |
178 | 180 | foreach ( $post_types as $post_type ) { |
179 | - if ($post_type->name == 'attachment') continue; |
|
181 | + if ($post_type->name == 'attachment') { |
|
182 | + continue; |
|
183 | + } |
|
180 | 184 | $checked =""; |
181 | 185 | if ( in_array( $post_type->name, $allowed_post_types ) ) { |
182 | 186 | $checked = 'checked="checked"'; |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | if ( !is_user_logged_in() ) |
99 | 99 | return; |
100 | 100 | |
101 | - // check for lasso story engine and add a class doniting this |
|
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
101 | + // check for lasso story engine and add a class doniting this |
|
102 | + $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | 103 | |
104 | 104 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
105 | 105 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
111 | 111 | $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
112 | 112 | $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | 114 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
115 | 115 | $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
116 | 116 | $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
125 | 125 | $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
126 | 126 | |
127 | - $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
127 | + $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
128 | 128 | |
129 | 129 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
130 | 130 | $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
140 | 140 | $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
141 | 141 | |
142 | - $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
143 | - $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false); |
|
142 | + $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
143 | + $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false); |
|
144 | 144 | |
145 | 145 | // do we support pending status |
146 | 146 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -152,17 +152,17 @@ discard block |
||
152 | 152 | $insert_comp_ui = 'drag'; |
153 | 153 | } |
154 | 154 | |
155 | - $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
155 | + $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
156 | 156 | $inherit_categories = lasso_editor_get_option('inherit_categories', 'lasso_editor'); |
157 | 157 | |
158 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
159 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
158 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
159 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
160 | 160 | |
161 | 161 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
162 | 162 | |
163 | - $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
163 | + $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
164 | 164 | |
165 | - $no_wrap_shortcode = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor'); |
|
165 | + $no_wrap_shortcode = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor'); |
|
166 | 166 | |
167 | 167 | ?> |
168 | 168 | <div class="wrap"> |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | function __construct() { |
11 | 11 | |
12 | - add_action( 'admin_menu', array( $this, 'menu' ) ); |
|
13 | - add_action( 'network_admin_menu', array( $this, 'menu' ) ); |
|
14 | - add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) ); |
|
12 | + add_action('admin_menu', array($this, 'menu')); |
|
13 | + add_action('network_admin_menu', array($this, 'menu')); |
|
14 | + add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings')); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function menu() { |
24 | 24 | |
25 | 25 | // CHANGED Removed condition. |
26 | - add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) ); |
|
26 | + add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings')); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
48 | + if (!current_user_can('manage_options') || !is_user_logged_in()) |
|
49 | 49 | return; |
50 | 50 | |
51 | - if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
|
51 | + if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) { |
|
52 | 52 | |
53 | - $options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false; |
|
53 | + $options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false; |
|
54 | 54 | |
55 | 55 | $arr = $options['allowed_post_types']; |
56 | - $options = array_map( 'sanitize_text_field', $options ); |
|
57 | - $options['allowed_post_types'] = array_keys( $arr); |
|
56 | + $options = array_map('sanitize_text_field', $options); |
|
57 | + $options['allowed_post_types'] = array_keys($arr); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
61 | + if (function_exists('is_multisite') && is_multisite()) { |
|
62 | 62 | |
63 | - update_site_option( 'lasso_editor', $options ); |
|
63 | + update_site_option('lasso_editor', $options); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | |
67 | - update_option( 'lasso_editor', $options ); |
|
67 | + update_option('lasso_editor', $options); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | wp_send_json_success(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | - $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
|
83 | + $color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue); |
|
84 | 84 | |
85 | 85 | echo '<div lass="lasso-editor-settings--option-inner">'."\n"; |
86 | 86 | echo '<label>'.$title.'</label>'; |
@@ -95,49 +95,49 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function lasso_editor_settings_form() { |
97 | 97 | |
98 | - if ( !is_user_logged_in() ) |
|
98 | + if (!is_user_logged_in()) |
|
99 | 99 | return; |
100 | 100 | |
101 | 101 | // check for lasso story engine and add a class doniting this |
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | - |
|
104 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
105 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
106 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
107 | - |
|
108 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
109 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
110 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
111 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
112 | - $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
|
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
115 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
116 | - $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
|
102 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
103 | + |
|
104 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
105 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
106 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
107 | + |
|
108 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
109 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
110 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
111 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
112 | + $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
114 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
115 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
116 | + $enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor'); |
|
117 | 117 | |
118 | 118 | $disable_shortcode_editing = lasso_editor_get_option('disable_shortcode_editing', 'lasso_editor'); |
119 | 119 | |
120 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
121 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
122 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
123 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
124 | - $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
|
125 | - $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
|
120 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
121 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
122 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
123 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
124 | + $toolbar_show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
|
125 | + $toolbar_show_alignment = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
|
126 | 126 | |
127 | 127 | $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
128 | 128 | |
129 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
130 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
129 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
130 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
131 | 131 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
132 | 132 | $show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor'); |
133 | 133 | $save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
134 | 134 | |
135 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
136 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
135 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
136 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
137 | 137 | |
138 | 138 | $links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false); |
139 | - $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
|
140 | - $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
|
139 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b"); |
|
140 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i"); |
|
141 | 141 | |
142 | 142 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
143 | 143 | $add_paragraph = lasso_editor_get_option('add_paragraph', 'lasso_editor', false); |
@@ -155,14 +155,14 @@ discard block |
||
155 | 155 | $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
156 | 156 | $inherit_categories = lasso_editor_get_option('inherit_categories', 'lasso_editor'); |
157 | 157 | |
158 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
159 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
158 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
159 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
160 | 160 | |
161 | - $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
|
161 | + $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
|
162 | 162 | |
163 | - $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
163 | + $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor'); |
|
164 | 164 | |
165 | - $no_wrap_shortcode = lasso_editor_get_option( 'no_wrap_shortcode', 'lasso_editor'); |
|
165 | + $no_wrap_shortcode = lasso_editor_get_option('no_wrap_shortcode', 'lasso_editor'); |
|
166 | 166 | |
167 | 167 | ?> |
168 | 168 | <div class="wrap"> |
@@ -205,31 +205,31 @@ discard block |
||
205 | 205 | |
206 | 206 | |
207 | 207 | </script> |
208 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
208 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
209 | 209 | |
210 | 210 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
211 | 211 | |
212 | - <?php do_action('lasso_settings_before');?> |
|
212 | + <?php do_action('lasso_settings_before'); ?> |
|
213 | 213 | |
214 | 214 | |
215 | 215 | |
216 | - <h3 class="accordion show"><?php _e( 'Enable for:', 'lasso' );?></h3> |
|
216 | + <h3 class="accordion show"><?php _e('Enable for:', 'lasso'); ?></h3> |
|
217 | 217 | <div class="lasso-editor-settings--option-wrap show"> |
218 | 218 | <div class="lasso-editor-settings--option-inner"> |
219 | 219 | |
220 | - <span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span> |
|
220 | + <span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span> |
|
221 | 221 | <?php |
222 | 222 | $args = array( |
223 | 223 | 'public' => true |
224 | 224 | ); |
225 | 225 | |
226 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
227 | - $post_types = get_post_types( $args, 'objects' ); |
|
226 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
227 | + $post_types = get_post_types($args, 'objects'); |
|
228 | 228 | |
229 | - foreach ( $post_types as $post_type ) { |
|
229 | + foreach ($post_types as $post_type) { |
|
230 | 230 | if ($post_type->name == 'attachment') continue; |
231 | - $checked =""; |
|
232 | - if ( in_array( $post_type->name, $allowed_post_types ) ) { |
|
231 | + $checked = ""; |
|
232 | + if (in_array($post_type->name, $allowed_post_types)) { |
|
233 | 233 | $checked = 'checked="checked"'; |
234 | 234 | } |
235 | 235 | echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>'; |
@@ -239,140 +239,140 @@ discard block |
||
239 | 239 | </div> |
240 | 240 | |
241 | 241 | |
242 | - <h3 class="accordion show"><?php _e( 'Internal Settings', 'lasso' );?></h3> |
|
242 | + <h3 class="accordion show"><?php _e('Internal Settings', 'lasso'); ?></h3> |
|
243 | 243 | <div class="lasso-editor-settings--option-wrap show"> |
244 | 244 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
245 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
246 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span> |
|
247 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
245 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
246 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span> |
|
247 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
248 | 248 | </div> |
249 | 249 | |
250 | 250 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
251 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
252 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span> |
|
253 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
251 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
252 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span> |
|
253 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
254 | 254 | </div> |
255 | 255 | |
256 | 256 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
257 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
258 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span> |
|
259 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
257 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
258 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span> |
|
259 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
260 | 260 | </div> |
261 | 261 | |
262 | 262 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
263 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
264 | - <span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span> |
|
265 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
263 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
264 | + <span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span> |
|
265 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
266 | 266 | </div> |
267 | 267 | |
268 | 268 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
269 | - <label><?php _e( 'Read Only Items', 'lasso' );?></label> |
|
270 | - <span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span> |
|
271 | - <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea> |
|
269 | + <label><?php _e('Read Only Items', 'lasso'); ?></label> |
|
270 | + <span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span> |
|
271 | + <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea> |
|
272 | 272 | </div> |
273 | 273 | |
274 | 274 | <div class="lasso-editor-settings--option-inner" > |
275 | - <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> > |
|
276 | - <label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label> |
|
277 | - <span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span> |
|
275 | + <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> > |
|
276 | + <label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label> |
|
277 | + <span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span> |
|
278 | 278 | </div> |
279 | 279 | </div> |
280 | 280 | |
281 | - <h3 class="accordion"><?php _e( 'Editor UI', 'lasso' );?></h3> |
|
281 | + <h3 class="accordion"><?php _e('Editor UI', 'lasso'); ?></h3> |
|
282 | 282 | <div class="lasso-editor-settings--option-wrap"> |
283 | 283 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
284 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> > |
|
285 | - <label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label> |
|
286 | - <span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span> |
|
284 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> > |
|
285 | + <label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label> |
|
286 | + <span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span> |
|
287 | 287 | </div> |
288 | 288 | <div id="lasso-editor-settings--colors"> |
289 | 289 | <?php |
290 | - self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff'); |
|
291 | - self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030'); |
|
292 | - self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055'); |
|
293 | - self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff'); |
|
290 | + self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff'); |
|
291 | + self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030'); |
|
292 | + self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055'); |
|
293 | + self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff'); |
|
294 | 294 | ?> |
295 | - <button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button> |
|
295 | + <button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button> |
|
296 | 296 | <div style="height:50px;"></div> |
297 | 297 | </div> |
298 | 298 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
299 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
300 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label> |
|
301 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span> |
|
299 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
300 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label> |
|
301 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span> |
|
302 | 302 | |
303 | 303 | </div> |
304 | 304 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
305 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> > |
|
306 | - <label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label> |
|
307 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span> |
|
305 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> > |
|
306 | + <label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label> |
|
307 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span> |
|
308 | 308 | |
309 | 309 | </div> |
310 | 310 | |
311 | 311 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
312 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> > |
|
313 | - <label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label> |
|
314 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span> |
|
312 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> > |
|
313 | + <label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label> |
|
314 | + <span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span> |
|
315 | 315 | </div> |
316 | 316 | |
317 | 317 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
318 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> > |
|
319 | - <label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label> |
|
320 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span> |
|
318 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> > |
|
319 | + <label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label> |
|
320 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span> |
|
321 | 321 | |
322 | 322 | </div> |
323 | 323 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
324 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> > |
|
325 | - <label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label> |
|
326 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span> |
|
324 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> > |
|
325 | + <label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label> |
|
326 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span> |
|
327 | 327 | |
328 | 328 | </div> |
329 | 329 | |
330 | 330 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
331 | - <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> > |
|
332 | - <label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label> |
|
333 | - <span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span> |
|
331 | + <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> > |
|
332 | + <label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label> |
|
333 | + <span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span> |
|
334 | 334 | |
335 | 335 | </div> |
336 | 336 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
337 | - <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label> |
|
338 | - <span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span> |
|
337 | + <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label> |
|
338 | + <span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span> |
|
339 | 339 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
340 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?> |
|
340 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?> |
|
341 | 341 | </div> |
342 | 342 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
343 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?> |
|
343 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?> |
|
344 | 344 | </div> |
345 | 345 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
346 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?> |
|
346 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?> |
|
347 | 347 | </div> |
348 | 348 | </div> |
349 | 349 | |
350 | 350 | <div class="lasso-editor-settings--option-inner" > |
351 | - <input type="checkbox" class="checkbox" name="lasso_editor[text_select_popup]" id="lasso_editor[text_select_popup]" <?php echo checked( $text_select_popup, 'on' );?> > |
|
352 | - <label for="lasso_editor[text_select_popup]"><?php _e( 'Popup When Text is Selected', 'lasso' );?></label> |
|
353 | - <span class="lasso--setting-description"><?php _e( 'Instead of using the bottom toolbar to format texts, use a popup box to format texts.', 'lasso' );?></span> |
|
351 | + <input type="checkbox" class="checkbox" name="lasso_editor[text_select_popup]" id="lasso_editor[text_select_popup]" <?php echo checked($text_select_popup, 'on'); ?> > |
|
352 | + <label for="lasso_editor[text_select_popup]"><?php _e('Popup When Text is Selected', 'lasso'); ?></label> |
|
353 | + <span class="lasso--setting-description"><?php _e('Instead of using the bottom toolbar to format texts, use a popup box to format texts.', 'lasso'); ?></span> |
|
354 | 354 | |
355 | 355 | </div> |
356 | 356 | |
357 | 357 | </div> |
358 | 358 | |
359 | - <h3 class="accordion"><?php _e( 'Component', 'lasso' );?></h3> |
|
359 | + <h3 class="accordion"><?php _e('Component', 'lasso'); ?></h3> |
|
360 | 360 | <div class="lasso-editor-settings--option-wrap" style="border:none;" > |
361 | 361 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
362 | - <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> > |
|
363 | - <label for="lasso_editor[add_table]"><span class="dashicons dashicons-grid-view"> </span> <?php _e( 'Additional Component: Table', 'lasso' );?></label> |
|
364 | - <span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span> |
|
362 | + <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> > |
|
363 | + <label for="lasso_editor[add_table]"><span class="dashicons dashicons-grid-view"> </span> <?php _e('Additional Component: Table', 'lasso'); ?></label> |
|
364 | + <span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span> |
|
365 | 365 | |
366 | 366 | </div> |
367 | 367 | |
368 | 368 | <div class="lasso-editor-settings--option-inner" > |
369 | - <input type="checkbox" class="checkbox" name="lasso_editor[add_paragraph]" id="lasso_editor[add_paragraph]" <?php echo checked( $add_paragraph, 'on' );?> > |
|
370 | - <label for="lasso_editor[add_paragraph]"><span class="dashicons dashicons-editor-paragraph"></span><?php _e( 'Additional Component: Paragraph', 'lasso' );?></label> |
|
371 | - <span class="lasso--setting-description"><?php _e( 'Plain HTML Paragraph.', 'lasso' );?></span> |
|
369 | + <input type="checkbox" class="checkbox" name="lasso_editor[add_paragraph]" id="lasso_editor[add_paragraph]" <?php echo checked($add_paragraph, 'on'); ?> > |
|
370 | + <label for="lasso_editor[add_paragraph]"><span class="dashicons dashicons-editor-paragraph"></span><?php _e('Additional Component: Paragraph', 'lasso'); ?></label> |
|
371 | + <span class="lasso--setting-description"><?php _e('Plain HTML Paragraph.', 'lasso'); ?></span> |
|
372 | 372 | |
373 | 373 | </div> |
374 | 374 | |
375 | - <?php if ( 'ase-active' != $ase_status ) { ?> |
|
375 | + <?php if ('ase-active' != $ase_status) { ?> |
|
376 | 376 | <script> |
377 | 377 | $(document).ready(function(){ |
378 | 378 | $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){ |
@@ -398,162 +398,162 @@ discard block |
||
398 | 398 | </script> |
399 | 399 | |
400 | 400 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
401 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> > |
|
402 | - <label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label> |
|
403 | - <span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span> |
|
401 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> > |
|
402 | + <label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label> |
|
403 | + <span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span> |
|
404 | 404 | |
405 | 405 | </div> |
406 | 406 | |
407 | 407 | |
408 | 408 | <div class="lasso-editor-settings--option-inner"> |
409 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked( $use_wp_block_image, 'on' );?> > |
|
410 | - <label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label> |
|
411 | - <span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span> |
|
409 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked($use_wp_block_image, 'on'); ?> > |
|
410 | + <label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label> |
|
411 | + <span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span> |
|
412 | 412 | |
413 | 413 | </div> |
414 | 414 | <?php }?> |
415 | 415 | </div> |
416 | 416 | |
417 | 417 | |
418 | - <h3 class="accordion"><?php _e( 'Post Settings UI', 'lasso' );?></h3> |
|
418 | + <h3 class="accordion"><?php _e('Post Settings UI', 'lasso'); ?></h3> |
|
419 | 419 | <div class="lasso-editor-settings--option-wrap" > |
420 | 420 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
421 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
422 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
423 | - <span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span> |
|
421 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
422 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
423 | + <span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span> |
|
424 | 424 | </div> |
425 | 425 | |
426 | 426 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
427 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> > |
|
428 | - <label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label> |
|
429 | - <span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span> |
|
427 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> > |
|
428 | + <label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label> |
|
429 | + <span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span> |
|
430 | 430 | </div> |
431 | 431 | |
432 | 432 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
433 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> > |
|
434 | - <label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label> |
|
435 | - <span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span> |
|
433 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> > |
|
434 | + <label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label> |
|
435 | + <span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span> |
|
436 | 436 | </div> |
437 | 437 | |
438 | 438 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
439 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> > |
|
440 | - <label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label> |
|
441 | - <span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span> |
|
439 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> > |
|
440 | + <label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label> |
|
441 | + <span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span> |
|
442 | 442 | </div> |
443 | 443 | |
444 | 444 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
445 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> > |
|
446 | - <label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label> |
|
447 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span> |
|
445 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> > |
|
446 | + <label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label> |
|
447 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span> |
|
448 | 448 | </div> |
449 | 449 | |
450 | 450 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
451 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> > |
|
452 | - <label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label> |
|
453 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span> |
|
451 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> > |
|
452 | + <label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label> |
|
453 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span> |
|
454 | 454 | </div> |
455 | 455 | |
456 | 456 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
457 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
458 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
459 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span> |
|
457 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
458 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
459 | + <span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span> |
|
460 | 460 | </div> |
461 | 461 | |
462 | 462 | <div class="lasso-editor-settings--option-inner" > |
463 | - <input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked( $support_custom_taxonomy, 'on' );?> > |
|
464 | - <label for="lasso_editor[support_custom_taxonomy]"><?php _e( 'Support Custom Taxonomy', 'lasso' );?></label> |
|
465 | - <span class="lasso--setting-description"><?php _e( 'Allow editing custom taxonomies.', 'lasso' );?></span> |
|
463 | + <input type="checkbox" class="checkbox" name="lasso_editor[support_custom_taxonomy]" id="lasso_editor[support_custom_taxonomy]" <?php echo checked($support_custom_taxonomy, 'on'); ?> > |
|
464 | + <label for="lasso_editor[support_custom_taxonomy]"><?php _e('Support Custom Taxonomy', 'lasso'); ?></label> |
|
465 | + <span class="lasso--setting-description"><?php _e('Allow editing custom taxonomies.', 'lasso'); ?></span> |
|
466 | 466 | </div> |
467 | 467 | |
468 | 468 | |
469 | 469 | </div> |
470 | 470 | |
471 | - <h3 class="accordion"><?php _e( 'Misc', 'lasso' );?></h3> |
|
471 | + <h3 class="accordion"><?php _e('Misc', 'lasso'); ?></h3> |
|
472 | 472 | <div class="lasso-editor-settings--option-wrap"> |
473 | 473 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
474 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> > |
|
475 | - <label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label> |
|
476 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span> |
|
474 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> > |
|
475 | + <label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label> |
|
476 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span> |
|
477 | 477 | </div> |
478 | 478 | |
479 | 479 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
480 | - <label><?php _e( 'Placeholder Text for New Post', 'lasso' );?></label> |
|
481 | - <span class="lasso--setting-description"><?php _e( 'Placeholder text to be displayed when a new post is created.', 'lasso' );?></span> |
|
482 | - <input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr( $new_post_text );?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso')));echo $def;?>", true)> |
|
480 | + <label><?php _e('Placeholder Text for New Post', 'lasso'); ?></label> |
|
481 | + <span class="lasso--setting-description"><?php _e('Placeholder text to be displayed when a new post is created.', 'lasso'); ?></span> |
|
482 | + <input type="text" name="lasso_editor[new_post_text]" id="lasso_editor[new_post_text]" value="<?php echo esc_attr($new_post_text); ?>" placeholder="<?php $def = wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso'))); echo $def; ?>", true)> |
|
483 | 483 | </div> |
484 | 484 | |
485 | 485 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
486 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_shortcode_editing]" id="lasso_editor[disable_shortcode_editing]" <?php echo checked( $disable_shortcode_editing, 'on' );?> > |
|
487 | - <label for="lasso_editor[disable_shortcode_editing]"> <?php _e( 'Do Not Allow Shortcode Editing', 'lasso' );?></label> |
|
488 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable frontend editing of shortcodes.', 'lasso' );?></span> |
|
486 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_shortcode_editing]" id="lasso_editor[disable_shortcode_editing]" <?php echo checked($disable_shortcode_editing, 'on'); ?> > |
|
487 | + <label for="lasso_editor[disable_shortcode_editing]"> <?php _e('Do Not Allow Shortcode Editing', 'lasso'); ?></label> |
|
488 | + <span class="lasso--setting-description"><?php _e('Check this box to disable frontend editing of shortcodes.', 'lasso'); ?></span> |
|
489 | 489 | </div> |
490 | 490 | |
491 | 491 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
492 | - <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label> |
|
493 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span> |
|
494 | - <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b |
|
495 | - <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong |
|
492 | + <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label> |
|
493 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span> |
|
494 | + <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b |
|
495 | + <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong |
|
496 | 496 | </div> |
497 | 497 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
498 | - <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label> |
|
499 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span> |
|
500 | - <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i |
|
501 | - <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em |
|
498 | + <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label> |
|
499 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span> |
|
500 | + <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i |
|
501 | + <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em |
|
502 | 502 | </div> |
503 | 503 | <div class="lasso-editor-settings--option-inner" style="border:none" > |
504 | - <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> > |
|
505 | - <label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label> |
|
506 | - <span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span> |
|
504 | + <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> > |
|
505 | + <label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label> |
|
506 | + <span class="lasso--setting-description"><?php _e('When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso'); ?></span> |
|
507 | 507 | </div> |
508 | 508 | <div class="lasso-editor-settings--option-inner" > |
509 | - <input type="checkbox" class="checkbox" name="lasso_editor[inherit_categories]" id="lasso_editor[inherit_categories]" <?php echo checked( $inherit_categories, 'on' );?> > |
|
510 | - <label for="lasso_editor[inherit_categories]"><?php _e( 'Inherit Post Categories When Creating a New Post', 'lasso' );?></label> |
|
511 | - <span class="lasso--setting-description"><?php _e( 'When creating a new post, take the categories of the current post and apply to the new post.', 'lasso' );?></span> |
|
509 | + <input type="checkbox" class="checkbox" name="lasso_editor[inherit_categories]" id="lasso_editor[inherit_categories]" <?php echo checked($inherit_categories, 'on'); ?> > |
|
510 | + <label for="lasso_editor[inherit_categories]"><?php _e('Inherit Post Categories When Creating a New Post', 'lasso'); ?></label> |
|
511 | + <span class="lasso--setting-description"><?php _e('When creating a new post, take the categories of the current post and apply to the new post.', 'lasso'); ?></span> |
|
512 | 512 | </div> |
513 | 513 | </div> |
514 | 514 | |
515 | - <h3 class="accordion"><?php _e( 'Advanced Options', 'lasso' );?></h3> |
|
515 | + <h3 class="accordion"><?php _e('Advanced Options', 'lasso'); ?></h3> |
|
516 | 516 | |
517 | 517 | <div class="lasso-editor-settings--option-wrap "> |
518 | - <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span> |
|
518 | + <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span> |
|
519 | 519 | <span class="lasso--setting-description"> </span> |
520 | 520 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
521 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
522 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
523 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
521 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
522 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
523 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
524 | 524 | </div> |
525 | 525 | |
526 | 526 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
527 | - <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> > |
|
528 | - <label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label> |
|
529 | - <span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span> |
|
527 | + <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> > |
|
528 | + <label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label> |
|
529 | + <span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span> |
|
530 | 530 | </div> |
531 | 531 | |
532 | 532 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
533 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> > |
|
534 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
535 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span> |
|
533 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> > |
|
534 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
535 | + <span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span> |
|
536 | 536 | |
537 | 537 | </div> |
538 | 538 | |
539 | 539 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
540 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> > |
|
541 | - <label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label> |
|
542 | - <span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span> |
|
540 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> > |
|
541 | + <label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label> |
|
542 | + <span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span> |
|
543 | 543 | |
544 | 544 | </div> |
545 | 545 | |
546 | 546 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
547 | - <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> > |
|
548 | - <label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label> |
|
549 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span> |
|
547 | + <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> > |
|
548 | + <label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label> |
|
549 | + <span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span> |
|
550 | 550 | |
551 | 551 | </div> |
552 | 552 | |
553 | 553 | <div class="lasso-editor-settings--option-inner"> |
554 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_wrap_shortcode]" id="lasso_editor[no_wrap_shortcode]" <?php echo checked( $no_wrap_shortcode, 'on' );?> > |
|
555 | - <label for="lasso_editor[no_wrap_shortcode]"><?php _e( "Don't Wrap Shortcodes", 'lasso' );?></label> |
|
556 | - <span class="lasso--setting-description"><?php _e( 'By default Editus wraps shortcodes so they can be preserved. Disable this behavior.', 'lasso' );?></span> |
|
554 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_wrap_shortcode]" id="lasso_editor[no_wrap_shortcode]" <?php echo checked($no_wrap_shortcode, 'on'); ?> > |
|
555 | + <label for="lasso_editor[no_wrap_shortcode]"><?php _e("Don't Wrap Shortcodes", 'lasso'); ?></label> |
|
556 | + <span class="lasso--setting-description"><?php _e('By default Editus wraps shortcodes so they can be preserved. Disable this behavior.', 'lasso'); ?></span> |
|
557 | 557 | |
558 | 558 | </div> |
559 | 559 | </div> |
@@ -563,11 +563,11 @@ discard block |
||
563 | 563 | |
564 | 564 | <div class="lasso-editor-settings--submit"> |
565 | 565 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
566 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
567 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
566 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
567 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
568 | 568 | </div> |
569 | 569 | |
570 | - <?php do_action('lasso_settings_after');?> |
|
570 | + <?php do_action('lasso_settings_after'); ?> |
|
571 | 571 | </form> |
572 | 572 | |
573 | 573 | </div><?php |
@@ -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 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
242 | 242 | |
243 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
243 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
244 | 244 | |
245 | 245 | ?> |
246 | 246 | <div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" style="display:none;"> |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | function lasso_editor_text_toolbar() { |
299 | 299 | |
300 | 300 | ob_start(); |
301 | - $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
301 | + $text_select_popup = lasso_editor_get_option('text_select_popup', 'lasso_editor', false); |
|
302 | 302 | |
303 | 303 | |
304 | 304 | $is_mobile = wp_is_mobile(); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
318 | 318 | |
319 | 319 | // mobile styles |
320 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
320 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
321 | 321 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
322 | 322 | |
323 | 323 | //show color |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
334 | 334 | |
335 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
335 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
336 | 336 | |
337 | 337 | ?> |
338 | 338 | <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | //editor options |
558 | 558 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
559 | - $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
559 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
560 | 560 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
561 | 561 | $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
562 | 562 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | // do we support pending status |
578 | 578 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
579 | 579 | |
580 | - $excerpt = $post->post_excerpt; |
|
580 | + $excerpt = $post->post_excerpt; |
|
581 | 581 | |
582 | 582 | ?> |
583 | 583 | <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | }?> |
675 | 675 | <?php |
676 | 676 | if ($allow_change_date) { |
677 | - $dateformat = get_option( 'date_format' ); |
|
677 | + $dateformat = get_option( 'date_format' ); |
|
678 | 678 | ?> |
679 | 679 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
680 | 680 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | $types = lasso_post_types_names(); |
769 | 769 | if ( !empty( $types ) ) { |
770 | 770 | foreach( $types as $name => $label ) |
771 | - { |
|
772 | - $type = $name; |
|
771 | + { |
|
772 | + $type = $name; |
|
773 | 773 | //$type = preg_replace( '/s\b/','', $name ); |
774 | 774 | if ($type == 'page' && !current_user_can('edit_pages')) { |
775 | 775 | continue; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | if ( !empty( $types ) ) { |
792 | 792 | // get the first element |
793 | 793 | $keys = array_keys($types); |
794 | - $type =$keys[0]; |
|
794 | + $type =$keys[0]; |
|
795 | 795 | //$type = preg_replace( '/s\b/','', $type ); |
796 | 796 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
797 | 797 | } |
@@ -819,8 +819,8 @@ discard block |
||
819 | 819 | global $post; |
820 | 820 | |
821 | 821 | global $wp_post_types; |
822 | - $labels = &$wp_post_types['post']->labels; |
|
823 | - $labels->name = 'Articles'; |
|
822 | + $labels = &$wp_post_types['post']->labels; |
|
823 | + $labels->name = 'Articles'; |
|
824 | 824 | |
825 | 825 | ob_start(); |
826 | 826 | |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | ob_start(); |
881 | 881 | |
882 | 882 | |
883 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
883 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
884 | 884 | |
885 | 885 | // let users add custom css classes |
886 | 886 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -982,10 +982,10 @@ discard block |
||
982 | 982 | function lasso_editor_options_blob() { |
983 | 983 | |
984 | 984 | $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
985 | - $codes = add_wpimg_options( $codes ); |
|
985 | + $codes = add_wpimg_options( $codes ); |
|
986 | 986 | $codes = add_wpimg_block_options( $codes ); |
987 | 987 | $codes = add_wpcover_block_options( $codes ); |
988 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
988 | + $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
989 | 989 | $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
990 | 990 | |
991 | 991 | $nonce = wp_create_nonce( 'lasso_gallery' ); |
@@ -1087,9 +1087,9 @@ discard block |
||
1087 | 1087 | $return .= '</form>'; |
1088 | 1088 | |
1089 | 1089 | // extra JS codes |
1090 | - if (isset($shortcode['codes'])) { |
|
1091 | - $return .= $shortcode['codes']; |
|
1092 | - } |
|
1090 | + if (isset($shortcode['codes'])) { |
|
1091 | + $return .= $shortcode['codes']; |
|
1092 | + } |
|
1093 | 1093 | $blob[$slug] = $return; |
1094 | 1094 | } |
1095 | 1095 | |
@@ -1098,95 +1098,95 @@ discard block |
||
1098 | 1098 | |
1099 | 1099 | |
1100 | 1100 | function add_wpimg_options( $shortcodes ) { |
1101 | - $custom = array( |
|
1102 | - 'wpimg' => array( |
|
1103 | - 'name' => __( 'Image', 'lasso' ), |
|
1104 | - 'type' => 'single', |
|
1105 | - 'atts' => array( |
|
1106 | - 'img' => array( |
|
1107 | - 'type' => 'media_upload', |
|
1108 | - 'default' => '', |
|
1109 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1110 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1111 | - ), |
|
1112 | - 'align' => array( |
|
1113 | - 'type' => 'select', |
|
1114 | - 'values' => array( |
|
1115 | - array( |
|
1116 | - 'value' => 'center', |
|
1117 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1118 | - ), |
|
1119 | - array( |
|
1120 | - 'value' => 'left', |
|
1121 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1122 | - ), |
|
1123 | - array( |
|
1124 | - 'value' => 'right', |
|
1125 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1126 | - ), |
|
1127 | - ), |
|
1128 | - 'default' => 'center', |
|
1129 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1130 | - 'tip'=>'' |
|
1131 | - ), |
|
1101 | + $custom = array( |
|
1102 | + 'wpimg' => array( |
|
1103 | + 'name' => __( 'Image', 'lasso' ), |
|
1104 | + 'type' => 'single', |
|
1105 | + 'atts' => array( |
|
1106 | + 'img' => array( |
|
1107 | + 'type' => 'media_upload', |
|
1108 | + 'default' => '', |
|
1109 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1110 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1111 | + ), |
|
1112 | + 'align' => array( |
|
1113 | + 'type' => 'select', |
|
1114 | + 'values' => array( |
|
1115 | + array( |
|
1116 | + 'value' => 'center', |
|
1117 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1118 | + ), |
|
1119 | + array( |
|
1120 | + 'value' => 'left', |
|
1121 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1122 | + ), |
|
1123 | + array( |
|
1124 | + 'value' => 'right', |
|
1125 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1126 | + ), |
|
1127 | + ), |
|
1128 | + 'default' => 'center', |
|
1129 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1130 | + 'tip'=>'' |
|
1131 | + ), |
|
1132 | 1132 | |
1133 | - 'imgwidth' => array( |
|
1134 | - 'type' => 'text_small', |
|
1135 | - 'default' => '300px', |
|
1136 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1137 | - 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
1138 | - ), |
|
1139 | - 'imgheight' => array( |
|
1140 | - 'type' => 'text_small', |
|
1141 | - 'default' => '', |
|
1142 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1143 | - 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
1144 | - ), |
|
1145 | - 'linkoption' => array( |
|
1146 | - 'type' => 'select', |
|
1147 | - 'values' => array( |
|
1148 | - array( |
|
1149 | - 'value' => 'none', |
|
1150 | - 'name' => __( 'None', 'aesop-core' ) |
|
1151 | - ), |
|
1152 | - array( |
|
1153 | - 'value' => 'img', |
|
1154 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1155 | - ), |
|
1156 | - array( |
|
1157 | - 'value' => 'url', |
|
1158 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1159 | - ), |
|
1160 | - ), |
|
1161 | - 'default' => 'none', |
|
1162 | - 'desc' => __( 'Link', 'lasso' ), |
|
1163 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1164 | - ), |
|
1133 | + 'imgwidth' => array( |
|
1134 | + 'type' => 'text_small', |
|
1135 | + 'default' => '300px', |
|
1136 | + 'desc' => __( 'Image Width', 'lasso' ), |
|
1137 | + 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
1138 | + ), |
|
1139 | + 'imgheight' => array( |
|
1140 | + 'type' => 'text_small', |
|
1141 | + 'default' => '', |
|
1142 | + 'desc' => __( 'Image Height', 'lasso' ), |
|
1143 | + 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
1144 | + ), |
|
1145 | + 'linkoption' => array( |
|
1146 | + 'type' => 'select', |
|
1147 | + 'values' => array( |
|
1148 | + array( |
|
1149 | + 'value' => 'none', |
|
1150 | + 'name' => __( 'None', 'aesop-core' ) |
|
1151 | + ), |
|
1152 | + array( |
|
1153 | + 'value' => 'img', |
|
1154 | + 'name' => __( 'Image', 'aesop-core' ) |
|
1155 | + ), |
|
1156 | + array( |
|
1157 | + 'value' => 'url', |
|
1158 | + 'name' => __( 'URL', 'aesop-core' ) |
|
1159 | + ), |
|
1160 | + ), |
|
1161 | + 'default' => 'none', |
|
1162 | + 'desc' => __( 'Link', 'lasso' ), |
|
1163 | + 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1164 | + ), |
|
1165 | 1165 | |
1166 | - 'link' => array( |
|
1167 | - 'type' => 'text', |
|
1168 | - 'default' => '', |
|
1169 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1170 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1171 | - ), |
|
1172 | - 'alt' => array( |
|
1173 | - 'type' => 'text', |
|
1174 | - 'default' => '', |
|
1175 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1176 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1177 | - ), |
|
1166 | + 'link' => array( |
|
1167 | + 'type' => 'text', |
|
1168 | + 'default' => '', |
|
1169 | + 'desc' => __( 'URL Link', 'lasso' ), |
|
1170 | + 'tip' => __( 'URL link', 'lasso' ) |
|
1171 | + ), |
|
1172 | + 'alt' => array( |
|
1173 | + 'type' => 'text', |
|
1174 | + 'default' => '', |
|
1175 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1176 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1177 | + ), |
|
1178 | 1178 | |
1179 | - 'caption' => array( |
|
1180 | - 'type' => 'text_area', |
|
1181 | - 'default' => '', |
|
1182 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1183 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1184 | - ), |
|
1179 | + 'caption' => array( |
|
1180 | + 'type' => 'text_area', |
|
1181 | + 'default' => '', |
|
1182 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1183 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1184 | + ), |
|
1185 | 1185 | |
1186 | 1186 | |
1187 | - ), |
|
1188 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1189 | - 'codes' => '<script> |
|
1187 | + ), |
|
1188 | + 'desc' => __( 'An image.', 'aesop-core' ), |
|
1189 | + 'codes' => '<script> |
|
1190 | 1190 | jQuery(document).ready(function($){ |
1191 | 1191 | function linkSetting(l){ |
1192 | 1192 | if ( l=="url") { |
@@ -1206,101 +1206,101 @@ discard block |
||
1206 | 1206 | }) |
1207 | 1207 | }); |
1208 | 1208 | </script>' |
1209 | - ) |
|
1210 | - ); |
|
1209 | + ) |
|
1210 | + ); |
|
1211 | 1211 | |
1212 | - return array_merge( $shortcodes, $custom ); |
|
1212 | + return array_merge( $shortcodes, $custom ); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | function add_wpimg_block_options( $shortcodes ) { |
1216 | - $custom = array( |
|
1217 | - 'wpimg-block' => array( |
|
1218 | - 'name' => __( 'Image', 'lasso' ), |
|
1219 | - 'type' => 'single', |
|
1220 | - 'atts' => array( |
|
1221 | - 'img' => array( |
|
1222 | - 'type' => 'media_upload', |
|
1223 | - 'default' => '', |
|
1224 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1225 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1226 | - ), |
|
1227 | - 'align' => array( |
|
1228 | - 'type' => 'select', |
|
1229 | - 'values' => array( |
|
1230 | - array( |
|
1231 | - 'value' => 'center', |
|
1232 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1233 | - ), |
|
1234 | - array( |
|
1235 | - 'value' => 'left', |
|
1236 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1237 | - ), |
|
1238 | - array( |
|
1239 | - 'value' => 'right', |
|
1240 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1241 | - ), |
|
1242 | - ), |
|
1243 | - 'default' => 'center', |
|
1244 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1245 | - 'tip'=>'' |
|
1246 | - ), |
|
1247 | - 'alt' => array( |
|
1248 | - 'type' => 'text', |
|
1249 | - 'default' => '', |
|
1250 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1251 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1252 | - ), |
|
1253 | - 'caption' => array( |
|
1254 | - 'type' => 'text', |
|
1255 | - 'default' => '', |
|
1256 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1257 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1258 | - ), |
|
1259 | - 'link' => array( |
|
1260 | - 'type' => 'text', |
|
1261 | - 'default' => '', |
|
1262 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1263 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1264 | - ), |
|
1216 | + $custom = array( |
|
1217 | + 'wpimg-block' => array( |
|
1218 | + 'name' => __( 'Image', 'lasso' ), |
|
1219 | + 'type' => 'single', |
|
1220 | + 'atts' => array( |
|
1221 | + 'img' => array( |
|
1222 | + 'type' => 'media_upload', |
|
1223 | + 'default' => '', |
|
1224 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1225 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1226 | + ), |
|
1227 | + 'align' => array( |
|
1228 | + 'type' => 'select', |
|
1229 | + 'values' => array( |
|
1230 | + array( |
|
1231 | + 'value' => 'center', |
|
1232 | + 'name' => __( 'Center', 'aesop-core' ) |
|
1233 | + ), |
|
1234 | + array( |
|
1235 | + 'value' => 'left', |
|
1236 | + 'name' => __( 'Left', 'aesop-core' ) |
|
1237 | + ), |
|
1238 | + array( |
|
1239 | + 'value' => 'right', |
|
1240 | + 'name' => __( 'Right', 'aesop-core' ) |
|
1241 | + ), |
|
1242 | + ), |
|
1243 | + 'default' => 'center', |
|
1244 | + 'desc' => __( 'Alignment', 'lasso' ), |
|
1245 | + 'tip'=>'' |
|
1246 | + ), |
|
1247 | + 'alt' => array( |
|
1248 | + 'type' => 'text', |
|
1249 | + 'default' => '', |
|
1250 | + 'desc' => __( 'Image ALT', 'lasso' ), |
|
1251 | + 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1252 | + ), |
|
1253 | + 'caption' => array( |
|
1254 | + 'type' => 'text', |
|
1255 | + 'default' => '', |
|
1256 | + 'desc' => __( 'Caption', 'lasso' ), |
|
1257 | + 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1258 | + ), |
|
1259 | + 'link' => array( |
|
1260 | + 'type' => 'text', |
|
1261 | + 'default' => '', |
|
1262 | + 'desc' => __( 'Link URL', 'lasso' ), |
|
1263 | + 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1264 | + ), |
|
1265 | 1265 | |
1266 | 1266 | |
1267 | - ), |
|
1268 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1269 | - 'codes' => '<script> |
|
1267 | + ), |
|
1268 | + 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1269 | + 'codes' => '<script> |
|
1270 | 1270 | jQuery(document).ready(function($){ |
1271 | 1271 | |
1272 | 1272 | }); |
1273 | 1273 | </script>' |
1274 | - ) |
|
1275 | - ); |
|
1274 | + ) |
|
1275 | + ); |
|
1276 | 1276 | |
1277 | - return array_merge( $shortcodes, $custom ); |
|
1277 | + return array_merge( $shortcodes, $custom ); |
|
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | function add_wpcover_block_options( $shortcodes ) { |
1281 | - $custom = array( |
|
1282 | - 'wpcover-block' => array( |
|
1283 | - 'name' => __( 'Cover', 'lasso' ), |
|
1284 | - 'type' => 'single', |
|
1285 | - 'atts' => array( |
|
1286 | - 'img' => array( |
|
1287 | - 'type' => 'media_upload', |
|
1288 | - 'default' => '', |
|
1289 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1290 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1291 | - ) |
|
1292 | - |
|
1293 | - ), |
|
1294 | - 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
1295 | - 'codes' => '<script> |
|
1281 | + $custom = array( |
|
1282 | + 'wpcover-block' => array( |
|
1283 | + 'name' => __( 'Cover', 'lasso' ), |
|
1284 | + 'type' => 'single', |
|
1285 | + 'atts' => array( |
|
1286 | + 'img' => array( |
|
1287 | + 'type' => 'media_upload', |
|
1288 | + 'default' => '', |
|
1289 | + 'desc' => __( 'Image URL', 'lasso' ), |
|
1290 | + 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1291 | + ) |
|
1292 | + |
|
1293 | + ), |
|
1294 | + 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
1295 | + 'codes' => '<script> |
|
1296 | 1296 | jQuery(document).ready(function($){ |
1297 | 1297 | |
1298 | 1298 | }); |
1299 | 1299 | </script>' |
1300 | - ) |
|
1301 | - ); |
|
1300 | + ) |
|
1301 | + ); |
|
1302 | 1302 | |
1303 | - return array_merge( $shortcodes, $custom ); |
|
1303 | + return array_merge( $shortcodes, $custom ); |
|
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | /** |
@@ -1345,23 +1345,23 @@ discard block |
||
1345 | 1345 | * @return string |
1346 | 1346 | */ |
1347 | 1347 | function lasso_editor_adjustBrightness($hex, $steps) { |
1348 | - $steps = max(-255, min(255, $steps)); |
|
1348 | + $steps = max(-255, min(255, $steps)); |
|
1349 | 1349 | |
1350 | - // Normalize into a six character long hex string |
|
1351 | - $hex = str_replace('#', '', $hex); |
|
1352 | - if (strlen($hex) == 3) { |
|
1353 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1354 | - } |
|
1350 | + // Normalize into a six character long hex string |
|
1351 | + $hex = str_replace('#', '', $hex); |
|
1352 | + if (strlen($hex) == 3) { |
|
1353 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1354 | + } |
|
1355 | 1355 | |
1356 | - // Split into three parts: R, G and B |
|
1357 | - $color_parts = str_split($hex, 2); |
|
1358 | - $return = '#'; |
|
1356 | + // Split into three parts: R, G and B |
|
1357 | + $color_parts = str_split($hex, 2); |
|
1358 | + $return = '#'; |
|
1359 | 1359 | |
1360 | - foreach ($color_parts as $color) { |
|
1361 | - $color = hexdec($color); // Convert to decimal |
|
1362 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1363 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1364 | - } |
|
1360 | + foreach ($color_parts as $color) { |
|
1361 | + $color = hexdec($color); // Convert to decimal |
|
1362 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1363 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
1364 | + } |
|
1365 | 1365 | |
1366 | - return $return; |
|
1366 | + return $return; |
|
1367 | 1367 | } |
@@ -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;?>; |
|
78 | + color: <?php echo $text_color; ?>; |
|
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> |
@@ -216,17 +216,17 @@ discard block |
||
216 | 216 | $is_mobile = wp_is_mobile(); |
217 | 217 | |
218 | 218 | // check for lasso story engine and add a class doniting this |
219 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
219 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
220 | 220 | |
221 | 221 | // let users add custom css classes |
222 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
222 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
223 | 223 | |
224 | 224 | // are toolbar headings enabled |
225 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
226 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
227 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
225 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
226 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
227 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
228 | 228 | |
229 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
229 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
230 | 230 | |
231 | 231 | //show color |
232 | 232 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -234,56 +234,56 @@ discard block |
||
234 | 234 | //show alignment |
235 | 235 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
236 | 236 | |
237 | - $status = get_post_status( get_the_ID() ); |
|
237 | + $status = get_post_status(get_the_ID()); |
|
238 | 238 | |
239 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
239 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
240 | 240 | |
241 | - $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
241 | + $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
242 | 242 | |
243 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
243 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
244 | 244 | |
245 | 245 | ?> |
246 | - <div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" style="display:none;"> |
|
247 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
248 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
249 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
250 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
251 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
252 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
246 | + <div class="lasso--text-popup lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" style="display:none;"> |
|
247 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
248 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
249 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
250 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
251 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
252 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
253 | 253 | |
254 | - <?php if ( $toolbar_headings ): ?> |
|
255 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
256 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
254 | + <?php if ($toolbar_headings): ?> |
|
255 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
256 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
257 | 257 | <?php endif; ?> |
258 | 258 | |
259 | 259 | |
260 | 260 | |
261 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
262 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
263 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
264 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
261 | + <?php if ($toolbar_headings_h4): ?> |
|
262 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
263 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
264 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
265 | 265 | <?php endif; ?> |
266 | 266 | |
267 | - <?php if ( $show_color ): ?> |
|
268 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
269 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
267 | + <?php if ($show_color): ?> |
|
268 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
269 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
270 | 270 | <?php endif; ?> |
271 | 271 | |
272 | - <?php if ( $toolbar_list ): ?> |
|
273 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
274 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
272 | + <?php if ($toolbar_list): ?> |
|
273 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
274 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
275 | 275 | <?php endif; ?> |
276 | 276 | |
277 | 277 | |
278 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
278 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
279 | 279 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
280 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
281 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
280 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
281 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
282 | 282 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
283 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
283 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
284 | 284 | </div> |
285 | 285 | </li> |
286 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
286 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
287 | 287 | </ul> |
288 | 288 | </div> |
289 | 289 | |
@@ -304,21 +304,21 @@ discard block |
||
304 | 304 | $is_mobile = wp_is_mobile(); |
305 | 305 | |
306 | 306 | // check for lasso story engine and add a class doniting this |
307 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
307 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
308 | 308 | |
309 | 309 | // let users add custom css classes |
310 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
310 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
311 | 311 | |
312 | 312 | // are toolbar headings enabled |
313 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
314 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
315 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
313 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
314 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
315 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
316 | 316 | |
317 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
317 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
318 | 318 | |
319 | 319 | // mobile styles |
320 | 320 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
321 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
321 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
322 | 322 | |
323 | 323 | //show color |
324 | 324 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -326,140 +326,140 @@ discard block |
||
326 | 326 | //show alignment |
327 | 327 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
328 | 328 | |
329 | - $status = get_post_status( get_the_ID() ); |
|
329 | + $status = get_post_status(get_the_ID()); |
|
330 | 330 | |
331 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
331 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
332 | 332 | |
333 | - $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
333 | + $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
334 | 334 | |
335 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
335 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
336 | 336 | |
337 | 337 | ?> |
338 | - <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 ?>> |
|
339 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
340 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
338 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
339 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
340 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
341 | 341 | <?php if (!$text_select_popup) { ?> |
342 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
343 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
344 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
345 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
342 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
343 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
344 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
345 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
346 | 346 | <?php }?> |
347 | - <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
347 | + <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
348 | 348 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
349 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
350 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
351 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
352 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
353 | - <!--li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li--> |
|
354 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
355 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
356 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
357 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
358 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
359 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
360 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
361 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
362 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
363 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
364 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
349 | + <?php if ('ase-active' == $ase_status): ?> |
|
350 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
351 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
352 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
353 | + <!--li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li--> |
|
354 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
355 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
356 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
357 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
358 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
359 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
360 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
361 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
362 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
363 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
364 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
365 | 365 | <?php }?> |
366 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
367 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
366 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
367 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
368 | 368 | <?php }?> |
369 | 369 | <?php else: ?> |
370 | 370 | <?php if ($use_wp_block_image == 'on') { ?> |
371 | - <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
371 | + <li data-type="wpimg-block" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
372 | 372 | <?php } else { ?> |
373 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
373 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
374 | 374 | <?php } ?> |
375 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
376 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
375 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
376 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
377 | 377 | <?php endif; ?> |
378 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
378 | + <?php do_action('lasso_toolbar_components'); ?> |
|
379 | 379 | </ul> |
380 | 380 | </li> |
381 | 381 | <?php if (!$text_select_popup) { ?> |
382 | 382 | |
383 | - <?php if ( $toolbar_headings ): ?> |
|
384 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
385 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
383 | + <?php if ($toolbar_headings): ?> |
|
384 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
385 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
386 | 386 | <?php endif; ?> |
387 | 387 | |
388 | 388 | |
389 | 389 | |
390 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
391 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
392 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
393 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
390 | + <?php if ($toolbar_headings_h4): ?> |
|
391 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
392 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
393 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
394 | 394 | <?php endif; ?> |
395 | 395 | |
396 | - <?php if ( $show_color ): ?> |
|
397 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
398 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
396 | + <?php if ($show_color): ?> |
|
397 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
398 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
399 | 399 | <?php endif; ?> |
400 | 400 | |
401 | - <?php if ( $toolbar_list ): ?> |
|
402 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
403 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
401 | + <?php if ($toolbar_list): ?> |
|
402 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
403 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
404 | 404 | <?php endif; ?> |
405 | 405 | |
406 | 406 | |
407 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
407 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
408 | 408 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
409 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
410 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
409 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
410 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
411 | 411 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
412 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
412 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
413 | 413 | </div> |
414 | 414 | </li> |
415 | 415 | |
416 | 416 | <?php } ?> |
417 | 417 | |
418 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
419 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
418 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
419 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
420 | 420 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
421 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
421 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
422 | 422 | <div id="lasso-toolbar--html__footer"> |
423 | 423 | <div id="lasso-toolbar--html__footer_desc" > |
424 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
425 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
426 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
424 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
425 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
426 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
427 | 427 | </div> |
428 | 428 | <ul class="lasso-toolbar--html-snips"> |
429 | 429 | |
430 | - <?php if ( !$toolbar_headings ): ?> |
|
431 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
432 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
430 | + <?php if (!$toolbar_headings): ?> |
|
431 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
432 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
433 | 433 | <?php endif; ?> |
434 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
435 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
434 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
435 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
436 | 436 | |
437 | - <li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>"> |
|
437 | + <li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>"> |
|
438 | 438 | </ul> |
439 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
440 | - <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> |
|
439 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
440 | + <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> |
|
441 | 441 | </div> |
442 | 442 | </div> |
443 | 443 | </li> |
444 | 444 | |
445 | - <?php if ( $show_align ): ?> |
|
446 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
447 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
448 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
445 | + <?php if ($show_align): ?> |
|
446 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
447 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
448 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
449 | 449 | <?php endif; ?> |
450 | 450 | |
451 | 451 | </ul> |
452 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
452 | + <?php if (is_singular() && $is_mobile) { ?> |
|
453 | 453 | |
454 | - <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;"> |
|
454 | + <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;"> |
|
455 | 455 | |
456 | - <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> |
|
457 | - <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> |
|
456 | + <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> |
|
457 | + <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> |
|
458 | 458 | |
459 | - <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> |
|
459 | + <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> |
|
460 | 460 | |
461 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
462 | - <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> |
|
461 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
462 | + <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> |
|
463 | 463 | <?php } ?> |
464 | 464 | |
465 | 465 | </div> |
@@ -479,20 +479,20 @@ discard block |
||
479 | 479 | */ |
480 | 480 | function lasso_editor_settings_toolbar() { |
481 | 481 | |
482 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
482 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
483 | 483 | |
484 | 484 | ob_start(); |
485 | 485 | |
486 | 486 | |
487 | 487 | // let users add custom css classes |
488 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
488 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
489 | 489 | |
490 | 490 | ?> |
491 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
492 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
493 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
494 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
495 | - <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> |
|
491 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
492 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
493 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
494 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
495 | + <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> |
|
496 | 496 | </ul> |
497 | 497 | |
498 | 498 | <?php return ob_get_clean(); |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | |
511 | 511 | |
512 | 512 | // has post thumbnail |
513 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
513 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
514 | 514 | |
515 | 515 | ?> |
516 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
517 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
518 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
519 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
516 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
517 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
518 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
519 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
520 | 520 | </ul> |
521 | 521 | |
522 | 522 | <?php return ob_get_clean(); |
@@ -540,39 +540,39 @@ discard block |
||
540 | 540 | |
541 | 541 | $postid = get_the_ID(); |
542 | 542 | |
543 | - $status = get_post_status( $postid ); |
|
544 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
543 | + $status = get_post_status($postid); |
|
544 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
545 | 545 | |
546 | 546 | // let users add custom css classes |
547 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
547 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
548 | 548 | |
549 | 549 | // objects categories |
550 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
551 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
550 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
551 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
552 | 552 | |
553 | 553 | // modal tabs |
554 | - $tabs = lasso_modal_addons('tab'); |
|
555 | - $content = lasso_modal_addons('content'); |
|
554 | + $tabs = lasso_modal_addons('tab'); |
|
555 | + $content = lasso_modal_addons('content'); |
|
556 | 556 | |
557 | 557 | //editor options |
558 | 558 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
559 | 559 | $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
560 | 560 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
561 | - $support_custom_taxonomy = lasso_editor_get_option( 'support_custom_taxonomy', 'lasso_editor' ); |
|
561 | + $support_custom_taxonomy = lasso_editor_get_option('support_custom_taxonomy', 'lasso_editor'); |
|
562 | 562 | |
563 | 563 | //get custom taxonomy |
564 | 564 | if ($support_custom_taxonomy) { |
565 | - $custom_taxonomies = array_diff(get_object_taxonomies( get_post_type( $postid ), 'names' ), ['category','post_tag','post_format']); |
|
565 | + $custom_taxonomies = array_diff(get_object_taxonomies(get_post_type($postid), 'names'), ['category', 'post_tag', 'post_format']); |
|
566 | 566 | } else { |
567 | 567 | $custom_taxonomies = []; |
568 | 568 | } |
569 | 569 | |
570 | 570 | // are we singular |
571 | - $is_singular = is_singular(); |
|
571 | + $is_singular = is_singular(); |
|
572 | 572 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
573 | 573 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
574 | 574 | $theme_supports = current_theme_supports('post-thumbnails'); |
575 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
575 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
576 | 576 | |
577 | 577 | // do we support pending status |
578 | 578 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -580,26 +580,26 @@ discard block |
||
580 | 580 | $excerpt = $post->post_excerpt; |
581 | 581 | |
582 | 582 | ?> |
583 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
583 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
584 | 584 | <div class="lasso--modal__inner"> |
585 | 585 | |
586 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
586 | + <?php if ($tabs) { echo $tabs; } ?> |
|
587 | 587 | |
588 | 588 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
589 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
589 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
590 | 590 | |
591 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
591 | + <?php if ($is_singular && $theme_supports) : ?> |
|
592 | 592 | <div class="lasso--postsettings__left"> |
593 | - <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> |
|
594 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
593 | + <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> |
|
594 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
595 | 595 | |
596 | 596 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
597 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
598 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
597 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
598 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
599 | 599 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
600 | 600 | </div> |
601 | 601 | |
602 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
602 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
603 | 603 | |
604 | 604 | </div> |
605 | 605 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -609,15 +609,15 @@ discard block |
||
609 | 609 | |
610 | 610 | <div class="lasso--postsettings__right"> |
611 | 611 | |
612 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
612 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
613 | 613 | <div class="lasso--postsettings__option story-status-option"> |
614 | - <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> |
|
615 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
616 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
617 | - <?php if( !$no_pending_status ): ?> |
|
618 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
614 | + <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> |
|
615 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
616 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
617 | + <?php if (!$no_pending_status): ?> |
|
618 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
619 | 619 | <?php endif; ?> |
620 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
620 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
621 | 621 | </ul> |
622 | 622 | <div class="lasso--slider_wrap"> |
623 | 623 | <div id="lasso--slider"></div> |
@@ -625,10 +625,10 @@ discard block |
||
625 | 625 | </div> |
626 | 626 | <?php endif; ?> |
627 | 627 | |
628 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
628 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
629 | 629 | <div class="lasso--postsettings__option story-slug-option"> |
630 | - <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> |
|
631 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
630 | + <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> |
|
631 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
632 | 632 | </div> |
633 | 633 | <?php endif; ?> |
634 | 634 | |
@@ -637,20 +637,20 @@ discard block |
||
637 | 637 | <div class="lasso--postsettings__middle"> |
638 | 638 | |
639 | 639 | <div class="lasso--postsettings__option story-categories-option"> |
640 | - <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> |
|
641 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
640 | + <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> |
|
641 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
642 | 642 | </div> |
643 | 643 | |
644 | 644 | <div class="lasso--postsettings__option story-tags-option"> |
645 | - <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> |
|
646 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
645 | + <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> |
|
646 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
647 | 647 | </div> |
648 | 648 | |
649 | 649 | <?php |
650 | 650 | if (!empty($custom_taxonomies)) { |
651 | 651 | ?> |
652 | 652 | <div class="lasso--postsettings__option story-custom-taxonomy-option"> |
653 | - <label><?php _e( 'Custom Taxonomy', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Choose custom taxonomy.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
653 | + <label><?php _e('Custom Taxonomy', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Choose custom taxonomy.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
654 | 654 | <select id="lasso--custom-taxo-select" class="lasso--modal__trigger-footer" name="custom_taxo"> |
655 | 655 | <?php foreach ($custom_taxonomies as $taxonomy) {?> |
656 | 656 | <option value="<?php echo $taxonomy?>"><?php echo $taxonomy?></option> |
@@ -667,18 +667,18 @@ discard block |
||
667 | 667 | if ($allow_edit_excerpt) { |
668 | 668 | ?> |
669 | 669 | <div class="lasso--postsettings__option story-excerpt-option"> |
670 | - <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> |
|
671 | - <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%"> |
|
670 | + <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> |
|
671 | + <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%"> |
|
672 | 672 | </div> |
673 | 673 | <?php |
674 | 674 | }?> |
675 | 675 | <?php |
676 | 676 | if ($allow_change_date) { |
677 | - $dateformat = get_option( 'date_format' ); |
|
677 | + $dateformat = get_option('date_format'); |
|
678 | 678 | ?> |
679 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
680 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
681 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
679 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
680 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
681 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
682 | 682 | <?php |
683 | 683 | }?> |
684 | 684 | |
@@ -700,23 +700,23 @@ discard block |
||
700 | 700 | ?> |
701 | 701 | <!--/div--> |
702 | 702 | |
703 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
703 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
704 | 704 | |
705 | 705 | <div class="lasso--postsettings__footer" > |
706 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
706 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
707 | 707 | <input type="hidden" name="status" value=""> |
708 | 708 | <input type="hidden" name="categories" value=""> |
709 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
709 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
710 | 710 | <input type="hidden" name="action" value="process_update-object_post"> |
711 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
712 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
713 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
711 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
712 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
713 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
714 | 714 | </div> |
715 | 715 | |
716 | 716 | </form> |
717 | 717 | </div> |
718 | 718 | |
719 | - <?php if( $tabs ) { echo $content; } ?> |
|
719 | + <?php if ($tabs) { echo $content; } ?> |
|
720 | 720 | |
721 | 721 | </div> |
722 | 722 | |
@@ -738,43 +738,43 @@ discard block |
||
738 | 738 | ob_start(); |
739 | 739 | |
740 | 740 | |
741 | - $status = get_post_status( get_the_ID() ); |
|
741 | + $status = get_post_status(get_the_ID()); |
|
742 | 742 | |
743 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
743 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
744 | 744 | |
745 | 745 | // let users add custom css classes |
746 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
746 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
747 | 747 | |
748 | 748 | // return the post type |
749 | - $type = get_post_type( get_the_ID() ); |
|
749 | + $type = get_post_type(get_the_ID()); |
|
750 | 750 | |
751 | 751 | $mobile_style = ""; |
752 | 752 | if (wp_is_mobile()) { |
753 | 753 | //$mobile_style = 'style="top:140px !important;"'; |
754 | 754 | } |
755 | 755 | ?> |
756 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
756 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
757 | 757 | <div class="lasso--modal__inner lasso--hasnewform"> |
758 | 758 | |
759 | 759 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
760 | 760 | |
761 | 761 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
762 | - <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> |
|
763 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
762 | + <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> |
|
763 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
764 | 764 | <div class="lasso--select-wrap" style="width:90px"> |
765 | 765 | <select id="lasso--select-type" name="story_type"> |
766 | 766 | |
767 | 767 | <?php |
768 | 768 | $types = lasso_post_types_names(); |
769 | - if ( !empty( $types ) ) { |
|
770 | - foreach( $types as $name => $label ) |
|
769 | + if (!empty($types)) { |
|
770 | + foreach ($types as $name => $label) |
|
771 | 771 | { |
772 | 772 | $type = $name; |
773 | 773 | //$type = preg_replace( '/s\b/','', $name ); |
774 | 774 | if ($type == 'page' && !current_user_can('edit_pages')) { |
775 | 775 | continue; |
776 | 776 | } |
777 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
777 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | } |
@@ -785,19 +785,19 @@ discard block |
||
785 | 785 | </div> |
786 | 786 | |
787 | 787 | <div class="lasso--postsettings__footer"> |
788 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
788 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
789 | 789 | <input type="hidden" name="action" value="process_new-object_post"> |
790 | 790 | <?php |
791 | - if ( !empty( $types ) ) { |
|
791 | + if (!empty($types)) { |
|
792 | 792 | // get the first element |
793 | 793 | $keys = array_keys($types); |
794 | - $type =$keys[0]; |
|
794 | + $type = $keys[0]; |
|
795 | 795 | //$type = preg_replace( '/s\b/','', $type ); |
796 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
796 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
797 | 797 | } |
798 | 798 | ?> |
799 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
800 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
799 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
800 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
801 | 801 | </div> |
802 | 802 | |
803 | 803 | </form> |
@@ -825,18 +825,18 @@ discard block |
||
825 | 825 | ob_start(); |
826 | 826 | |
827 | 827 | // post status |
828 | - $status = get_post_status( get_the_ID() ); |
|
828 | + $status = get_post_status(get_the_ID()); |
|
829 | 829 | |
830 | 830 | // let users add custom css classes |
831 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
831 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
832 | 832 | |
833 | 833 | ?> |
834 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
834 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
835 | 835 | <div class="lasso--modal__inner"> |
836 | 836 | |
837 | 837 | <div class="lasso--post-filtering not-visible"> |
838 | 838 | <div class="lasso--search__results"> |
839 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
839 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
840 | 840 | </div> |
841 | 841 | <div class="lasso--search"> |
842 | 842 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -850,18 +850,18 @@ discard block |
||
850 | 850 | $post_types = lasso_post_types_names(); |
851 | 851 | $rest_bases = lasso_post_types_rest_base(); |
852 | 852 | |
853 | - if ( ! empty( $post_types ) ) { |
|
853 | + if (!empty($post_types)) { |
|
854 | 854 | $first = 'active'; |
855 | - foreach( $post_types as $name => $label ) { |
|
855 | + foreach ($post_types as $name => $label) { |
|
856 | 856 | if (array_key_exists($name, $rest_bases)) { |
857 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
857 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
858 | 858 | } |
859 | 859 | $first = ''; |
860 | 860 | } |
861 | 861 | |
862 | 862 | } |
863 | 863 | |
864 | - do_action('lasso_modal_post_objects');?> |
|
864 | + do_action('lasso_modal_post_objects'); ?> |
|
865 | 865 | |
866 | 866 | </ul> |
867 | 867 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -880,21 +880,21 @@ discard block |
||
880 | 880 | ob_start(); |
881 | 881 | |
882 | 882 | |
883 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
883 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
884 | 884 | |
885 | 885 | // let users add custom css classes |
886 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
886 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
887 | 887 | |
888 | 888 | ?> |
889 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
890 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
891 | - <?php if ($use_old_wpimg=='on') {?> |
|
892 | - <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
889 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
890 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
891 | + <?php if ($use_old_wpimg == 'on') {?> |
|
892 | + <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
893 | 893 | <?php } else {?> |
894 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
894 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
895 | 895 | <?php } ?> |
896 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
897 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
896 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
897 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
898 | 898 | </ul> |
899 | 899 | |
900 | 900 | <?php return ob_get_clean(); |
@@ -905,10 +905,10 @@ discard block |
||
905 | 905 | |
906 | 906 | ?> |
907 | 907 | <ul class="lasso-component--controls editus-center" contenteditable="false"> |
908 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
909 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
910 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
911 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
908 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
909 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
910 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
911 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
912 | 912 | </ul> |
913 | 913 | |
914 | 914 | <?php return ob_get_clean(); |
@@ -920,14 +920,14 @@ discard block |
||
920 | 920 | |
921 | 921 | |
922 | 922 | // let users add custom css classes |
923 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
923 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
924 | 924 | |
925 | 925 | ?> |
926 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
927 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
928 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
929 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
930 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
926 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
927 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
928 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
929 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
930 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
931 | 931 | </ul> |
932 | 932 | |
933 | 933 | <?php return ob_get_clean(); |
@@ -940,16 +940,16 @@ discard block |
||
940 | 940 | */ |
941 | 941 | function lasso_map_form_footer() { |
942 | 942 | |
943 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
943 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
944 | 944 | |
945 | 945 | ob_start(); |
946 | 946 | |
947 | 947 | ?> |
948 | 948 | <div class="lasso--map-form__footer"> |
949 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
950 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
949 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
950 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
951 | 951 | <input type="hidden" name="action" value="process_map_save"> |
952 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
952 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
953 | 953 | </div> |
954 | 954 | |
955 | 955 | <?php return ob_get_clean(); |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | |
968 | 968 | ?> |
969 | 969 | <div id="lasso--pagerefresh" class="visible"> |
970 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
970 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
971 | 971 | </div> |
972 | 972 | |
973 | 973 | <?php return ob_get_clean(); |
@@ -981,47 +981,47 @@ discard block |
||
981 | 981 | */ |
982 | 982 | function lasso_editor_options_blob() { |
983 | 983 | |
984 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
|
985 | - $codes = add_wpimg_options( $codes ); |
|
986 | - $codes = add_wpimg_block_options( $codes ); |
|
987 | - $codes = add_wpcover_block_options( $codes ); |
|
988 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
989 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
984 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array(); |
|
985 | + $codes = add_wpimg_options($codes); |
|
986 | + $codes = add_wpimg_block_options($codes); |
|
987 | + $codes = add_wpcover_block_options($codes); |
|
988 | + $codes = apply_filters('lasso_custom_options', $codes); |
|
989 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
990 | 990 | |
991 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
991 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
992 | 992 | |
993 | 993 | $blob = array(); |
994 | 994 | |
995 | - if ( empty( $codes ) ) |
|
995 | + if (empty($codes)) |
|
996 | 996 | return; |
997 | 997 | |
998 | - foreach ( $codes as $slug => $shortcode ) { |
|
998 | + foreach ($codes as $slug => $shortcode) { |
|
999 | 999 | $return = ''; |
1000 | 1000 | // Shortcode has atts |
1001 | 1001 | |
1002 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
1002 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
1003 | 1003 | |
1004 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
1004 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
1005 | 1005 | |
1006 | 1006 | |
1007 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
1007 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
1008 | 1008 | |
1009 | 1009 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
1010 | 1010 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
1011 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
1011 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
1012 | 1012 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
1013 | 1013 | // Select |
1014 | 1014 | |
1015 | - if ( isset( $attr_info['values'] ) ) { |
|
1015 | + if (isset($attr_info['values'])) { |
|
1016 | 1016 | |
1017 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
1017 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
1018 | 1018 | |
1019 | - $i=0; |
|
1019 | + $i = 0; |
|
1020 | 1020 | |
1021 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
1021 | + foreach ($attr_info['values'] as $attr_value) { |
|
1022 | 1022 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
1023 | 1023 | |
1024 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
1024 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
1025 | 1025 | |
1026 | 1026 | $i++; |
1027 | 1027 | } |
@@ -1030,24 +1030,24 @@ discard block |
||
1030 | 1030 | |
1031 | 1031 | } else { |
1032 | 1032 | |
1033 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
1033 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
1034 | 1034 | |
1035 | 1035 | // image upload |
1036 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
1036 | + if ('media_upload' == $attr_info['type']) { |
|
1037 | 1037 | |
1038 | - $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.'" />'; |
|
1038 | + $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.'" />'; |
|
1039 | 1039 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
1040 | 1040 | |
1041 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
1041 | + } elseif ('color' == $attr_info['type']) { |
|
1042 | 1042 | |
1043 | - $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.'" />'; |
|
1043 | + $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.'" />'; |
|
1044 | 1044 | |
1045 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
1045 | + } elseif ('text_area' == $attr_info['type']) { |
|
1046 | 1046 | |
1047 | - $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.''; |
|
1047 | + $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.''; |
|
1048 | 1048 | |
1049 | 1049 | } else { |
1050 | - $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.''; |
|
1050 | + $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.''; |
|
1051 | 1051 | } |
1052 | 1052 | } |
1053 | 1053 | $return .= '</p>'; |
@@ -1058,9 +1058,9 @@ discard block |
||
1058 | 1058 | /////////////////////////// |
1059 | 1059 | // START GALLERY AND MAP FRONT END STUFFS |
1060 | 1060 | /////////////////////////// |
1061 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
1061 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
1062 | 1062 | |
1063 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
1063 | + if ('gallery' == $shortcode['front_type']) { |
|
1064 | 1064 | |
1065 | 1065 | $return .= lasso_gallery_editor_module(); |
1066 | 1066 | |
@@ -1071,13 +1071,13 @@ discard block |
||
1071 | 1071 | /////////////////////////// |
1072 | 1072 | |
1073 | 1073 | // Single shortcode (not closed) |
1074 | - if ( 'single' == $shortcode['type'] ) { |
|
1074 | + if ('single' == $shortcode['type']) { |
|
1075 | 1075 | |
1076 | 1076 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
1077 | 1077 | |
1078 | 1078 | } else { |
1079 | 1079 | |
1080 | - $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>'; |
|
1080 | + $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>'; |
|
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | $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>'; |
@@ -1097,95 +1097,95 @@ discard block |
||
1097 | 1097 | } |
1098 | 1098 | |
1099 | 1099 | |
1100 | -function add_wpimg_options( $shortcodes ) { |
|
1100 | +function add_wpimg_options($shortcodes) { |
|
1101 | 1101 | $custom = array( |
1102 | 1102 | 'wpimg' => array( |
1103 | - 'name' => __( 'Image', 'lasso' ), |
|
1103 | + 'name' => __('Image', 'lasso'), |
|
1104 | 1104 | 'type' => 'single', |
1105 | 1105 | 'atts' => array( |
1106 | 1106 | 'img' => array( |
1107 | 1107 | 'type' => 'media_upload', |
1108 | 1108 | 'default' => '', |
1109 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1110 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1109 | + 'desc' => __('Image URL', 'lasso'), |
|
1110 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
1111 | 1111 | ), |
1112 | 1112 | 'align' => array( |
1113 | 1113 | 'type' => 'select', |
1114 | 1114 | 'values' => array( |
1115 | 1115 | array( |
1116 | 1116 | 'value' => 'center', |
1117 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1117 | + 'name' => __('Center', 'aesop-core') |
|
1118 | 1118 | ), |
1119 | 1119 | array( |
1120 | 1120 | 'value' => 'left', |
1121 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1121 | + 'name' => __('Left', 'aesop-core') |
|
1122 | 1122 | ), |
1123 | 1123 | array( |
1124 | 1124 | 'value' => 'right', |
1125 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1125 | + 'name' => __('Right', 'aesop-core') |
|
1126 | 1126 | ), |
1127 | 1127 | ), |
1128 | 1128 | 'default' => 'center', |
1129 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1129 | + 'desc' => __('Alignment', 'lasso'), |
|
1130 | 1130 | 'tip'=>'' |
1131 | 1131 | ), |
1132 | 1132 | |
1133 | 1133 | 'imgwidth' => array( |
1134 | 1134 | 'type' => 'text_small', |
1135 | 1135 | 'default' => '300px', |
1136 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
1137 | - 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
1136 | + 'desc' => __('Image Width', 'lasso'), |
|
1137 | + 'tip' => __('Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core') |
|
1138 | 1138 | ), |
1139 | 1139 | 'imgheight' => array( |
1140 | 1140 | 'type' => 'text_small', |
1141 | 1141 | 'default' => '', |
1142 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
1143 | - 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
1142 | + 'desc' => __('Image Height', 'lasso'), |
|
1143 | + 'tip' => __('Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core') |
|
1144 | 1144 | ), |
1145 | 1145 | 'linkoption' => array( |
1146 | 1146 | 'type' => 'select', |
1147 | 1147 | 'values' => array( |
1148 | 1148 | array( |
1149 | 1149 | 'value' => 'none', |
1150 | - 'name' => __( 'None', 'aesop-core' ) |
|
1150 | + 'name' => __('None', 'aesop-core') |
|
1151 | 1151 | ), |
1152 | 1152 | array( |
1153 | 1153 | 'value' => 'img', |
1154 | - 'name' => __( 'Image', 'aesop-core' ) |
|
1154 | + 'name' => __('Image', 'aesop-core') |
|
1155 | 1155 | ), |
1156 | 1156 | array( |
1157 | 1157 | 'value' => 'url', |
1158 | - 'name' => __( 'URL', 'aesop-core' ) |
|
1158 | + 'name' => __('URL', 'aesop-core') |
|
1159 | 1159 | ), |
1160 | 1160 | ), |
1161 | 1161 | 'default' => 'none', |
1162 | - 'desc' => __( 'Link', 'lasso' ), |
|
1163 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
1162 | + 'desc' => __('Link', 'lasso'), |
|
1163 | + 'tip' => __('Click leads to:', 'lasso') |
|
1164 | 1164 | ), |
1165 | 1165 | |
1166 | 1166 | 'link' => array( |
1167 | 1167 | 'type' => 'text', |
1168 | 1168 | 'default' => '', |
1169 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
1170 | - 'tip' => __( 'URL link', 'lasso' ) |
|
1169 | + 'desc' => __('URL Link', 'lasso'), |
|
1170 | + 'tip' => __('URL link', 'lasso') |
|
1171 | 1171 | ), |
1172 | 1172 | 'alt' => array( |
1173 | 1173 | 'type' => 'text', |
1174 | 1174 | 'default' => '', |
1175 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1176 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1175 | + 'desc' => __('Image ALT', 'lasso'), |
|
1176 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1177 | 1177 | ), |
1178 | 1178 | |
1179 | 1179 | 'caption' => array( |
1180 | 1180 | 'type' => 'text_area', |
1181 | 1181 | 'default' => '', |
1182 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1183 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1182 | + 'desc' => __('Caption', 'lasso'), |
|
1183 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
1184 | 1184 | ), |
1185 | 1185 | |
1186 | 1186 | |
1187 | 1187 | ), |
1188 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
1188 | + 'desc' => __('An image.', 'aesop-core'), |
|
1189 | 1189 | 'codes' => '<script> |
1190 | 1190 | jQuery(document).ready(function($){ |
1191 | 1191 | function linkSetting(l){ |
@@ -1209,63 +1209,63 @@ discard block |
||
1209 | 1209 | ) |
1210 | 1210 | ); |
1211 | 1211 | |
1212 | - return array_merge( $shortcodes, $custom ); |
|
1212 | + return array_merge($shortcodes, $custom); |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | -function add_wpimg_block_options( $shortcodes ) { |
|
1215 | +function add_wpimg_block_options($shortcodes) { |
|
1216 | 1216 | $custom = array( |
1217 | 1217 | 'wpimg-block' => array( |
1218 | - 'name' => __( 'Image', 'lasso' ), |
|
1218 | + 'name' => __('Image', 'lasso'), |
|
1219 | 1219 | 'type' => 'single', |
1220 | 1220 | 'atts' => array( |
1221 | 1221 | 'img' => array( |
1222 | 1222 | 'type' => 'media_upload', |
1223 | 1223 | 'default' => '', |
1224 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1225 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1224 | + 'desc' => __('Image URL', 'lasso'), |
|
1225 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
1226 | 1226 | ), |
1227 | 1227 | 'align' => array( |
1228 | 1228 | 'type' => 'select', |
1229 | 1229 | 'values' => array( |
1230 | 1230 | array( |
1231 | 1231 | 'value' => 'center', |
1232 | - 'name' => __( 'Center', 'aesop-core' ) |
|
1232 | + 'name' => __('Center', 'aesop-core') |
|
1233 | 1233 | ), |
1234 | 1234 | array( |
1235 | 1235 | 'value' => 'left', |
1236 | - 'name' => __( 'Left', 'aesop-core' ) |
|
1236 | + 'name' => __('Left', 'aesop-core') |
|
1237 | 1237 | ), |
1238 | 1238 | array( |
1239 | 1239 | 'value' => 'right', |
1240 | - 'name' => __( 'Right', 'aesop-core' ) |
|
1240 | + 'name' => __('Right', 'aesop-core') |
|
1241 | 1241 | ), |
1242 | 1242 | ), |
1243 | 1243 | 'default' => 'center', |
1244 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
1244 | + 'desc' => __('Alignment', 'lasso'), |
|
1245 | 1245 | 'tip'=>'' |
1246 | 1246 | ), |
1247 | 1247 | 'alt' => array( |
1248 | 1248 | 'type' => 'text', |
1249 | 1249 | 'default' => '', |
1250 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
1251 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
1250 | + 'desc' => __('Image ALT', 'lasso'), |
|
1251 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
1252 | 1252 | ), |
1253 | 1253 | 'caption' => array( |
1254 | 1254 | 'type' => 'text', |
1255 | 1255 | 'default' => '', |
1256 | - 'desc' => __( 'Caption', 'lasso' ), |
|
1257 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
1256 | + 'desc' => __('Caption', 'lasso'), |
|
1257 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
1258 | 1258 | ), |
1259 | 1259 | 'link' => array( |
1260 | 1260 | 'type' => 'text', |
1261 | 1261 | 'default' => '', |
1262 | - 'desc' => __( 'Link URL', 'lasso' ), |
|
1263 | - 'tip' => __( 'Optional URL to link.', 'lasso' ) |
|
1262 | + 'desc' => __('Link URL', 'lasso'), |
|
1263 | + 'tip' => __('Optional URL to link.', 'lasso') |
|
1264 | 1264 | ), |
1265 | 1265 | |
1266 | 1266 | |
1267 | 1267 | ), |
1268 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
1268 | + 'desc' => __('A WP Image Block.', 'aesop-core'), |
|
1269 | 1269 | 'codes' => '<script> |
1270 | 1270 | jQuery(document).ready(function($){ |
1271 | 1271 | |
@@ -1274,24 +1274,24 @@ discard block |
||
1274 | 1274 | ) |
1275 | 1275 | ); |
1276 | 1276 | |
1277 | - return array_merge( $shortcodes, $custom ); |
|
1277 | + return array_merge($shortcodes, $custom); |
|
1278 | 1278 | } |
1279 | 1279 | |
1280 | -function add_wpcover_block_options( $shortcodes ) { |
|
1280 | +function add_wpcover_block_options($shortcodes) { |
|
1281 | 1281 | $custom = array( |
1282 | 1282 | 'wpcover-block' => array( |
1283 | - 'name' => __( 'Cover', 'lasso' ), |
|
1283 | + 'name' => __('Cover', 'lasso'), |
|
1284 | 1284 | 'type' => 'single', |
1285 | 1285 | 'atts' => array( |
1286 | 1286 | 'img' => array( |
1287 | 1287 | 'type' => 'media_upload', |
1288 | 1288 | 'default' => '', |
1289 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
1290 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
1289 | + 'desc' => __('Image URL', 'lasso'), |
|
1290 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
1291 | 1291 | ) |
1292 | 1292 | |
1293 | 1293 | ), |
1294 | - 'desc' => __( 'A WP Cover Block.', 'aesop-core' ), |
|
1294 | + 'desc' => __('A WP Cover Block.', 'aesop-core'), |
|
1295 | 1295 | 'codes' => '<script> |
1296 | 1296 | jQuery(document).ready(function($){ |
1297 | 1297 | |
@@ -1300,7 +1300,7 @@ discard block |
||
1300 | 1300 | ) |
1301 | 1301 | ); |
1302 | 1302 | |
1303 | - return array_merge( $shortcodes, $custom ); |
|
1303 | + return array_merge($shortcodes, $custom); |
|
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | /** |
@@ -1320,14 +1320,14 @@ discard block |
||
1320 | 1320 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
1321 | 1321 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
1322 | 1322 | <i class="lasso-icon lasso-icon-move"></i> |
1323 | - <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> |
|
1323 | + <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> |
|
1324 | 1324 | <div class="lasso--slider_wrap"> |
1325 | 1325 | <div id="lasso--slider"></div> |
1326 | 1326 | </div> |
1327 | 1327 | <ul id="lasso--revision-list"></ul> |
1328 | 1328 | <div class="lasso--btn-group lasso--btn-group-small"> |
1329 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
1330 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
1329 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
1330 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
1331 | 1331 | </div> |
1332 | 1332 | </div> |
1333 | 1333 | |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | // Normalize into a six character long hex string |
1351 | 1351 | $hex = str_replace('#', '', $hex); |
1352 | 1352 | if (strlen($hex) == 3) { |
1353 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
1353 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | // Split into three parts: R, G and B |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | |
1360 | 1360 | foreach ($color_parts as $color) { |
1361 | 1361 | $color = hexdec($color); // Convert to decimal |
1362 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
1362 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
1363 | 1363 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
1364 | 1364 | } |
1365 | 1365 |
@@ -236,16 +236,16 @@ discard block |
||
236 | 236 | if ( !function_exists('lasso_wp_image') ): |
237 | 237 | |
238 | 238 | function lasso_wp_image(){ |
239 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
241 | - if ($use_wp_block_image == 'on') { |
|
242 | - return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
243 | - } |
|
244 | - else if ($use_old_wpimg != 'on') { |
|
245 | - return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
246 | - } else { |
|
247 | - return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
248 | - } |
|
239 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
241 | + if ($use_wp_block_image == 'on') { |
|
242 | + return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
243 | + } |
|
244 | + else if ($use_old_wpimg != 'on') { |
|
245 | + return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
246 | + } else { |
|
247 | + return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
248 | + } |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | endif; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | |
288 | 288 | if ( !function_exists('lasso_wp_image_block') ): |
289 | 289 | function lasso_wp_image_block(){ |
290 | - return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
290 | + return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | endif; |
@@ -240,8 +240,7 @@ |
||
240 | 240 | $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
241 | 241 | if ($use_wp_block_image == 'on') { |
242 | 242 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
243 | - } |
|
244 | - else if ($use_old_wpimg != 'on') { |
|
243 | + } else if ($use_old_wpimg != 'on') { |
|
245 | 244 | return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
246 | 245 | } else { |
247 | 246 | return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
@@ -16,84 +16,84 @@ discard block |
||
16 | 16 | |
17 | 17 | $array = array( |
18 | 18 | 'quote' => array( |
19 | - 'name' => __('Quote','lasso'), |
|
19 | + 'name' => __('Quote', 'lasso'), |
|
20 | 20 | 'content' => lasso_quote_component(), |
21 | 21 | ), |
22 | 22 | 'image' => array( |
23 | - 'name' => __('Image','lasso'), |
|
23 | + 'name' => __('Image', 'lasso'), |
|
24 | 24 | 'content' => lasso_image_component(), |
25 | 25 | ), |
26 | 26 | 'parallax' => array( |
27 | - 'name' => __('Parallax','lasso'), |
|
27 | + 'name' => __('Parallax', 'lasso'), |
|
28 | 28 | 'content' => lasso_parallax_component(), |
29 | 29 | ), |
30 | 30 | 'audio' => array( |
31 | - 'name' => __('Audio','lasso'), |
|
31 | + 'name' => __('Audio', 'lasso'), |
|
32 | 32 | 'content' => lasso_audio_component(), |
33 | 33 | ), |
34 | 34 | 'content' => array( |
35 | - 'name' => __('Content','lasso'), |
|
35 | + 'name' => __('Content', 'lasso'), |
|
36 | 36 | 'content' => lasso_content_component(), |
37 | 37 | ), |
38 | 38 | 'character' => array( |
39 | - 'name' => __('Character','lasso'), |
|
39 | + 'name' => __('Character', 'lasso'), |
|
40 | 40 | 'content' => lasso_character_component(), |
41 | 41 | ), |
42 | 42 | 'collection' => array( |
43 | - 'name' => __('Collection','lasso'), |
|
43 | + 'name' => __('Collection', 'lasso'), |
|
44 | 44 | 'content' => lasso_collections_component(), |
45 | 45 | ), |
46 | 46 | 'document' => array( |
47 | - 'name' => __('Document','lasso'), |
|
47 | + 'name' => __('Document', 'lasso'), |
|
48 | 48 | 'content' => lasso_document_component(), |
49 | 49 | ), |
50 | 50 | 'gallery' => array( |
51 | - 'name' => __('Gallery','lasso'), |
|
51 | + 'name' => __('Gallery', 'lasso'), |
|
52 | 52 | 'content' => lasso_gallery_component(), |
53 | 53 | ), |
54 | 54 | 'chapter' => array( |
55 | - 'name' => __('Chapter','lasso'), |
|
55 | + 'name' => __('Chapter', 'lasso'), |
|
56 | 56 | 'content' => lasso_heading_component(), |
57 | 57 | ), |
58 | 58 | 'map' => array( |
59 | - 'name' => __('Map','lasso'), |
|
59 | + 'name' => __('Map', 'lasso'), |
|
60 | 60 | 'content' => lasso_map_component(), |
61 | 61 | ), |
62 | 62 | 'timeline_stop' => array( |
63 | - 'name' => __('Timeline','lasso'), |
|
63 | + 'name' => __('Timeline', 'lasso'), |
|
64 | 64 | 'content' => lasso_timeline_component(), |
65 | 65 | ), |
66 | 66 | 'video' => array( |
67 | - 'name' => __('Video','lasso'), |
|
67 | + 'name' => __('Video', 'lasso'), |
|
68 | 68 | 'content' => lasso_video_component(), |
69 | 69 | ), |
70 | 70 | 'wpimg' => array( |
71 | - 'name' => __('WordPress Image','lasso'), |
|
71 | + 'name' => __('WordPress Image', 'lasso'), |
|
72 | 72 | 'content' => lasso_wp_image(), |
73 | 73 | ), |
74 | 74 | 'wpimg-block' => array( |
75 | - 'name' => __('WordPress Image Block','lasso'), |
|
75 | + 'name' => __('WordPress Image Block', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_image_block(), |
77 | 77 | ), |
78 | 78 | 'wpquote' => array( |
79 | - 'name' => __('WordPress Quote','lasso'), |
|
79 | + 'name' => __('WordPress Quote', 'lasso'), |
|
80 | 80 | 'content' => lasso_wp_quote(), |
81 | 81 | ), |
82 | 82 | 'gallery_pop' => array( |
83 | - 'name' => __('Gallery Pop','lasso'), |
|
83 | + 'name' => __('Gallery Pop', 'lasso'), |
|
84 | 84 | 'content' => lasso_gallery_pop_component(), |
85 | 85 | ), |
86 | 86 | 'events' => array( |
87 | - 'name' => __('Events','lasso'), |
|
87 | + 'name' => __('Events', 'lasso'), |
|
88 | 88 | 'content' => lasso_event_component(), |
89 | 89 | ), |
90 | 90 | 'wpvideo' => array( |
91 | - 'name' => __('WordPress Image','lasso'), |
|
91 | + 'name' => __('WordPress Image', 'lasso'), |
|
92 | 92 | 'content' => lasso_wp_video(), |
93 | 93 | ), |
94 | 94 | ); |
95 | 95 | |
96 | - return apply_filters( 'lasso_components', $array ); |
|
96 | + return apply_filters('lasso_components', $array); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -119,125 +119,125 @@ discard block |
||
119 | 119 | */ |
120 | 120 | |
121 | 121 | // 1 |
122 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
122 | +if (!function_exists('lasso_quote_component')): |
|
123 | 123 | function lasso_quote_component() { |
124 | 124 | |
125 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
125 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
126 | 126 | } |
127 | 127 | endif; |
128 | 128 | |
129 | 129 | // 2 |
130 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
130 | +if (!function_exists('lasso_image_component')): |
|
131 | 131 | function lasso_image_component() { |
132 | 132 | |
133 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]' ); |
|
133 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]'); |
|
134 | 134 | } |
135 | 135 | endif; |
136 | 136 | |
137 | 137 | // 3 |
138 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
138 | +if (!function_exists('lasso_parallax_component')): |
|
139 | 139 | function lasso_parallax_component() { |
140 | 140 | |
141 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
141 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
142 | 142 | } |
143 | 143 | endif; |
144 | 144 | |
145 | 145 | // 4 |
146 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
146 | +if (!function_exists('lasso_audio_component')): |
|
147 | 147 | function lasso_audio_component() { |
148 | 148 | |
149 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
149 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
150 | 150 | |
151 | 151 | } |
152 | 152 | endif; |
153 | 153 | |
154 | 154 | // 5 |
155 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
155 | +if (!function_exists('lasso_content_component')): |
|
156 | 156 | function lasso_content_component() { |
157 | 157 | |
158 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
158 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
159 | 159 | } |
160 | 160 | endif; |
161 | 161 | |
162 | 162 | // 6 |
163 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
163 | +if (!function_exists('lasso_character_component')): |
|
164 | 164 | function lasso_character_component() { |
165 | 165 | |
166 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
166 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | endif; |
170 | 170 | |
171 | 171 | // 7 |
172 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
172 | +if (!function_exists('lasso_collections_component')): |
|
173 | 173 | function lasso_collections_component() { |
174 | 174 | |
175 | - return do_shortcode( '[aesop_collection]' ); |
|
175 | + return do_shortcode('[aesop_collection]'); |
|
176 | 176 | } |
177 | 177 | endif; |
178 | 178 | |
179 | 179 | // 8 |
180 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
180 | +if (!function_exists('lasso_document_component')): |
|
181 | 181 | function lasso_document_component() { |
182 | 182 | |
183 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
183 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | endif; |
187 | 187 | |
188 | 188 | // 9 |
189 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
189 | +if (!function_exists('lasso_gallery_component')): |
|
190 | 190 | function lasso_gallery_component() { |
191 | 191 | |
192 | - return do_shortcode( '[aesop_gallery]' ); |
|
192 | + return do_shortcode('[aesop_gallery]'); |
|
193 | 193 | |
194 | 194 | } |
195 | 195 | endif; |
196 | 196 | |
197 | 197 | // 10 |
198 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
198 | +if (!function_exists('lasso_heading_component')): |
|
199 | 199 | function lasso_heading_component() { |
200 | 200 | |
201 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
201 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
202 | 202 | } |
203 | 203 | endif; |
204 | 204 | |
205 | 205 | // 11 |
206 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
206 | +if (!function_exists('lasso_map_component')): |
|
207 | 207 | function lasso_map_component() { |
208 | 208 | |
209 | 209 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
210 | 210 | '.lasso_map_form_footer().' |
211 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
211 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
212 | 212 | </form>'; |
213 | 213 | |
214 | 214 | } |
215 | 215 | endif; |
216 | 216 | |
217 | 217 | // 12 |
218 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
218 | +if (!function_exists('lasso_timeline_component')): |
|
219 | 219 | function lasso_timeline_component() { |
220 | 220 | |
221 | - return do_shortcode( '[aesop_timeline_stop num="2014" title="Title"]' ); |
|
221 | + return do_shortcode('[aesop_timeline_stop num="2014" title="Title"]'); |
|
222 | 222 | |
223 | 223 | } |
224 | 224 | endif; |
225 | 225 | |
226 | 226 | // 13 |
227 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
227 | +if (!function_exists('lasso_video_component')): |
|
228 | 228 | function lasso_video_component() { |
229 | 229 | |
230 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
230 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
231 | 231 | |
232 | 232 | } |
233 | 233 | endif; |
234 | 234 | |
235 | 235 | // 14 - since 0.9.1 |
236 | -if ( !function_exists('lasso_wp_image') ): |
|
236 | +if (!function_exists('lasso_wp_image')): |
|
237 | 237 | |
238 | - function lasso_wp_image(){ |
|
239 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
238 | + function lasso_wp_image() { |
|
239 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
240 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
241 | 241 | if ($use_wp_block_image == 'on') { |
242 | 242 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
243 | 243 | } |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | endif; |
252 | 252 | |
253 | 253 | // 15 - since 0.9.2 |
254 | -if ( !function_exists('lasso_wp_quote') ): |
|
254 | +if (!function_exists('lasso_wp_quote')): |
|
255 | 255 | |
256 | - function lasso_wp_quote(){ |
|
256 | + function lasso_wp_quote() { |
|
257 | 257 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote><p><br></p>'; |
258 | 258 | } |
259 | 259 | |
@@ -261,15 +261,15 @@ discard block |
||
261 | 261 | |
262 | 262 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
263 | 263 | |
264 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
264 | +if (!function_exists('lasso_gallery_pop_component')): |
|
265 | 265 | function lasso_gallery_pop_component() { |
266 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
266 | + return do_shortcode('[aesop_gallery_pop]'); |
|
267 | 267 | } |
268 | 268 | endif; |
269 | 269 | |
270 | 270 | // 17 - work in progress |
271 | 271 | |
272 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
272 | +if (!function_exists('lasso_event_component')): |
|
273 | 273 | function lasso_event_component() { |
274 | 274 | $id = editus_get_one_id('aesop_events'); |
275 | 275 | return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>'; |
@@ -277,16 +277,16 @@ discard block |
||
277 | 277 | endif; |
278 | 278 | |
279 | 279 | // 18 - work in progress |
280 | -if ( !function_exists('lasso_wp_video') ): |
|
280 | +if (!function_exists('lasso_wp_video')): |
|
281 | 281 | |
282 | - function lasso_wp_video(){ |
|
282 | + function lasso_wp_video() { |
|
283 | 283 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
284 | 284 | } |
285 | 285 | |
286 | 286 | endif; |
287 | 287 | |
288 | -if ( !function_exists('lasso_wp_image_block') ): |
|
289 | - function lasso_wp_image_block(){ |
|
288 | +if (!function_exists('lasso_wp_image_block')): |
|
289 | + function lasso_wp_image_block() { |
|
290 | 290 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
291 | 291 | } |
292 | 292 | |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | // helper function to retrieve one id for default option |
296 | 296 | function editus_get_one_id($type) |
297 | 297 | { |
298 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
299 | - $posts = get_posts( $args ); |
|
300 | - if ( $posts ) { |
|
301 | - foreach ( $posts as $post ) { |
|
298 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
299 | + $posts = get_posts($args); |
|
300 | + if ($posts) { |
|
301 | + foreach ($posts as $post) { |
|
302 | 302 | return $post->ID; |
303 | 303 | } |
304 | 304 | } |
@@ -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 |
@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | if ( empty( $postid ) ) |
200 | 200 | $postid = get_the_ID(); |
201 | 201 | |
202 | - if ('category' == $taxonomy) { |
|
203 | - $objects = get_the_category( $postid ); |
|
204 | - } else if ('tag' == $taxonomy) { |
|
205 | - $objects = get_the_tags( $postid ); |
|
206 | - } else { |
|
207 | - $objects = get_the_terms( $postid, $taxonomy ); |
|
208 | - } |
|
202 | + if ('category' == $taxonomy) { |
|
203 | + $objects = get_the_category( $postid ); |
|
204 | + } else if ('tag' == $taxonomy) { |
|
205 | + $objects = get_the_tags( $postid ); |
|
206 | + } else { |
|
207 | + $objects = get_the_terms( $postid, $taxonomy ); |
|
208 | + } |
|
209 | 209 | |
210 | 210 | if ( empty( $objects) ) |
211 | 211 | return; |
@@ -227,16 +227,16 @@ discard block |
||
227 | 227 | */ |
228 | 228 | function lasso_get_objects( $taxonomy = 'category' ) { |
229 | 229 | |
230 | - if ('category' == $taxonomy) { |
|
231 | - $objects = get_categories(array('hide_empty' => 0)); |
|
232 | - } else if ('tag' == $taxonomy) { |
|
233 | - $objects = get_tags(array('hide_empty' => 0)); |
|
234 | - } else { |
|
235 | - $objects = get_terms( array( |
|
236 | - 'taxonomy' => $taxonomy, |
|
237 | - 'hide_empty' => false, |
|
238 | - )); |
|
239 | - } |
|
230 | + if ('category' == $taxonomy) { |
|
231 | + $objects = get_categories(array('hide_empty' => 0)); |
|
232 | + } else if ('tag' == $taxonomy) { |
|
233 | + $objects = get_tags(array('hide_empty' => 0)); |
|
234 | + } else { |
|
235 | + $objects = get_terms( array( |
|
236 | + 'taxonomy' => $taxonomy, |
|
237 | + 'hide_empty' => false, |
|
238 | + )); |
|
239 | + } |
|
240 | 240 | |
241 | 241 | if ( empty( $objects) ) |
242 | 242 | return; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'public' => true, |
262 | 262 | ), 'objects' ); |
263 | 263 | $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
264 | - unset( $post_types[ 'attachment' ] ); |
|
264 | + unset( $post_types[ 'attachment' ] ); |
|
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Set which post types are allowed |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $post_types = get_post_types( array( |
289 | 289 | 'public' => true, |
290 | 290 | ), 'names' ); |
291 | - unset( $post_types[ 'attachment' ] ); |
|
291 | + unset( $post_types[ 'attachment' ] ); |
|
292 | 292 | |
293 | 293 | /** |
294 | 294 | * Set which post types are allowed |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | if ( !function_exists( 'lasso_user_can' ) ): |
402 | 402 | function lasso_user_can( $action = '', $postid = 0 ) { |
403 | - $result = false; |
|
403 | + $result = false; |
|
404 | 404 | if ( empty( $action ) ) |
405 | 405 | $action = 'edit_posts'; |
406 | 406 | |
@@ -415,17 +415,17 @@ discard block |
||
415 | 415 | $allowed_post_types = array_diff($allowed_post_types,array('page')); |
416 | 416 | } |
417 | 417 | |
418 | - if (!empty($allowed_post_types) && !empty($postid)) { |
|
418 | + if (!empty($allowed_post_types) && !empty($postid)) { |
|
419 | 419 | $type = get_post_type( $postid ); |
420 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
420 | + $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
421 | 421 | |
422 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
422 | + if ( in_array( $type, $allowed_post_types ) ) { |
|
423 | 423 | $result = true; |
424 | - } |
|
425 | - } else { |
|
426 | - //we are not checking against a post, return true |
|
424 | + } |
|
425 | + } else { |
|
426 | + //we are not checking against a post, return true |
|
427 | 427 | $result = true; |
428 | - } |
|
428 | + } |
|
429 | 429 | } else { |
430 | 430 | $result = false; |
431 | 431 | } |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
19 | - return; |
|
18 | + if ( empty( $option ) ) { |
|
19 | + return; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
22 | 23 | |
@@ -46,11 +47,12 @@ discard block |
||
46 | 47 | |
47 | 48 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
48 | 49 | |
49 | - if ( $q->have_posts() ) |
|
50 | - return true; |
|
51 | - else |
|
52 | - return false; |
|
53 | -} |
|
50 | + if ( $q->have_posts() ) { |
|
51 | + return true; |
|
52 | + } else { |
|
53 | + return false; |
|
54 | + } |
|
55 | + } |
|
54 | 56 | |
55 | 57 | /** |
56 | 58 | * Return a CSS class of an automatically supported theme |
@@ -196,8 +198,9 @@ discard block |
||
196 | 198 | */ |
197 | 199 | function lasso_get_post_objects( $postid, $taxonomy) { |
198 | 200 | |
199 | - if ( empty( $postid ) ) |
|
200 | - $postid = get_the_ID(); |
|
201 | + if ( empty( $postid ) ) { |
|
202 | + $postid = get_the_ID(); |
|
203 | + } |
|
201 | 204 | |
202 | 205 | if ('category' == $taxonomy) { |
203 | 206 | $objects = get_the_category( $postid ); |
@@ -207,8 +210,9 @@ discard block |
||
207 | 210 | $objects = get_the_terms( $postid, $taxonomy ); |
208 | 211 | } |
209 | 212 | |
210 | - if ( empty( $objects) ) |
|
211 | - return; |
|
213 | + if ( empty( $objects) ) { |
|
214 | + return; |
|
215 | + } |
|
212 | 216 | |
213 | 217 | $out = ''; |
214 | 218 | foreach( $objects as $object ) { |
@@ -238,8 +242,9 @@ discard block |
||
238 | 242 | )); |
239 | 243 | } |
240 | 244 | |
241 | - if ( empty( $objects) ) |
|
242 | - return; |
|
245 | + if ( empty( $objects) ) { |
|
246 | + return; |
|
247 | + } |
|
243 | 248 | |
244 | 249 | $out = ""; |
245 | 250 | foreach( $objects as $object ) { |
@@ -361,8 +366,9 @@ discard block |
||
361 | 366 | */ |
362 | 367 | function lasso_clean_string( $string = '' ) { |
363 | 368 | |
364 | - if ( empty( $string ) ) |
|
365 | - return; |
|
369 | + if ( empty( $string ) ) { |
|
370 | + return; |
|
371 | + } |
|
366 | 372 | |
367 | 373 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
368 | 374 | } |
@@ -401,11 +407,13 @@ discard block |
||
401 | 407 | if ( !function_exists( 'lasso_user_can' ) ): |
402 | 408 | function lasso_user_can( $action = '', $postid = 0 ) { |
403 | 409 | $result = false; |
404 | - if ( empty( $action ) ) |
|
405 | - $action = 'edit_posts'; |
|
410 | + if ( empty( $action ) ) { |
|
411 | + $action = 'edit_posts'; |
|
412 | + } |
|
406 | 413 | |
407 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
408 | - $postid = get_the_ID(); |
|
414 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
415 | + $postid = get_the_ID(); |
|
416 | + } |
|
409 | 417 | |
410 | 418 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
411 | 419 | // check against post types: |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - $options = apply_filters( 'editus_filter_options', $options ); |
|
30 | + $options = apply_filters('editus_filter_options', $options); |
|
31 | 31 | |
32 | - if ( isset( $options[$option] ) ) { |
|
32 | + if (isset($options[$option])) { |
|
33 | 33 | return $options[$option]; |
34 | 34 | } |
35 | 35 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function lasso_editor_galleries_exist() { |
46 | 46 | |
47 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
47 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
48 | 48 | |
49 | - if ( $q->have_posts() ) |
|
49 | + if ($q->have_posts()) |
|
50 | 50 | return true; |
51 | 51 | else |
52 | 52 | return false; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | function lasso_get_supported_theme_class() { |
62 | 62 | |
63 | 63 | $name = wp_get_theme()->get('Name'); |
64 | - $slug = lasso_clean_string( $name ); |
|
64 | + $slug = lasso_clean_string($name); |
|
65 | 65 | |
66 | - switch ( $slug ) { |
|
66 | + switch ($slug) { |
|
67 | 67 | case 'aesop-story-theme': // aesop |
68 | 68 | $out = '.aesop-entry-content'; |
69 | 69 | break; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | } |
114 | 114 | |
115 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
115 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
116 | 116 | //return !empty( $out ) ? $out : false; |
117 | 117 | } |
118 | 118 | |
119 | 119 | function lasso_get_supported_theme_title_class() { |
120 | 120 | |
121 | 121 | $name = wp_get_theme()->get('Name'); |
122 | - $slug = lasso_clean_string( $name ); |
|
122 | + $slug = lasso_clean_string($name); |
|
123 | 123 | |
124 | - switch ( $slug ) { |
|
124 | + switch ($slug) { |
|
125 | 125 | |
126 | 126 | case 'aesop-story-theme': // aesop |
127 | 127 | $out = '.aesop-entry-title'; |
@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | |
152 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
152 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | //since 0.9.9.6 |
156 | 156 | function lasso_get_supported_theme_featured_image_class() { |
157 | 157 | |
158 | 158 | $name = wp_get_theme()->get('Name'); |
159 | - $slug = lasso_clean_string( $name ); |
|
159 | + $slug = lasso_clean_string($name); |
|
160 | 160 | |
161 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
161 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @since 0.8.7 |
170 | 170 | * @return string of comma separated classes |
171 | 171 | */ |
172 | -function lasso_supported_no_save(){ |
|
172 | +function lasso_supported_no_save() { |
|
173 | 173 | |
174 | 174 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel,.code-block'); |
175 | 175 | } |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return array|mixed|object|string|void |
185 | 185 | */ |
186 | -function lasso_sanitize_data( $data ) { |
|
187 | - return \lasso\sanatize::do_sanitize( $data ); |
|
186 | +function lasso_sanitize_data($data) { |
|
187 | + return \lasso\sanatize::do_sanitize($data); |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
@@ -194,24 +194,24 @@ discard block |
||
194 | 194 | * @since 0.9.3 |
195 | 195 | * @return string of comma delimited category slugs |
196 | 196 | */ |
197 | -function lasso_get_post_objects( $postid, $taxonomy) { |
|
197 | +function lasso_get_post_objects($postid, $taxonomy) { |
|
198 | 198 | |
199 | - if ( empty( $postid ) ) |
|
199 | + if (empty($postid)) |
|
200 | 200 | $postid = get_the_ID(); |
201 | 201 | |
202 | - if ('category' == $taxonomy) { |
|
203 | - $objects = get_the_category( $postid ); |
|
204 | - } else if ('tag' == $taxonomy) { |
|
205 | - $objects = get_the_tags( $postid ); |
|
202 | + if ('category' == $taxonomy) { |
|
203 | + $objects = get_the_category($postid); |
|
204 | + } else if ('tag' == $taxonomy) { |
|
205 | + $objects = get_the_tags($postid); |
|
206 | 206 | } else { |
207 | - $objects = get_the_terms( $postid, $taxonomy ); |
|
207 | + $objects = get_the_terms($postid, $taxonomy); |
|
208 | 208 | } |
209 | 209 | |
210 | - if ( empty( $objects) ) |
|
210 | + if (empty($objects)) |
|
211 | 211 | return; |
212 | 212 | |
213 | 213 | $out = ''; |
214 | - foreach( $objects as $object ) { |
|
214 | + foreach ($objects as $object) { |
|
215 | 215 | $out .= $object->name.','; |
216 | 216 | } |
217 | 217 | |
@@ -225,24 +225,24 @@ discard block |
||
225 | 225 | * @since 0.9.3 |
226 | 226 | * @return array all categoiries |
227 | 227 | */ |
228 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
228 | +function lasso_get_objects($taxonomy = 'category') { |
|
229 | 229 | |
230 | - if ('category' == $taxonomy) { |
|
230 | + if ('category' == $taxonomy) { |
|
231 | 231 | $objects = get_categories(array('hide_empty' => 0)); |
232 | - } else if ('tag' == $taxonomy) { |
|
232 | + } else if ('tag' == $taxonomy) { |
|
233 | 233 | $objects = get_tags(array('hide_empty' => 0)); |
234 | 234 | } else { |
235 | - $objects = get_terms( array( |
|
235 | + $objects = get_terms(array( |
|
236 | 236 | 'taxonomy' => $taxonomy, |
237 | 237 | 'hide_empty' => false, |
238 | 238 | )); |
239 | 239 | } |
240 | 240 | |
241 | - if ( empty( $objects) ) |
|
241 | + if (empty($objects)) |
|
242 | 242 | return; |
243 | 243 | |
244 | 244 | $out = ""; |
245 | - foreach( $objects as $object ) { |
|
245 | + foreach ($objects as $object) { |
|
246 | 246 | $out .= $object->name.','; |
247 | 247 | } |
248 | 248 | |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | * @since 0.9.4 |
258 | 258 | */ |
259 | 259 | function lasso_post_types_names() { |
260 | - $post_types = get_post_types( array( |
|
260 | + $post_types = get_post_types(array( |
|
261 | 261 | 'public' => true, |
262 | - ), 'objects' ); |
|
263 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
264 | - unset( $post_types[ 'attachment' ] ); |
|
262 | + ), 'objects'); |
|
263 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
264 | + unset($post_types['attachment']); |
|
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Set which post types are allowed |
@@ -270,14 +270,14 @@ discard block |
||
270 | 270 | * |
271 | 271 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
272 | 272 | */ |
273 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
274 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
273 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
274 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
275 | 275 | if (!current_user_can('edit_pages')) { |
276 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
276 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
277 | 277 | } |
278 | - foreach( $post_types as $name => $label ) { |
|
279 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
280 | - unset( $post_types[ $name ] ); |
|
278 | + foreach ($post_types as $name => $label) { |
|
279 | + if (!in_array($name, $allowed_post_types)) { |
|
280 | + unset($post_types[$name]); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $post_types; |
@@ -285,10 +285,10 @@ discard block |
||
285 | 285 | |
286 | 286 | |
287 | 287 | function lasso_post_types() { |
288 | - $post_types = get_post_types( array( |
|
288 | + $post_types = get_post_types(array( |
|
289 | 289 | 'public' => true, |
290 | - ), 'names' ); |
|
291 | - unset( $post_types[ 'attachment' ] ); |
|
290 | + ), 'names'); |
|
291 | + unset($post_types['attachment']); |
|
292 | 292 | |
293 | 293 | /** |
294 | 294 | * Set which post types are allowed |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | * |
298 | 298 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
299 | 299 | */ |
300 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
301 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
302 | - foreach( $post_types as $name => $label ) { |
|
303 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
304 | - unset( $post_types[ $name ] ); |
|
300 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
301 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
302 | + foreach ($post_types as $name => $label) { |
|
303 | + if (!in_array($name, $allowed_post_types)) { |
|
304 | + unset($post_types[$name]); |
|
305 | 305 | } |
306 | 306 | } |
307 | 307 | return $post_types; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | global $wp_post_types; |
312 | 312 | $post_types = lasso_post_types(); |
313 | 313 | $rest_base = array(); |
314 | - foreach ( $post_types as $post_type) { |
|
314 | + foreach ($post_types as $post_type) { |
|
315 | 315 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
316 | 316 | } |
317 | 317 | |
@@ -329,22 +329,22 @@ discard block |
||
329 | 329 | * @uses lasso_modal_addons() |
330 | 330 | * @since 0.9.4 |
331 | 331 | */ |
332 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
332 | +function lasso_modal_addons_content($tab = '', $type) { |
|
333 | 333 | |
334 | - $name = lasso_clean_string( $tab['name'] ); |
|
334 | + $name = lasso_clean_string($tab['name']); |
|
335 | 335 | |
336 | - if ( 'tab' == $type ) { |
|
336 | + if ('tab' == $type) { |
|
337 | 337 | |
338 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
338 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
339 | 339 | |
340 | - } else if ( 'content' == $type ){ |
|
340 | + } else if ('content' == $type) { |
|
341 | 341 | |
342 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
343 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
342 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
343 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
344 | 344 | |
345 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
345 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
346 | 346 | %s%s |
347 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
347 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
348 | 348 | |
349 | 349 | } |
350 | 350 | |
@@ -359,12 +359,12 @@ discard block |
||
359 | 359 | * |
360 | 360 | * @return void|string |
361 | 361 | */ |
362 | -function lasso_clean_string( $string = '' ) { |
|
362 | +function lasso_clean_string($string = '') { |
|
363 | 363 | |
364 | - if ( empty( $string ) ) |
|
364 | + if (empty($string)) |
|
365 | 365 | return; |
366 | 366 | |
367 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
367 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -377,13 +377,13 @@ discard block |
||
377 | 377 | * |
378 | 378 | * @return void|string |
379 | 379 | */ |
380 | -function lasso_unclean_string( $string = '' ) { |
|
380 | +function lasso_unclean_string($string = '') { |
|
381 | 381 | |
382 | - if ( empty( $string ) ) { |
|
382 | + if (empty($string)) { |
|
383 | 383 | return; |
384 | 384 | } |
385 | 385 | |
386 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
386 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | |
@@ -398,40 +398,40 @@ discard block |
||
398 | 398 | * @param unknown $postid int the id of the post object to check against |
399 | 399 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
400 | 400 | */ |
401 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
402 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
401 | +if (!function_exists('lasso_user_can')): |
|
402 | + function lasso_user_can($action = '', $postid = 0) { |
|
403 | 403 | $result = false; |
404 | - if ( empty( $action ) ) |
|
404 | + if (empty($action)) |
|
405 | 405 | $action = 'edit_posts'; |
406 | 406 | |
407 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
407 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
408 | 408 | $postid = get_the_ID(); |
409 | 409 | |
410 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
410 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
411 | 411 | // check against post types: |
412 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
412 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
413 | 413 | |
414 | 414 | if (!current_user_can('edit_pages')) { |
415 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
415 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if (!empty($allowed_post_types) && !empty($postid)) { |
419 | - $type = get_post_type( $postid ); |
|
420 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
419 | + $type = get_post_type($postid); |
|
420 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
421 | 421 | |
422 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
423 | - $result = true; |
|
422 | + if (in_array($type, $allowed_post_types)) { |
|
423 | + $result = true; |
|
424 | 424 | } |
425 | 425 | } else { |
426 | 426 | //we are not checking against a post, return true |
427 | - $result = true; |
|
427 | + $result = true; |
|
428 | 428 | } |
429 | 429 | } else { |
430 | 430 | $result = false; |
431 | 431 | } |
432 | 432 | //if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false; |
433 | 433 | |
434 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
434 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
435 | 435 | } |
436 | 436 | endif; |
437 | 437 | |
@@ -440,25 +440,25 @@ discard block |
||
440 | 440 | * |
441 | 441 | * @since 0.9.5 |
442 | 442 | */ |
443 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
443 | +if (!function_exists('lasso_editor_empty_results')): |
|
444 | 444 | |
445 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
445 | + function lasso_editor_empty_results($type = 'posts') { |
|
446 | 446 | |
447 | - if ( 'posts' == $type ) { |
|
447 | + if ('posts' == $type) { |
|
448 | 448 | |
449 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
449 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
450 | 450 | $icon = 'lasso-icon-file-text2'; |
451 | 451 | $button = false; |
452 | 452 | |
453 | - } elseif ( 'revision' == $type ) { |
|
453 | + } elseif ('revision' == $type) { |
|
454 | 454 | |
455 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
455 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
456 | 456 | $icon = 'lasso-icon-history'; |
457 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
457 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
458 | 458 | |
459 | 459 | } |
460 | 460 | |
461 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
461 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | endif; |
@@ -34,8 +34,8 @@ |
||
34 | 34 | |
35 | 35 | $object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ]; |
36 | 36 | |
37 | - $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
38 | - $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso'))); |
|
37 | + $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
38 | + $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso'))); |
|
39 | 39 | |
40 | 40 | // insert a new post |
41 | 41 | $args = array( |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.0 |
30 | 30 | */ |
31 | - public function post( $data ) { |
|
31 | + public function post($data) { |
|
32 | 32 | |
33 | - $title = $data[ 'story_title' ]; |
|
33 | + $title = $data['story_title']; |
|
34 | 34 | |
35 | - $object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ]; |
|
35 | + $object = is_null($data['object']) ? false : $data['object']; |
|
36 | 36 | |
37 | - $new_post_text = lasso_editor_get_option( 'new_post_text', 'lasso_editor' ); |
|
38 | - $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso'))); |
|
37 | + $new_post_text = lasso_editor_get_option('new_post_text', 'lasso_editor'); |
|
38 | + $new_post_text = !empty($new_post_text) ? $new_post_text : wp_strip_all_tags(apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso'))); |
|
39 | 39 | |
40 | 40 | // insert a new post |
41 | 41 | $args = array( |
42 | 42 | 'post_title' => $title, |
43 | 43 | 'post_status' => 'draft', |
44 | 44 | 'post_type' => $object, |
45 | - 'post_content' =>'<p class="editus-firstp" placeholder="'. $new_post_text. '"></p>' |
|
45 | + 'post_content' =>'<p class="editus-firstp" placeholder="'.$new_post_text.'"></p>' |
|
46 | 46 | ); |
47 | 47 | |
48 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) ); |
|
48 | + $postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args)); |
|
49 | 49 | |
50 | - do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() ); |
|
50 | + do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID()); |
|
51 | 51 | |
52 | 52 | return array( |
53 | - 'postlink' => get_permalink( $postid ) |
|
53 | + 'postlink' => get_permalink($postid) |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | } |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
64 | 64 | */ |
65 | 65 | public static function params() { |
66 | - $params[ 'process_new_object_post' ] = array( |
|
67 | - 'story_title' => array( 'wp_strip_all_tags', 'trim' ), |
|
66 | + $params['process_new_object_post'] = array( |
|
67 | + 'story_title' => array('wp_strip_all_tags', 'trim'), |
|
68 | 68 | 'object' => 'trim' |
69 | 69 | ); |
70 | 70 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return array Array of additional functions to use to authorize action. |
81 | 81 | */ |
82 | 82 | public static function auth_callbacks() { |
83 | - $params[ 'process_new_object_post' ] = array(); |
|
83 | + $params['process_new_object_post'] = array(); |
|
84 | 84 | |
85 | 85 | return $params; |
86 | 86 |
@@ -436,48 +436,37 @@ discard block |
||
436 | 436 | if ($code == "aesop_video") { |
437 | 437 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
438 | 438 | echo aesop_video_shortcode($atts); |
439 | - } |
|
440 | - else if ($code == "aesop_image") { |
|
439 | + } else if ($code == "aesop_image") { |
|
441 | 440 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
442 | 441 | echo aesop_image_shortcode($atts); |
443 | - } |
|
444 | - else if ($code == "aesop_quote") { |
|
442 | + } else if ($code == "aesop_quote") { |
|
445 | 443 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
446 | 444 | echo aesop_quote_shortcode($atts); |
447 | - } |
|
448 | - else if ($code == "aesop_parallax") { |
|
445 | + } else if ($code == "aesop_parallax") { |
|
449 | 446 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
450 | 447 | echo aesop_parallax_shortcode($atts); |
451 | - } |
|
452 | - else if ($code == "aesop_character") { |
|
448 | + } else if ($code == "aesop_character") { |
|
453 | 449 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
454 | 450 | echo aesop_character_shortcode($atts); |
455 | - } |
|
456 | - else if ($code == "aesop_collection") { |
|
451 | + } else if ($code == "aesop_collection") { |
|
457 | 452 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
458 | 453 | echo aesop_collection_shortcode($atts); |
459 | - } |
|
460 | - else if ($code == "aesop_chapter") { |
|
454 | + } else if ($code == "aesop_chapter") { |
|
461 | 455 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
462 | 456 | echo aesop_chapter_shortcode($atts); |
463 | - } |
|
464 | - else if ($code == "aesop_content") { |
|
457 | + } else if ($code == "aesop_content") { |
|
465 | 458 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
466 | 459 | echo aesop_content_shortcode($atts, $atts['content_data']); |
467 | - } |
|
468 | - else if ($code == "aesop_gallery") { |
|
460 | + } else if ($code == "aesop_gallery") { |
|
469 | 461 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
470 | 462 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
471 | - } |
|
472 | - else if ($code == "aesop_audio") { |
|
463 | + } else if ($code == "aesop_audio") { |
|
473 | 464 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
474 | 465 | echo aesop_audio_shortcode($atts); |
475 | - } |
|
476 | - else if ($code == "aesop_document") { |
|
466 | + } else if ($code == "aesop_document") { |
|
477 | 467 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
478 | 468 | echo aesop_document_shortcode($atts); |
479 | - } |
|
480 | - else if ($code == "aesop_timeline_stop") { |
|
469 | + } else if ($code == "aesop_timeline_stop") { |
|
481 | 470 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
482 | 471 | echo aesop_timeline_stop_shortcode($atts); |
483 | 472 | } |
@@ -487,11 +476,9 @@ discard block |
||
487 | 476 | }*/ |
488 | 477 | else if ($code == "aesop_wpimg") { |
489 | 478 | self::wpimg($atts); |
490 | - } |
|
491 | - else if ($code == "aesop_wpimg-block") { |
|
479 | + } else if ($code == "aesop_wpimg-block") { |
|
492 | 480 | self::wpimg_block($atts); |
493 | - } |
|
494 | - else { |
|
481 | + } else { |
|
495 | 482 | $code = '['.$code.' '; |
496 | 483 | foreach ($atts as $key => $value) { |
497 | 484 | $code = ''.$key.'="'.$value.'" '; |
@@ -607,8 +594,9 @@ discard block |
||
607 | 594 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
608 | 595 | |
609 | 596 | // bail out if the current user can't publish posts |
610 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
611 | - return; |
|
597 | + if ( !lasso_user_can( 'delete_post', $postid ) ) { |
|
598 | + return; |
|
599 | + } |
|
612 | 600 | |
613 | 601 | if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
614 | 602 | wp_send_json_error(); |
@@ -704,15 +692,14 @@ discard block |
||
704 | 692 | } |
705 | 693 | |
706 | 694 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
707 | - } |
|
708 | - else { |
|
695 | + } else { |
|
709 | 696 | //remove all terms from post |
710 | 697 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
711 | 698 | } |
712 | 699 | |
713 | 700 | if ( ! is_wp_error( $result ) ) { |
714 | 701 | return true; |
715 | - }else{ |
|
702 | + } else{ |
|
716 | 703 | return false; |
717 | 704 | } |
718 | 705 | } |
@@ -782,9 +769,9 @@ discard block |
||
782 | 769 | $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
783 | 770 | if ( $_POST[ 'gallery_type' ] ) { |
784 | 771 | $type = $_POST[ 'gallery_type' ]; |
785 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
772 | + } elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
786 | 773 | $type = $options[ 'galleryType' ]; |
787 | - }else{ |
|
774 | + } else{ |
|
788 | 775 | $type = false; |
789 | 776 | } |
790 | 777 | |
@@ -863,13 +850,15 @@ discard block |
||
863 | 850 | |
864 | 851 | $month_numbers = range(1,12); |
865 | 852 | |
866 | - foreach($month_numbers as $month) |
|
867 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
853 | + foreach($month_numbers as $month) { |
|
854 | + $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
855 | + } |
|
868 | 856 | |
869 | 857 | setlocale(LC_ALL, get_locale()); |
870 | 858 | |
871 | - foreach($month_numbers as $month) |
|
872 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
859 | + foreach($month_numbers as $month) { |
|
860 | + $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
861 | + } |
|
873 | 862 | |
874 | 863 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
875 | 864 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
61 | 61 | add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
62 | - add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
62 | + add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
63 | 63 | add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
64 | 64 | add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
65 | 65 | add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
@@ -69,19 +69,19 @@ discard block |
||
69 | 69 | add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
70 | 70 | add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
71 | 71 | |
72 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
72 | + add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
73 | 73 | |
74 | - add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
75 | - add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
74 | + add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
75 | + add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
76 | 76 | |
77 | 77 | // enable saving custom fields through REST API |
78 | 78 | self::enable_metasave('post'); |
79 | 79 | self::enable_metasave('page'); |
80 | 80 | |
81 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
81 | + $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
82 | 82 | $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
83 | - foreach ( $allowed_post_types as $post_type ) { |
|
84 | - self::enable_metasave($post_type); |
|
83 | + foreach ( $allowed_post_types as $post_type ) { |
|
84 | + self::enable_metasave($post_type); |
|
85 | 85 | } |
86 | 86 | //enqueue assets |
87 | 87 | new assets(); |
@@ -278,14 +278,14 @@ discard block |
||
278 | 278 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
279 | 279 | } |
280 | 280 | |
281 | - // new ajax function to lock post for editing |
|
281 | + // new ajax function to lock post for editing |
|
282 | 282 | public function editus_lock_post() |
283 | 283 | { |
284 | 284 | $post_id= $_POST["postid"]; |
285 | 285 | $locked = wp_check_post_lock($post_id); |
286 | 286 | |
287 | 287 | if (!$locked) { |
288 | - wp_set_post_lock($post_id); |
|
288 | + wp_set_post_lock($post_id); |
|
289 | 289 | echo "true"; |
290 | 290 | } else { |
291 | 291 | $user_info = get_userdata($locked); |
@@ -298,9 +298,9 @@ discard block |
||
298 | 298 | { |
299 | 299 | $post_id= $_POST["postid"]; |
300 | 300 | $locked = wp_check_post_lock($post_id); |
301 | - if (!$locked) { |
|
302 | - delete_post_meta( $post_id, '_edit_lock'); |
|
303 | - } |
|
301 | + if (!$locked) { |
|
302 | + delete_post_meta( $post_id, '_edit_lock'); |
|
303 | + } |
|
304 | 304 | echo "true"; |
305 | 305 | |
306 | 306 | exit; |
@@ -328,14 +328,14 @@ discard block |
||
328 | 328 | $status = isset( $data['status'] ) ? $data['status'] : false; |
329 | 329 | $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
330 | 330 | $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
331 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
331 | + $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
332 | 332 | |
333 | 333 | |
334 | 334 | $args = array( |
335 | 335 | 'ID' => (int) $postid, |
336 | 336 | 'post_name' => $slug, |
337 | 337 | 'post_status' => $status, |
338 | - 'post_excerpt' => wp_strip_all_tags($excerpt,true) |
|
338 | + 'post_excerpt' => wp_strip_all_tags($excerpt,true) |
|
339 | 339 | ); |
340 | 340 | |
341 | 341 | |
@@ -410,12 +410,12 @@ discard block |
||
410 | 410 | exit; |
411 | 411 | } |
412 | 412 | |
413 | - public function editus_do_block() |
|
413 | + public function editus_do_block() |
|
414 | 414 | { |
415 | 415 | |
416 | 416 | $code= $_POST["code"]; |
417 | 417 | |
418 | - $out = do_blocks( $code ); |
|
418 | + $out = do_blocks( $code ); |
|
419 | 419 | |
420 | 420 | echo $out; |
421 | 421 | exit; |
@@ -434,67 +434,67 @@ discard block |
||
434 | 434 | } |
435 | 435 | } |
436 | 436 | if ($code == "aesop_video") { |
437 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
438 | - echo aesop_video_shortcode($atts); |
|
437 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
438 | + echo aesop_video_shortcode($atts); |
|
439 | 439 | } |
440 | 440 | else if ($code == "aesop_image") { |
441 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
442 | - echo aesop_image_shortcode($atts); |
|
441 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
442 | + echo aesop_image_shortcode($atts); |
|
443 | 443 | } |
444 | 444 | else if ($code == "aesop_quote") { |
445 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
446 | - echo aesop_quote_shortcode($atts); |
|
445 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
446 | + echo aesop_quote_shortcode($atts); |
|
447 | 447 | } |
448 | 448 | else if ($code == "aesop_parallax") { |
449 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
450 | - echo aesop_parallax_shortcode($atts); |
|
449 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
450 | + echo aesop_parallax_shortcode($atts); |
|
451 | 451 | } |
452 | 452 | else if ($code == "aesop_character") { |
453 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
454 | - echo aesop_character_shortcode($atts); |
|
453 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
454 | + echo aesop_character_shortcode($atts); |
|
455 | 455 | } |
456 | 456 | else if ($code == "aesop_collection") { |
457 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
458 | - echo aesop_collection_shortcode($atts); |
|
457 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
458 | + echo aesop_collection_shortcode($atts); |
|
459 | 459 | } |
460 | 460 | else if ($code == "aesop_chapter") { |
461 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
462 | - echo aesop_chapter_shortcode($atts); |
|
461 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
462 | + echo aesop_chapter_shortcode($atts); |
|
463 | 463 | } |
464 | 464 | else if ($code == "aesop_content") { |
465 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
466 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
465 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
466 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
467 | 467 | } |
468 | 468 | else if ($code == "aesop_gallery") { |
469 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
470 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
469 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
470 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
471 | 471 | } |
472 | 472 | else if ($code == "aesop_audio") { |
473 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
474 | - echo aesop_audio_shortcode($atts); |
|
473 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
474 | + echo aesop_audio_shortcode($atts); |
|
475 | 475 | } |
476 | 476 | else if ($code == "aesop_document") { |
477 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
478 | - echo aesop_document_shortcode($atts); |
|
477 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
478 | + echo aesop_document_shortcode($atts); |
|
479 | 479 | } |
480 | 480 | else if ($code == "aesop_timeline_stop") { |
481 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
482 | - echo aesop_timeline_stop_shortcode($atts); |
|
481 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
482 | + echo aesop_timeline_stop_shortcode($atts); |
|
483 | 483 | } |
484 | - /*else if ($code == "aesop_content") { |
|
484 | + /*else if ($code == "aesop_content") { |
|
485 | 485 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-content.php'); |
486 | 486 | echo aesop_content_shortcode($atts); |
487 | 487 | }*/ |
488 | - else if ($code == "aesop_wpimg") { |
|
489 | - self::wpimg($atts); |
|
488 | + else if ($code == "aesop_wpimg") { |
|
489 | + self::wpimg($atts); |
|
490 | 490 | } |
491 | 491 | else if ($code == "aesop_wpimg-block") { |
492 | - self::wpimg_block($atts); |
|
492 | + self::wpimg_block($atts); |
|
493 | 493 | } |
494 | 494 | else { |
495 | 495 | $code = '['.$code.' '; |
496 | 496 | foreach ($atts as $key => $value) { |
497 | - $code = ''.$key.'="'.$value.'" '; |
|
497 | + $code = ''.$key.'="'.$value.'" '; |
|
498 | 498 | } |
499 | 499 | $code = $code.']'; |
500 | 500 | echo do_shortcode($code); |
@@ -503,102 +503,102 @@ discard block |
||
503 | 503 | exit; |
504 | 504 | } |
505 | 505 | |
506 | - public static function wpimg($atts) { |
|
506 | + public static function wpimg($atts) { |
|
507 | 507 | |
508 | - echo '<figure data-component-type="wpimg"'; |
|
508 | + echo '<figure data-component-type="wpimg"'; |
|
509 | 509 | |
510 | - $extra = ""; |
|
510 | + $extra = ""; |
|
511 | 511 | |
512 | - // try to use srcset and sizes on new WP installs |
|
512 | + // try to use srcset and sizes on new WP installs |
|
513 | 513 | if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
514 | 514 | $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
515 | 515 | $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
516 | - $extra = "srcset='$srcset' sizes='$sizes' "; |
|
517 | - } |
|
518 | - if ($atts['align']=="left") { |
|
519 | - $extra .= 'class="alignleft'; |
|
520 | - } else if ($atts['align']=="right") { |
|
521 | - $extra .= 'class="alignright'; |
|
522 | - } else { |
|
523 | - $extra .= 'class="aligncenter'; |
|
524 | - } |
|
525 | - if ($atts['imgwidth'] || $atts['imgheight']) { |
|
526 | - if ($atts['imgwidth']) { |
|
527 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
528 | - } |
|
529 | - if ($atts['imgheight']) { |
|
530 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
531 | - } |
|
516 | + $extra = "srcset='$srcset' sizes='$sizes' "; |
|
517 | + } |
|
518 | + if ($atts['align']=="left") { |
|
519 | + $extra .= 'class="alignleft'; |
|
520 | + } else if ($atts['align']=="right") { |
|
521 | + $extra .= 'class="alignright'; |
|
522 | + } else { |
|
523 | + $extra .= 'class="aligncenter'; |
|
524 | + } |
|
525 | + if ($atts['imgwidth'] || $atts['imgheight']) { |
|
526 | + if ($atts['imgwidth']) { |
|
527 | + $extra .= 'width:'. $atts['imgwidth'].';'; |
|
528 | + } |
|
529 | + if ($atts['imgheight']) { |
|
530 | + $extra .= 'height:'. $atts['imgheight'].';'; |
|
531 | + } |
|
532 | 532 | |
533 | - } |
|
534 | - $extra .= '"'; |
|
533 | + } |
|
534 | + $extra .= '"'; |
|
535 | 535 | |
536 | - foreach ($atts as $key => $value) { |
|
536 | + foreach ($atts as $key => $value) { |
|
537 | 537 | echo ' data-'.$key.'="'.$value.'"'; |
538 | 538 | } |
539 | - //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
540 | - echo ' class="wp-caption lasso-component">'; |
|
541 | - $hrefset = false; |
|
542 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
543 | - { |
|
544 | - echo '<a href="' . $atts['link'] . '">'; |
|
545 | - $hrefset = true; |
|
546 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
547 | - echo '<a href="' . $atts['img'] . '">'; |
|
548 | - $hrefset = true; |
|
549 | - } |
|
550 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
551 | - if ($hrefset) |
|
552 | - { |
|
553 | - echo '</a>'; |
|
554 | - } |
|
555 | - if ($atts['caption']) |
|
556 | - { |
|
557 | - echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
558 | - } |
|
559 | - echo '</figure>'; |
|
560 | - echo '<p><br></p>'; |
|
561 | - return; |
|
562 | - } |
|
539 | + //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
|
540 | + echo ' class="wp-caption lasso-component">'; |
|
541 | + $hrefset = false; |
|
542 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
543 | + { |
|
544 | + echo '<a href="' . $atts['link'] . '">'; |
|
545 | + $hrefset = true; |
|
546 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
547 | + echo '<a href="' . $atts['img'] . '">'; |
|
548 | + $hrefset = true; |
|
549 | + } |
|
550 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
551 | + if ($hrefset) |
|
552 | + { |
|
553 | + echo '</a>'; |
|
554 | + } |
|
555 | + if ($atts['caption']) |
|
556 | + { |
|
557 | + echo '<figcaption class="wp-caption-text">'.$atts['caption'].'</figcaption>'; |
|
558 | + } |
|
559 | + echo '</figure>'; |
|
560 | + echo '<p><br></p>'; |
|
561 | + return; |
|
562 | + } |
|
563 | 563 | |
564 | 564 | public static function wpimg_block($atts) { |
565 | 565 | $imgextra = ''; |
566 | 566 | if (!empty($atts['id'])) { |
567 | 567 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
568 | 568 | } |
569 | - $figclass = 'aligncenter'; |
|
570 | - if ($atts['align']=="left") { |
|
571 | - $figclass = 'alignleft'; |
|
572 | - } else if ($atts['align']=="right") { |
|
573 | - $figclass = 'alignright'; |
|
574 | - } else { |
|
575 | - $figclass = 'aligncenter'; |
|
576 | - } |
|
569 | + $figclass = 'aligncenter'; |
|
570 | + if ($atts['align']=="left") { |
|
571 | + $figclass = 'alignleft'; |
|
572 | + } else if ($atts['align']=="right") { |
|
573 | + $figclass = 'alignright'; |
|
574 | + } else { |
|
575 | + $figclass = 'aligncenter'; |
|
576 | + } |
|
577 | 577 | |
578 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
579 | - echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
580 | - echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; |
|
581 | - } else { |
|
582 | - echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">'; |
|
583 | - } |
|
584 | - if (!empty($atts['link'])) { |
|
585 | - echo '<a href="'.$atts['link'].'">'; |
|
586 | - } |
|
587 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
588 | - if ($atts['caption']) |
|
589 | - { |
|
590 | - echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
591 | - } |
|
592 | - if (!empty($atts['link'])) { |
|
593 | - echo '</a>'; |
|
594 | - } |
|
595 | - echo '</figure>'; |
|
596 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
597 | - echo '</div>'; |
|
598 | - } |
|
599 | - echo '<p><br></p>'; |
|
600 | - return; |
|
601 | - } |
|
578 | + if ($atts['align']=="left" || $atts['align']=="right") { |
|
579 | + echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
|
580 | + echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; |
|
581 | + } else { |
|
582 | + echo '<figure class="wp-block-image '.$figclass.' size-large" contenteditable="false">'; |
|
583 | + } |
|
584 | + if (!empty($atts['link'])) { |
|
585 | + echo '<a href="'.$atts['link'].'">'; |
|
586 | + } |
|
587 | + echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
588 | + if ($atts['caption']) |
|
589 | + { |
|
590 | + echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
|
591 | + } |
|
592 | + if (!empty($atts['link'])) { |
|
593 | + echo '</a>'; |
|
594 | + } |
|
595 | + echo '</figure>'; |
|
596 | + if ($atts['align']=="left" || $atts['align']=="right") { |
|
597 | + echo '</div>'; |
|
598 | + } |
|
599 | + echo '<p><br></p>'; |
|
600 | + return; |
|
601 | + } |
|
602 | 602 | |
603 | 603 | |
604 | 604 | public function get_ase_options() |
@@ -634,12 +634,12 @@ discard block |
||
634 | 634 | exit; |
635 | 635 | } |
636 | 636 | |
637 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
638 | - public function on_publish_post( ) { |
|
637 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
638 | + public function on_publish_post( ) { |
|
639 | 639 | |
640 | 640 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
641 | 641 | |
642 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
642 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
643 | 643 | |
644 | 644 | exit; |
645 | 645 | } |
@@ -697,14 +697,14 @@ discard block |
||
697 | 697 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
698 | 698 | |
699 | 699 | if ($taxonomy =='category') { |
700 | - // convert from names to category ids |
|
700 | + // convert from names to category ids |
|
701 | 701 | $cats = array(); |
702 | 702 | foreach ($value as $cat) { |
703 | 703 | $cat_id = get_cat_ID($cat); |
704 | 704 | if ($cat_id !=0) { |
705 | 705 | $cats [] = $cat_id; |
706 | 706 | } else if ($allow_new_category) { |
707 | - $cats [] = wp_create_category($cat); |
|
707 | + $cats [] = wp_create_category($cat); |
|
708 | 708 | } |
709 | 709 | } |
710 | 710 | $value = $cats; |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | } |
725 | 725 | } |
726 | 726 | |
727 | - public function create_gallery( ) { |
|
727 | + public function create_gallery( ) { |
|
728 | 728 | |
729 | 729 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
730 | 730 | |
@@ -778,10 +778,10 @@ discard block |
||
778 | 778 | 'message' => 'gallery-created', |
779 | 779 | 'id' => $postid) |
780 | 780 | ); |
781 | - exit; |
|
781 | + exit; |
|
782 | 782 | } |
783 | 783 | |
784 | - public function update_gallery( ) { |
|
784 | + public function update_gallery( ) { |
|
785 | 785 | |
786 | 786 | $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
787 | 787 | |
@@ -797,12 +797,12 @@ discard block |
||
797 | 797 | |
798 | 798 | self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
799 | 799 | |
800 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
800 | + echo json_encode( array('message' => 'gallery-updated') ); |
|
801 | 801 | |
802 | - exit; |
|
802 | + exit; |
|
803 | 803 | } |
804 | 804 | |
805 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
805 | + public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
806 | 806 | |
807 | 807 | // gallery width |
808 | 808 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | public function set_date( $postid, $value) { |
887 | 887 | if( $value ) { |
888 | 888 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
889 | - wp_update_post( |
|
889 | + wp_update_post( |
|
890 | 890 | array ( |
891 | 891 | 'ID' => $postid, // ID of the post to update |
892 | 892 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -52,35 +52,35 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
63 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
64 | - add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
|
65 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
66 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
67 | - add_action( 'wp_ajax_editus_get_ase_options', array( $this, 'get_ase_options' ) ); |
|
68 | - add_action( 'wp_ajax_editus_delete_post', array( $this, 'delete_post' ) ); |
|
69 | - add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
|
70 | - add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_do_block', array($this, 'editus_do_block')); |
|
63 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
64 | + add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post')); |
|
65 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
66 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
67 | + add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options')); |
|
68 | + add_action('wp_ajax_editus_delete_post', array($this, 'delete_post')); |
|
69 | + add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img')); |
|
70 | + add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img')); |
|
71 | 71 | |
72 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
72 | + add_action('wp_ajax_editus_publish_post', array($this, 'on_publish_post')); |
|
73 | 73 | |
74 | - add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
75 | - add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
74 | + add_action('wp_ajax_editus_create_gallery', array($this, 'create_gallery')); |
|
75 | + add_action('wp_ajax_editus_update_gallery', array($this, 'update_gallery')); |
|
76 | 76 | |
77 | 77 | // enable saving custom fields through REST API |
78 | 78 | self::enable_metasave('post'); |
79 | 79 | self::enable_metasave('page'); |
80 | 80 | |
81 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
82 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
83 | - foreach ( $allowed_post_types as $post_type ) { |
|
81 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
82 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
83 | + foreach ($allowed_post_types as $post_type) { |
|
84 | 84 | self::enable_metasave($post_type); |
85 | 85 | } |
86 | 86 | //enqueue assets |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public static function get_instance() { |
110 | 110 | |
111 | 111 | // If the single instance hasn't been set, set it now. |
112 | - if ( null == self::$instance ) { |
|
112 | + if (null == self::$instance) { |
|
113 | 113 | self::$instance = new self; |
114 | 114 | } |
115 | 115 | |
@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | * WPMU is disabled or plugin is |
127 | 127 | * activated on an individual blog. |
128 | 128 | */ |
129 | - public static function activate( $network_wide ) { |
|
129 | + public static function activate($network_wide) { |
|
130 | 130 | |
131 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
131 | + if (function_exists('is_multisite') && is_multisite()) { |
|
132 | 132 | |
133 | - if ( $network_wide ) { |
|
133 | + if ($network_wide) { |
|
134 | 134 | |
135 | 135 | // Get all blog ids |
136 | 136 | $blog_ids = self::get_blog_ids(); |
137 | 137 | |
138 | - foreach ( $blog_ids as $blog_id ) { |
|
138 | + foreach ($blog_ids as $blog_id) { |
|
139 | 139 | |
140 | - switch_to_blog( $blog_id ); |
|
140 | + switch_to_blog($blog_id); |
|
141 | 141 | self::single_activate(); |
142 | 142 | } |
143 | 143 | |
@@ -163,18 +163,18 @@ discard block |
||
163 | 163 | * WPMU is disabled or plugin is |
164 | 164 | * deactivated on an individual blog. |
165 | 165 | */ |
166 | - public static function deactivate( $network_wide ) { |
|
166 | + public static function deactivate($network_wide) { |
|
167 | 167 | |
168 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
168 | + if (function_exists('is_multisite') && is_multisite()) { |
|
169 | 169 | |
170 | - if ( $network_wide ) { |
|
170 | + if ($network_wide) { |
|
171 | 171 | |
172 | 172 | // Get all blog ids |
173 | 173 | $blog_ids = self::get_blog_ids(); |
174 | 174 | |
175 | - foreach ( $blog_ids as $blog_id ) { |
|
175 | + foreach ($blog_ids as $blog_id) { |
|
176 | 176 | |
177 | - switch_to_blog( $blog_id ); |
|
177 | + switch_to_blog($blog_id); |
|
178 | 178 | self::single_deactivate(); |
179 | 179 | |
180 | 180 | } |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | * |
199 | 199 | * @param int $blog_id ID of the new blog. |
200 | 200 | */ |
201 | - public function activate_new_site( $blog_id ) { |
|
201 | + public function activate_new_site($blog_id) { |
|
202 | 202 | |
203 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
203 | + if (1 !== did_action('wpmu_new_blog')) { |
|
204 | 204 | return; |
205 | 205 | } |
206 | 206 | |
207 | - switch_to_blog( $blog_id ); |
|
207 | + switch_to_blog($blog_id); |
|
208 | 208 | self::single_activate(); |
209 | 209 | restore_current_blog(); |
210 | 210 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | WHERE archived = '0' AND spam = '0' |
230 | 230 | AND deleted = '0'"; |
231 | 231 | |
232 | - return $wpdb->get_col( $sql ); |
|
232 | + return $wpdb->get_col($sql); |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | |
@@ -240,18 +240,18 @@ discard block |
||
240 | 240 | */ |
241 | 241 | private static function single_activate() { |
242 | 242 | |
243 | - $curr_version = get_option( 'lasso_version' ); |
|
243 | + $curr_version = get_option('lasso_version'); |
|
244 | 244 | |
245 | 245 | // update upgraded from |
246 | - if ( $curr_version ) { |
|
247 | - update_option( 'lasso_updated_from', $curr_version ); |
|
246 | + if ($curr_version) { |
|
247 | + update_option('lasso_updated_from', $curr_version); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | // update lasso version option |
251 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
251 | + update_option('lasso_version', LASSO_VERSION); |
|
252 | 252 | |
253 | 253 | // set transietn for activation welcome |
254 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
254 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
255 | 255 | |
256 | 256 | |
257 | 257 | } |
@@ -273,15 +273,15 @@ discard block |
||
273 | 273 | public function load_plugin_textdomain() { |
274 | 274 | |
275 | 275 | $domain = $this->plugin_slug; |
276 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
276 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
277 | 277 | |
278 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
278 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | // new ajax function to lock post for editing |
282 | 282 | public function editus_lock_post() |
283 | 283 | { |
284 | - $post_id= $_POST["postid"]; |
|
284 | + $post_id = $_POST["postid"]; |
|
285 | 285 | $locked = wp_check_post_lock($post_id); |
286 | 286 | |
287 | 287 | if (!$locked) { |
@@ -289,17 +289,17 @@ discard block |
||
289 | 289 | echo "true"; |
290 | 290 | } else { |
291 | 291 | $user_info = get_userdata($locked); |
292 | - echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name . " " . $user_info->last_name; |
|
292 | + echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name; |
|
293 | 293 | } |
294 | 294 | exit; |
295 | 295 | } |
296 | 296 | |
297 | 297 | public function editus_unlock_post() |
298 | 298 | { |
299 | - $post_id= $_POST["postid"]; |
|
299 | + $post_id = $_POST["postid"]; |
|
300 | 300 | $locked = wp_check_post_lock($post_id); |
301 | 301 | if (!$locked) { |
302 | - delete_post_meta( $post_id, '_edit_lock'); |
|
302 | + delete_post_meta($post_id, '_edit_lock'); |
|
303 | 303 | } |
304 | 304 | echo "true"; |
305 | 305 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | { |
312 | 312 | $user_id = get_current_user_ID(); |
313 | 313 | |
314 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
314 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
315 | 315 | exit; |
316 | 316 | } |
317 | 317 | |
@@ -320,51 +320,51 @@ discard block |
||
320 | 320 | $data = array(); |
321 | 321 | parse_str($_POST['data'], $data); |
322 | 322 | |
323 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
323 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
324 | 324 | wp_send_json_error(); |
325 | 325 | exit; |
326 | 326 | } |
327 | 327 | |
328 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
329 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
330 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
331 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
328 | + $status = isset($data['status']) ? $data['status'] : false; |
|
329 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
330 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
331 | + $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false; |
|
332 | 332 | |
333 | 333 | |
334 | 334 | $args = array( |
335 | 335 | 'ID' => (int) $postid, |
336 | 336 | 'post_name' => $slug, |
337 | 337 | 'post_status' => $status, |
338 | - 'post_excerpt' => wp_strip_all_tags($excerpt,true) |
|
338 | + 'post_excerpt' => wp_strip_all_tags($excerpt, true) |
|
339 | 339 | ); |
340 | 340 | |
341 | 341 | |
342 | 342 | |
343 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
343 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
344 | 344 | |
345 | 345 | // update categories |
346 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
346 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
347 | 347 | |
348 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
348 | + self::set_post_terms($postid, $cats, 'category'); |
|
349 | 349 | |
350 | 350 | // update tags |
351 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
352 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
351 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
352 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
353 | 353 | |
354 | 354 | // update custom taxonomy |
355 | - $custom_taxonomies = isset( $data['story_custom_taxonomies'] ) ? json_decode($data['story_custom_taxonomies']) : false; |
|
355 | + $custom_taxonomies = isset($data['story_custom_taxonomies']) ? json_decode($data['story_custom_taxonomies']) : false; |
|
356 | 356 | |
357 | 357 | foreach ($custom_taxonomies as $x => $x_value) { |
358 | - self::set_post_terms( $postid, $x_value, $x ); |
|
358 | + self::set_post_terms($postid, $x_value, $x); |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | //update date |
362 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
363 | - self::set_date( $postid, $date ); |
|
362 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
363 | + self::set_date($postid, $date); |
|
364 | 364 | |
365 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
366 | - $response= array( |
|
367 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
365 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
366 | + $response = array( |
|
367 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
368 | 368 | ); |
369 | 369 | wp_send_json_success($response); |
370 | 370 | exit; |
@@ -372,11 +372,11 @@ discard block |
||
372 | 372 | |
373 | 373 | public static function enable_metasave($type) |
374 | 374 | { |
375 | - register_rest_field( $type, 'metadata', array( |
|
376 | - 'get_callback' => function ( $data ) { |
|
377 | - return get_post_meta( $data['id']);//, '', '' ); |
|
375 | + register_rest_field($type, 'metadata', array( |
|
376 | + 'get_callback' => function($data) { |
|
377 | + return get_post_meta($data['id']); //, '', '' ); |
|
378 | 378 | }, |
379 | - 'update_callback' => function( $data, $post ) { |
|
379 | + 'update_callback' => function($data, $post) { |
|
380 | 380 | foreach ($data as $key => $value) { |
381 | 381 | update_post_meta($post->ID, $key, $value); |
382 | 382 | } |
@@ -388,13 +388,13 @@ discard block |
||
388 | 388 | public function editus_do_shortcode() |
389 | 389 | { |
390 | 390 | |
391 | - $code= $_POST["code"]; |
|
391 | + $code = $_POST["code"]; |
|
392 | 392 | $code = str_replace('\"', '"', $code); |
393 | 393 | |
394 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
395 | - $out = do_shortcode($code); |
|
394 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
395 | + $out = do_shortcode($code); |
|
396 | 396 | if ($out != '') { |
397 | - $out = do_shortcode($code_wrapped); |
|
397 | + $out = do_shortcode($code_wrapped); |
|
398 | 398 | echo $out; |
399 | 399 | exit; |
400 | 400 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | /** @var \WP_Embed $wp_embed */ |
405 | 405 | global $wp_embed; |
406 | 406 | $wp_embed->post_ID = $_POST["ID"]; |
407 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
407 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
408 | 408 | |
409 | 409 | echo $out; |
410 | 410 | exit; |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | public function editus_do_block() |
414 | 414 | { |
415 | 415 | |
416 | - $code= $_POST["code"]; |
|
416 | + $code = $_POST["code"]; |
|
417 | 417 | |
418 | - $out = do_blocks( $code ); |
|
418 | + $out = do_blocks($code); |
|
419 | 419 | |
420 | 420 | echo $out; |
421 | 421 | exit; |
@@ -425,60 +425,60 @@ discard block |
||
425 | 425 | { |
426 | 426 | |
427 | 427 | |
428 | - $code= $_POST["code"]; |
|
428 | + $code = $_POST["code"]; |
|
429 | 429 | $atts = array( |
430 | 430 | ); |
431 | 431 | foreach ($_POST as $key => $value) { |
432 | - if ($key !="code" && $key !="action") { |
|
432 | + if ($key != "code" && $key != "action") { |
|
433 | 433 | $atts[$key] = $value; |
434 | 434 | } |
435 | 435 | } |
436 | 436 | if ($code == "aesop_video") { |
437 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
437 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
438 | 438 | echo aesop_video_shortcode($atts); |
439 | 439 | } |
440 | 440 | else if ($code == "aesop_image") { |
441 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
441 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
442 | 442 | echo aesop_image_shortcode($atts); |
443 | 443 | } |
444 | 444 | else if ($code == "aesop_quote") { |
445 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
445 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
446 | 446 | echo aesop_quote_shortcode($atts); |
447 | 447 | } |
448 | 448 | else if ($code == "aesop_parallax") { |
449 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
449 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
450 | 450 | echo aesop_parallax_shortcode($atts); |
451 | 451 | } |
452 | 452 | else if ($code == "aesop_character") { |
453 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
453 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
454 | 454 | echo aesop_character_shortcode($atts); |
455 | 455 | } |
456 | 456 | else if ($code == "aesop_collection") { |
457 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
457 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
458 | 458 | echo aesop_collection_shortcode($atts); |
459 | 459 | } |
460 | 460 | else if ($code == "aesop_chapter") { |
461 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
461 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
462 | 462 | echo aesop_chapter_shortcode($atts); |
463 | 463 | } |
464 | 464 | else if ($code == "aesop_content") { |
465 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
465 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
466 | 466 | echo aesop_content_shortcode($atts, $atts['content_data']); |
467 | 467 | } |
468 | 468 | else if ($code == "aesop_gallery") { |
469 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
470 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
469 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
470 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
471 | 471 | } |
472 | 472 | else if ($code == "aesop_audio") { |
473 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
473 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
474 | 474 | echo aesop_audio_shortcode($atts); |
475 | 475 | } |
476 | 476 | else if ($code == "aesop_document") { |
477 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
477 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
478 | 478 | echo aesop_document_shortcode($atts); |
479 | 479 | } |
480 | 480 | else if ($code == "aesop_timeline_stop") { |
481 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
481 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-timeline.php'); |
|
482 | 482 | echo aesop_timeline_stop_shortcode($atts); |
483 | 483 | } |
484 | 484 | /*else if ($code == "aesop_content") { |
@@ -510,24 +510,24 @@ discard block |
||
510 | 510 | $extra = ""; |
511 | 511 | |
512 | 512 | // try to use srcset and sizes on new WP installs |
513 | - if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
|
514 | - $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
|
515 | - $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
|
513 | + if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) { |
|
514 | + $srcset = wp_get_attachment_image_srcset($attachment_id, 'full'); |
|
515 | + $sizes = wp_get_attachment_image_sizes($attachment_id, 'full'); |
|
516 | 516 | $extra = "srcset='$srcset' sizes='$sizes' "; |
517 | 517 | } |
518 | - if ($atts['align']=="left") { |
|
518 | + if ($atts['align'] == "left") { |
|
519 | 519 | $extra .= 'class="alignleft'; |
520 | - } else if ($atts['align']=="right") { |
|
520 | + } else if ($atts['align'] == "right") { |
|
521 | 521 | $extra .= 'class="alignright'; |
522 | 522 | } else { |
523 | 523 | $extra .= 'class="aligncenter'; |
524 | 524 | } |
525 | 525 | if ($atts['imgwidth'] || $atts['imgheight']) { |
526 | 526 | if ($atts['imgwidth']) { |
527 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
527 | + $extra .= 'width:'.$atts['imgwidth'].';'; |
|
528 | 528 | } |
529 | 529 | if ($atts['imgheight']) { |
530 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
530 | + $extra .= 'height:'.$atts['imgheight'].';'; |
|
531 | 531 | } |
532 | 532 | |
533 | 533 | } |
@@ -539,15 +539,15 @@ discard block |
||
539 | 539 | //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
540 | 540 | echo ' class="wp-caption lasso-component">'; |
541 | 541 | $hrefset = false; |
542 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
542 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url")) |
|
543 | 543 | { |
544 | - echo '<a href="' . $atts['link'] . '">'; |
|
544 | + echo '<a href="'.$atts['link'].'">'; |
|
545 | 545 | $hrefset = true; |
546 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
547 | - echo '<a href="' . $atts['img'] . '">'; |
|
546 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') { |
|
547 | + echo '<a href="'.$atts['img'].'">'; |
|
548 | 548 | $hrefset = true; |
549 | 549 | } |
550 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
550 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>'; |
|
551 | 551 | if ($hrefset) |
552 | 552 | { |
553 | 553 | echo '</a>'; |
@@ -567,15 +567,15 @@ discard block |
||
567 | 567 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
568 | 568 | } |
569 | 569 | $figclass = 'aligncenter'; |
570 | - if ($atts['align']=="left") { |
|
570 | + if ($atts['align'] == "left") { |
|
571 | 571 | $figclass = 'alignleft'; |
572 | - } else if ($atts['align']=="right") { |
|
572 | + } else if ($atts['align'] == "right") { |
|
573 | 573 | $figclass = 'alignright'; |
574 | 574 | } else { |
575 | 575 | $figclass = 'aligncenter'; |
576 | 576 | } |
577 | 577 | |
578 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
578 | + if ($atts['align'] == "left" || $atts['align'] == "right") { |
|
579 | 579 | echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
580 | 580 | echo '<figure class="'.$figclass.' size-large" contenteditable="false">'; |
581 | 581 | } else { |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if (!empty($atts['link'])) { |
585 | 585 | echo '<a href="'.$atts['link'].'">'; |
586 | 586 | } |
587 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
587 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' >'; |
|
588 | 588 | if ($atts['caption']) |
589 | 589 | { |
590 | 590 | echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | echo '</a>'; |
594 | 594 | } |
595 | 595 | echo '</figure>'; |
596 | - if ($atts['align']=="left" || $atts['align']=="right") { |
|
596 | + if ($atts['align'] == "left" || $atts['align'] == "right") { |
|
597 | 597 | echo '</div>'; |
598 | 598 | } |
599 | 599 | echo '<p><br></p>'; |
@@ -604,20 +604,20 @@ discard block |
||
604 | 604 | public function get_ase_options() |
605 | 605 | { |
606 | 606 | $blob = lasso_editor_options_blob(); |
607 | - $code= $_POST["component"]; |
|
607 | + $code = $_POST["component"]; |
|
608 | 608 | echo $blob[$code]; |
609 | 609 | exit; |
610 | 610 | } |
611 | 611 | |
612 | 612 | public function delete_post( ) { |
613 | 613 | |
614 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
614 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
615 | 615 | |
616 | 616 | // bail out if the current user can't publish posts |
617 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
617 | + if (!lasso_user_can('delete_post', $postid)) |
|
618 | 618 | return; |
619 | 619 | |
620 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
|
620 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) { |
|
621 | 621 | wp_send_json_error(); |
622 | 622 | exit; |
623 | 623 | } |
@@ -627,9 +627,9 @@ discard block |
||
627 | 627 | 'post_status' => 'trash' |
628 | 628 | ); |
629 | 629 | |
630 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
630 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
631 | 631 | |
632 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
632 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
633 | 633 | |
634 | 634 | exit; |
635 | 635 | } |
@@ -637,40 +637,40 @@ discard block |
||
637 | 637 | /* This function doesn't actually publish post, but should be called when a post is published */ |
638 | 638 | public function on_publish_post( ) { |
639 | 639 | |
640 | - $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
640 | + $post_id = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
641 | 641 | |
642 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
642 | + do_action('transition_post_status', 'publish', 'draft', get_post($post_id)); |
|
643 | 643 | |
644 | 644 | exit; |
645 | 645 | } |
646 | 646 | |
647 | 647 | public function set_featured_img( ) { |
648 | 648 | |
649 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
650 | - $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false; |
|
651 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
649 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
650 | + $image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false; |
|
651 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
652 | 652 | wp_send_json_error(); |
653 | 653 | exit; |
654 | 654 | } |
655 | 655 | |
656 | - set_post_thumbnail( $postid, $image_id ); |
|
656 | + set_post_thumbnail($postid, $image_id); |
|
657 | 657 | |
658 | - do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() ); |
|
658 | + do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID()); |
|
659 | 659 | |
660 | 660 | exit; |
661 | 661 | } |
662 | 662 | |
663 | 663 | public function del_featured_img( ) { |
664 | 664 | |
665 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
666 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
665 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
666 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
667 | 667 | wp_send_json_error(); |
668 | 668 | exit; |
669 | 669 | } |
670 | 670 | |
671 | - delete_post_thumbnail( $postid ); |
|
671 | + delete_post_thumbnail($postid); |
|
672 | 672 | |
673 | - do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() ); |
|
673 | + do_action('lasso_featured_image_deleted', $postid, get_current_user_ID()); |
|
674 | 674 | |
675 | 675 | exit; |
676 | 676 | } |
@@ -691,17 +691,17 @@ discard block |
||
691 | 691 | return self::$revisions; |
692 | 692 | }*/ |
693 | 693 | |
694 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
695 | - if( $value ) { |
|
696 | - $value = explode( ',', $value ); |
|
697 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
694 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
695 | + if ($value) { |
|
696 | + $value = explode(',', $value); |
|
697 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
698 | 698 | |
699 | - if ($taxonomy =='category') { |
|
699 | + if ($taxonomy == 'category') { |
|
700 | 700 | // convert from names to category ids |
701 | 701 | $cats = array(); |
702 | 702 | foreach ($value as $cat) { |
703 | 703 | $cat_id = get_cat_ID($cat); |
704 | - if ($cat_id !=0) { |
|
704 | + if ($cat_id != 0) { |
|
705 | 705 | $cats [] = $cat_id; |
706 | 706 | } else if ($allow_new_category) { |
707 | 707 | $cats [] = wp_create_category($cat); |
@@ -710,71 +710,71 @@ discard block |
||
710 | 710 | $value = $cats; |
711 | 711 | } |
712 | 712 | |
713 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
713 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
714 | 714 | } |
715 | - else { |
|
715 | + else { |
|
716 | 716 | //remove all terms from post |
717 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
717 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
718 | 718 | } |
719 | 719 | |
720 | - if ( ! is_wp_error( $result ) ) { |
|
720 | + if (!is_wp_error($result)) { |
|
721 | 721 | return true; |
722 | - }else{ |
|
722 | + } else { |
|
723 | 723 | return false; |
724 | 724 | } |
725 | 725 | } |
726 | 726 | |
727 | 727 | public function create_gallery( ) { |
728 | 728 | |
729 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
729 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
730 | 730 | |
731 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
731 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
732 | 732 | wp_send_json_error(); |
733 | 733 | exit; |
734 | 734 | } |
735 | 735 | |
736 | - if ( ! lasso_user_can( 'publish_posts' ) ) { |
|
736 | + if (!lasso_user_can('publish_posts')) { |
|
737 | 737 | return false; |
738 | 738 | |
739 | 739 | } |
740 | 740 | |
741 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
741 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
742 | 742 | |
743 | 743 | // bail if no gallery ids |
744 | - if ( empty( $gallery_ids ) ) { |
|
744 | + if (empty($gallery_ids)) { |
|
745 | 745 | return false; |
746 | 746 | } |
747 | 747 | |
748 | - $type = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false; |
|
749 | - $edgallerytitle = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
748 | + $type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false; |
|
749 | + $edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
750 | 750 | |
751 | 751 | // insert a new gallery |
752 | 752 | $args = array( |
753 | - 'post_title' => $edgallerytitle , |
|
753 | + 'post_title' => $edgallerytitle, |
|
754 | 754 | 'post_status' => 'publish', |
755 | 755 | 'post_type' => 'ai_galleries' |
756 | 756 | ); |
757 | 757 | |
758 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) ); |
|
758 | + $postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args)); |
|
759 | 759 | |
760 | 760 | // update gallery ids |
761 | - if ( $gallery_ids ) { |
|
761 | + if ($gallery_ids) { |
|
762 | 762 | |
763 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
763 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
764 | 764 | |
765 | 765 | } |
766 | 766 | |
767 | 767 | // update the gallery type |
768 | - if ( !empty( $type ) ) { |
|
768 | + if (!empty($type)) { |
|
769 | 769 | |
770 | - update_post_meta( $postid, 'aesop_gallery_type', $type ); |
|
770 | + update_post_meta($postid, 'aesop_gallery_type', $type); |
|
771 | 771 | |
772 | 772 | } |
773 | 773 | |
774 | - do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() ); |
|
774 | + do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID()); |
|
775 | 775 | |
776 | 776 | |
777 | - echo json_encode( array( |
|
777 | + echo json_encode(array( |
|
778 | 778 | 'message' => 'gallery-created', |
779 | 779 | 'id' => $postid) |
780 | 780 | ); |
@@ -783,114 +783,114 @@ discard block |
||
783 | 783 | |
784 | 784 | public function update_gallery( ) { |
785 | 785 | |
786 | - $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
|
786 | + $options = isset($_POST['fields']) ? $_POST['fields'] : false; |
|
787 | 787 | |
788 | - $postid = !empty( $options ) ? (int) $options['id'] : false; |
|
789 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
790 | - if ( $_POST[ 'gallery_type' ] ) { |
|
791 | - $type = $_POST[ 'gallery_type' ]; |
|
792 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
793 | - $type = $options[ 'galleryType' ]; |
|
794 | - }else{ |
|
788 | + $postid = !empty($options) ? (int) $options['id'] : false; |
|
789 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
790 | + if ($_POST['gallery_type']) { |
|
791 | + $type = $_POST['gallery_type']; |
|
792 | + }elseif (!empty($options) && $options['galleryType']) { |
|
793 | + $type = $options['galleryType']; |
|
794 | + } else { |
|
795 | 795 | $type = false; |
796 | 796 | } |
797 | 797 | |
798 | - self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
|
798 | + self::save_gallery_options($postid, $gallery_ids, $options, $type); |
|
799 | 799 | |
800 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
800 | + echo json_encode(array('message' => 'gallery-updated')); |
|
801 | 801 | |
802 | 802 | exit; |
803 | 803 | } |
804 | 804 | |
805 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
805 | + public function save_gallery_options($postid, $gallery_ids, $options, $type = false) { |
|
806 | 806 | |
807 | 807 | // gallery width |
808 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
808 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
809 | 809 | |
810 | 810 | // gallery grid item width |
811 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
811 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
812 | 812 | |
813 | 813 | // caption |
814 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
814 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
815 | 815 | |
816 | 816 | // gallery transition |
817 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
817 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
818 | 818 | |
819 | 819 | // gallery transition speed |
820 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
820 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
821 | 821 | |
822 | 822 | // gallery hide thumbs |
823 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
823 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
824 | 824 | |
825 | 825 | // photoset layout hardwired to on for now |
826 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
826 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
827 | 827 | |
828 | 828 | // photoset layout |
829 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
829 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
830 | 830 | |
831 | 831 | // hero gallery height |
832 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
832 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
833 | 833 | |
834 | 834 | // update gallery ids |
835 | - if ( !empty( $gallery_ids ) ) { |
|
835 | + if (!empty($gallery_ids)) { |
|
836 | 836 | |
837 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
837 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
838 | 838 | |
839 | 839 | } |
840 | 840 | |
841 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
841 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
842 | 842 | |
843 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
843 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
844 | 844 | |
845 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
845 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
846 | 846 | |
847 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
847 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
848 | 848 | |
849 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
849 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
850 | 850 | |
851 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
851 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
852 | 852 | |
853 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
853 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
854 | 854 | |
855 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
855 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
856 | 856 | |
857 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
857 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
858 | 858 | |
859 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
859 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
860 | 860 | |
861 | 861 | //hardwired for now |
862 | 862 | |
863 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
863 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
864 | 864 | |
865 | 865 | } |
866 | 866 | |
867 | - function getEnglishMonthName($foreignMonthName){ |
|
867 | + function getEnglishMonthName($foreignMonthName) { |
|
868 | 868 | |
869 | 869 | setlocale(LC_ALL, 'en_US'); |
870 | 870 | |
871 | - $month_numbers = range(1,12); |
|
871 | + $month_numbers = range(1, 12); |
|
872 | 872 | |
873 | - foreach($month_numbers as $month) |
|
874 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
873 | + foreach ($month_numbers as $month) |
|
874 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
875 | 875 | |
876 | 876 | setlocale(LC_ALL, get_locale()); |
877 | 877 | |
878 | - foreach($month_numbers as $month) |
|
879 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
878 | + foreach ($month_numbers as $month) |
|
879 | + $foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011))); |
|
880 | 880 | |
881 | 881 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
882 | 882 | } |
883 | 883 | |
884 | 884 | |
885 | 885 | |
886 | - public function set_date( $postid, $value) { |
|
887 | - if( $value ) { |
|
888 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
886 | + public function set_date($postid, $value) { |
|
887 | + if ($value) { |
|
888 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
889 | 889 | wp_update_post( |
890 | - array ( |
|
890 | + array( |
|
891 | 891 | 'ID' => $postid, // ID of the post to update |
892 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
893 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
892 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
893 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
894 | 894 | ) |
895 | 895 | ); |
896 | 896 | } |