@@ -279,6 +279,9 @@ |
||
279 | 279 | endif; |
280 | 280 | |
281 | 281 | // helper function to retrieve one id for default option |
282 | +/** |
|
283 | + * @param string $type |
|
284 | + */ |
|
282 | 285 | function editus_get_one_id($type) |
283 | 286 | { |
284 | 287 | $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
@@ -16,80 +16,80 @@ 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 | 'wpquote' => array( |
75 | - 'name' => __('WordPress Quote','lasso'), |
|
75 | + 'name' => __('WordPress Quote', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_quote(), |
77 | 77 | ), |
78 | 78 | 'gallery_pop' => array( |
79 | - 'name' => __('Gallery Pop','lasso'), |
|
79 | + 'name' => __('Gallery Pop', 'lasso'), |
|
80 | 80 | 'content' => lasso_gallery_pop_component(), |
81 | 81 | ), |
82 | 82 | 'events' => array( |
83 | - 'name' => __('Events','lasso'), |
|
83 | + 'name' => __('Events', 'lasso'), |
|
84 | 84 | 'content' => lasso_event_component(), |
85 | 85 | ), |
86 | 86 | 'wpvideo' => array( |
87 | - 'name' => __('WordPress Image','lasso'), |
|
87 | + 'name' => __('WordPress Image', 'lasso'), |
|
88 | 88 | 'content' => lasso_wp_video(), |
89 | 89 | ), |
90 | 90 | ); |
91 | 91 | |
92 | - return apply_filters( 'lasso_components', $array ); |
|
92 | + return apply_filters('lasso_components', $array); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -115,132 +115,132 @@ discard block |
||
115 | 115 | */ |
116 | 116 | |
117 | 117 | // 1 |
118 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
118 | +if (!function_exists('lasso_quote_component')): |
|
119 | 119 | function lasso_quote_component() { |
120 | 120 | |
121 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
121 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
122 | 122 | } |
123 | 123 | endif; |
124 | 124 | |
125 | 125 | // 2 |
126 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
126 | +if (!function_exists('lasso_image_component')): |
|
127 | 127 | function lasso_image_component() { |
128 | 128 | |
129 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' ); |
|
129 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]'); |
|
130 | 130 | } |
131 | 131 | endif; |
132 | 132 | |
133 | 133 | // 3 |
134 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
134 | +if (!function_exists('lasso_parallax_component')): |
|
135 | 135 | function lasso_parallax_component() { |
136 | 136 | |
137 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
137 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
138 | 138 | } |
139 | 139 | endif; |
140 | 140 | |
141 | 141 | // 4 |
142 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
142 | +if (!function_exists('lasso_audio_component')): |
|
143 | 143 | function lasso_audio_component() { |
144 | 144 | |
145 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
145 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
146 | 146 | |
147 | 147 | } |
148 | 148 | endif; |
149 | 149 | |
150 | 150 | // 5 |
151 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
151 | +if (!function_exists('lasso_content_component')): |
|
152 | 152 | function lasso_content_component() { |
153 | 153 | |
154 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
154 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
155 | 155 | } |
156 | 156 | endif; |
157 | 157 | |
158 | 158 | // 6 |
159 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
159 | +if (!function_exists('lasso_character_component')): |
|
160 | 160 | function lasso_character_component() { |
161 | 161 | |
162 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
162 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | endif; |
166 | 166 | |
167 | 167 | // 7 |
168 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
168 | +if (!function_exists('lasso_collections_component')): |
|
169 | 169 | function lasso_collections_component() { |
170 | 170 | |
171 | - return do_shortcode( '[aesop_collection]' ); |
|
171 | + return do_shortcode('[aesop_collection]'); |
|
172 | 172 | } |
173 | 173 | endif; |
174 | 174 | |
175 | 175 | // 8 |
176 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
176 | +if (!function_exists('lasso_document_component')): |
|
177 | 177 | function lasso_document_component() { |
178 | 178 | |
179 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
179 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
180 | 180 | |
181 | 181 | } |
182 | 182 | endif; |
183 | 183 | |
184 | 184 | // 9 |
185 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
185 | +if (!function_exists('lasso_gallery_component')): |
|
186 | 186 | function lasso_gallery_component() { |
187 | 187 | |
188 | - return do_shortcode( '[aesop_gallery]' ); |
|
188 | + return do_shortcode('[aesop_gallery]'); |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | endif; |
192 | 192 | |
193 | 193 | // 10 |
194 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
194 | +if (!function_exists('lasso_heading_component')): |
|
195 | 195 | function lasso_heading_component() { |
196 | 196 | |
197 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
197 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
198 | 198 | } |
199 | 199 | endif; |
200 | 200 | |
201 | 201 | // 11 |
202 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
202 | +if (!function_exists('lasso_map_component')): |
|
203 | 203 | function lasso_map_component() { |
204 | 204 | |
205 | 205 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
206 | 206 | '.lasso_map_form_footer().' |
207 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
207 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
208 | 208 | </form>'; |
209 | 209 | |
210 | 210 | } |
211 | 211 | endif; |
212 | 212 | |
213 | 213 | // 12 |
214 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
214 | +if (!function_exists('lasso_timeline_component')): |
|
215 | 215 | function lasso_timeline_component() { |
216 | 216 | |
217 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
217 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
218 | 218 | |
219 | 219 | } |
220 | 220 | endif; |
221 | 221 | |
222 | 222 | // 13 |
223 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
223 | +if (!function_exists('lasso_video_component')): |
|
224 | 224 | function lasso_video_component() { |
225 | 225 | |
226 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
226 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | endif; |
230 | 230 | |
231 | 231 | // 14 - since 0.9.1 |
232 | -if ( !function_exists('lasso_wp_image') ): |
|
232 | +if (!function_exists('lasso_wp_image')): |
|
233 | 233 | |
234 | - function lasso_wp_image(){ |
|
234 | + function lasso_wp_image() { |
|
235 | 235 | return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>'; |
236 | 236 | } |
237 | 237 | |
238 | 238 | endif; |
239 | 239 | |
240 | 240 | // 15 - since 0.9.2 |
241 | -if ( !function_exists('lasso_wp_quote') ): |
|
241 | +if (!function_exists('lasso_wp_quote')): |
|
242 | 242 | |
243 | - function lasso_wp_quote(){ |
|
243 | + function lasso_wp_quote() { |
|
244 | 244 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>'; |
245 | 245 | } |
246 | 246 | |
@@ -248,31 +248,31 @@ discard block |
||
248 | 248 | |
249 | 249 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
250 | 250 | |
251 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
251 | +if (!function_exists('lasso_gallery_pop_component')): |
|
252 | 252 | function lasso_gallery_pop_component() { |
253 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
253 | + return do_shortcode('[aesop_gallery_pop]'); |
|
254 | 254 | } |
255 | 255 | endif; |
256 | 256 | |
257 | 257 | // 17 - work in progress |
258 | 258 | |
259 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
259 | +if (!function_exists('lasso_event_component')): |
|
260 | 260 | function lasso_event_component() { |
261 | 261 | $id = editus_get_one_id('aesop_events'); |
262 | 262 | file_put_contents(WP_PLUGIN_DIR."/file1.txt", $id); |
263 | - return do_shortcode( '[aesop_events id = "993"]' ); |
|
264 | - if ($id ==-1) { |
|
265 | - return do_shortcode( '[aesop_events]' ); |
|
263 | + return do_shortcode('[aesop_events id = "993"]'); |
|
264 | + if ($id == -1) { |
|
265 | + return do_shortcode('[aesop_events]'); |
|
266 | 266 | } else { |
267 | - return do_shortcode( '[aesop_events id = "'.$id.'"]' ); |
|
267 | + return do_shortcode('[aesop_events id = "'.$id.'"]'); |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | endif; |
271 | 271 | |
272 | 272 | // 18 - work in progress |
273 | -if ( !function_exists('lasso_wp_video') ): |
|
273 | +if (!function_exists('lasso_wp_video')): |
|
274 | 274 | |
275 | - function lasso_wp_video(){ |
|
275 | + function lasso_wp_video() { |
|
276 | 276 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
277 | 277 | } |
278 | 278 | |
@@ -281,10 +281,10 @@ discard block |
||
281 | 281 | // helper function to retrieve one id for default option |
282 | 282 | function editus_get_one_id($type) |
283 | 283 | { |
284 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
285 | - $posts = get_posts( $args ); |
|
286 | - if ( $posts ) { |
|
287 | - foreach ( $posts as $post ) { |
|
284 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
285 | + $posts = get_posts($args); |
|
286 | + if ($posts) { |
|
287 | + foreach ($posts as $post) { |
|
288 | 288 | return $post->ID; |
289 | 289 | } |
290 | 290 | } |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
260 | 260 | } |
261 | 261 | |
262 | - // new ajax function to lock post for editing |
|
262 | + // new ajax function to lock post for editing |
|
263 | 263 | public function editus_lock_post() |
264 | 264 | { |
265 | 265 | $post_id= $_POST["postid"]; |
266 | 266 | $locked = wp_check_post_lock($post_id); |
267 | 267 | |
268 | 268 | if (!$locked) { |
269 | - wp_set_post_lock($post_id); |
|
269 | + wp_set_post_lock($post_id); |
|
270 | 270 | echo "true"; |
271 | 271 | } else { |
272 | 272 | $user_info = get_userdata($locked); |
@@ -309,59 +309,59 @@ discard block |
||
309 | 309 | ); |
310 | 310 | foreach ($_POST as $key => $value) { |
311 | 311 | if ($key !="code" && $key !="action") { |
312 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
312 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
313 | 313 | $atts[$key] = $value; |
314 | 314 | } |
315 | 315 | } |
316 | 316 | if ($code == "aesop_video") { |
317 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | - echo aesop_video_shortcode($atts); |
|
317 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | + echo aesop_video_shortcode($atts); |
|
319 | 319 | } |
320 | 320 | else if ($code == "aesop_image") { |
321 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | - echo aesop_image_shortcode($atts); |
|
321 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | + echo aesop_image_shortcode($atts); |
|
323 | 323 | } |
324 | 324 | else if ($code == "aesop_quote") { |
325 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | - echo aesop_quote_shortcode($atts); |
|
325 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | + echo aesop_quote_shortcode($atts); |
|
327 | 327 | } |
328 | 328 | else if ($code == "aesop_parallax") { |
329 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | - echo aesop_parallax_shortcode($atts); |
|
329 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | + echo aesop_parallax_shortcode($atts); |
|
331 | 331 | } |
332 | 332 | else if ($code == "aesop_character") { |
333 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | - echo aesop_character_shortcode($atts); |
|
333 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | + echo aesop_character_shortcode($atts); |
|
335 | 335 | } |
336 | 336 | else if ($code == "aesop_collection") { |
337 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | - echo aesop_collection_shortcode($atts); |
|
337 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | + echo aesop_collection_shortcode($atts); |
|
339 | 339 | } |
340 | 340 | else if ($code == "aesop_chapter") { |
341 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | - echo aesop_chapter_shortcode($atts); |
|
341 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | + echo aesop_chapter_shortcode($atts); |
|
343 | 343 | } |
344 | 344 | else if ($code == "aesop_content") { |
345 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
345 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
347 | 347 | } |
348 | 348 | else if ($code == "aesop_gallery") { |
349 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
349 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
351 | 351 | } |
352 | 352 | else if ($code == "aesop_audio") { |
353 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | - echo aesop_audio_shortcode($atts); |
|
353 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | + echo aesop_audio_shortcode($atts); |
|
355 | 355 | } |
356 | 356 | else { |
357 | 357 | $code = '['.$code.' '; |
358 | 358 | foreach ($atts as $key => $value) { |
359 | - $code = ''.$key.'="'.$value.'" '; |
|
359 | + $code = ''.$key.'="'.$value.'" '; |
|
360 | 360 | } |
361 | 361 | $code = $code.']'; |
362 | 362 | echo do_shortcode($code); |
363 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
364 | - //echo aesop_audio_shortcode($atts); |
|
363 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
364 | + //echo aesop_audio_shortcode($atts); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | exit; |
@@ -52,14 +52,14 @@ 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_lock_post', array( $this, 'editus_lock_post' ) ); |
|
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_lock_post', array($this, 'editus_lock_post')); |
|
63 | 63 | |
64 | 64 | // enable saving custom fields through REST API |
65 | 65 | self::enable_metasave('post'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public static function get_instance() { |
91 | 91 | |
92 | 92 | // If the single instance hasn't been set, set it now. |
93 | - if ( null == self::$instance ) { |
|
93 | + if (null == self::$instance) { |
|
94 | 94 | self::$instance = new self; |
95 | 95 | } |
96 | 96 | |
@@ -107,18 +107,18 @@ discard block |
||
107 | 107 | * WPMU is disabled or plugin is |
108 | 108 | * activated on an individual blog. |
109 | 109 | */ |
110 | - public static function activate( $network_wide ) { |
|
110 | + public static function activate($network_wide) { |
|
111 | 111 | |
112 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
112 | + if (function_exists('is_multisite') && is_multisite()) { |
|
113 | 113 | |
114 | - if ( $network_wide ) { |
|
114 | + if ($network_wide) { |
|
115 | 115 | |
116 | 116 | // Get all blog ids |
117 | 117 | $blog_ids = self::get_blog_ids(); |
118 | 118 | |
119 | - foreach ( $blog_ids as $blog_id ) { |
|
119 | + foreach ($blog_ids as $blog_id) { |
|
120 | 120 | |
121 | - switch_to_blog( $blog_id ); |
|
121 | + switch_to_blog($blog_id); |
|
122 | 122 | self::single_activate(); |
123 | 123 | } |
124 | 124 | |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | * WPMU is disabled or plugin is |
145 | 145 | * deactivated on an individual blog. |
146 | 146 | */ |
147 | - public static function deactivate( $network_wide ) { |
|
147 | + public static function deactivate($network_wide) { |
|
148 | 148 | |
149 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
149 | + if (function_exists('is_multisite') && is_multisite()) { |
|
150 | 150 | |
151 | - if ( $network_wide ) { |
|
151 | + if ($network_wide) { |
|
152 | 152 | |
153 | 153 | // Get all blog ids |
154 | 154 | $blog_ids = self::get_blog_ids(); |
155 | 155 | |
156 | - foreach ( $blog_ids as $blog_id ) { |
|
156 | + foreach ($blog_ids as $blog_id) { |
|
157 | 157 | |
158 | - switch_to_blog( $blog_id ); |
|
158 | + switch_to_blog($blog_id); |
|
159 | 159 | self::single_deactivate(); |
160 | 160 | |
161 | 161 | } |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @param int $blog_id ID of the new blog. |
181 | 181 | */ |
182 | - public function activate_new_site( $blog_id ) { |
|
182 | + public function activate_new_site($blog_id) { |
|
183 | 183 | |
184 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
184 | + if (1 !== did_action('wpmu_new_blog')) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - switch_to_blog( $blog_id ); |
|
188 | + switch_to_blog($blog_id); |
|
189 | 189 | self::single_activate(); |
190 | 190 | restore_current_blog(); |
191 | 191 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | WHERE archived = '0' AND spam = '0' |
211 | 211 | AND deleted = '0'"; |
212 | 212 | |
213 | - return $wpdb->get_col( $sql ); |
|
213 | + return $wpdb->get_col($sql); |
|
214 | 214 | |
215 | 215 | } |
216 | 216 | |
@@ -221,18 +221,18 @@ discard block |
||
221 | 221 | */ |
222 | 222 | private static function single_activate() { |
223 | 223 | |
224 | - $curr_version = get_option( 'lasso_version' ); |
|
224 | + $curr_version = get_option('lasso_version'); |
|
225 | 225 | |
226 | 226 | // update upgraded from |
227 | - if ( $curr_version ) { |
|
228 | - update_option( 'lasso_updated_from', $curr_version ); |
|
227 | + if ($curr_version) { |
|
228 | + update_option('lasso_updated_from', $curr_version); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // update lasso version option |
232 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
232 | + update_option('lasso_version', LASSO_VERSION); |
|
233 | 233 | |
234 | 234 | // set transietn for activation welcome |
235 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
235 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
236 | 236 | |
237 | 237 | |
238 | 238 | } |
@@ -254,15 +254,15 @@ discard block |
||
254 | 254 | public function load_plugin_textdomain() { |
255 | 255 | |
256 | 256 | $domain = $this->plugin_slug; |
257 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
257 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
258 | 258 | |
259 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
259 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | // new ajax function to lock post for editing |
263 | 263 | public function editus_lock_post() |
264 | 264 | { |
265 | - $post_id= $_POST["postid"]; |
|
265 | + $post_id = $_POST["postid"]; |
|
266 | 266 | $locked = wp_check_post_lock($post_id); |
267 | 267 | |
268 | 268 | if (!$locked) { |
@@ -270,18 +270,18 @@ discard block |
||
270 | 270 | echo "true"; |
271 | 271 | } else { |
272 | 272 | $user_info = get_userdata($locked); |
273 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
273 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
274 | 274 | } |
275 | 275 | exit; |
276 | 276 | } |
277 | 277 | |
278 | 278 | public static function enable_metasave($type) |
279 | 279 | { |
280 | - register_rest_field( $type, 'metadata', array( |
|
281 | - 'get_callback' => function ( $data ) { |
|
282 | - return get_post_meta( $data['id']);//, '', '' ); |
|
280 | + register_rest_field($type, 'metadata', array( |
|
281 | + 'get_callback' => function($data) { |
|
282 | + return get_post_meta($data['id']); //, '', '' ); |
|
283 | 283 | }, |
284 | - 'update_callback' => function( $data, $post ) { |
|
284 | + 'update_callback' => function($data, $post) { |
|
285 | 285 | foreach ($data as $key => $value) { |
286 | 286 | update_post_meta($post->ID, $key, $value); |
287 | 287 | } |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | public function editus_do_shortcode() |
294 | 294 | { |
295 | 295 | |
296 | - $code= $_POST["code"]; |
|
296 | + $code = $_POST["code"]; |
|
297 | 297 | file_put_contents(WP_PLUGIN_DIR."/file10.txt", $code); |
298 | - $out = lasso_wrap_shortcodes( $code); |
|
298 | + $out = lasso_wrap_shortcodes($code); |
|
299 | 299 | echo do_shortcode($out); |
300 | 300 | exit; |
301 | 301 | } |
@@ -304,53 +304,53 @@ discard block |
||
304 | 304 | { |
305 | 305 | |
306 | 306 | |
307 | - $code= $_POST["code"]; |
|
307 | + $code = $_POST["code"]; |
|
308 | 308 | $atts = array( |
309 | 309 | ); |
310 | 310 | foreach ($_POST as $key => $value) { |
311 | - if ($key !="code" && $key !="action") { |
|
311 | + if ($key != "code" && $key != "action") { |
|
312 | 312 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
313 | 313 | $atts[$key] = $value; |
314 | 314 | } |
315 | 315 | } |
316 | 316 | if ($code == "aesop_video") { |
317 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
317 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | 318 | echo aesop_video_shortcode($atts); |
319 | 319 | } |
320 | 320 | else if ($code == "aesop_image") { |
321 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
321 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | 322 | echo aesop_image_shortcode($atts); |
323 | 323 | } |
324 | 324 | else if ($code == "aesop_quote") { |
325 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
325 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | 326 | echo aesop_quote_shortcode($atts); |
327 | 327 | } |
328 | 328 | else if ($code == "aesop_parallax") { |
329 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
329 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | 330 | echo aesop_parallax_shortcode($atts); |
331 | 331 | } |
332 | 332 | else if ($code == "aesop_character") { |
333 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
333 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | 334 | echo aesop_character_shortcode($atts); |
335 | 335 | } |
336 | 336 | else if ($code == "aesop_collection") { |
337 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
337 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | 338 | echo aesop_collection_shortcode($atts); |
339 | 339 | } |
340 | 340 | else if ($code == "aesop_chapter") { |
341 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
341 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | 342 | echo aesop_chapter_shortcode($atts); |
343 | 343 | } |
344 | 344 | else if ($code == "aesop_content") { |
345 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
345 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | 346 | echo aesop_content_shortcode($atts, $atts['content_data']); |
347 | 347 | } |
348 | 348 | else if ($code == "aesop_gallery") { |
349 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
349 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
350 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
351 | 351 | } |
352 | 352 | else if ($code == "aesop_audio") { |
353 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
353 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | 354 | echo aesop_audio_shortcode($atts); |
355 | 355 | } |
356 | 356 | else { |
@@ -316,44 +316,34 @@ |
||
316 | 316 | if ($code == "aesop_video") { |
317 | 317 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
318 | 318 | echo aesop_video_shortcode($atts); |
319 | - } |
|
320 | - else if ($code == "aesop_image") { |
|
319 | + } else if ($code == "aesop_image") { |
|
321 | 320 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
322 | 321 | echo aesop_image_shortcode($atts); |
323 | - } |
|
324 | - else if ($code == "aesop_quote") { |
|
322 | + } else if ($code == "aesop_quote") { |
|
325 | 323 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
326 | 324 | echo aesop_quote_shortcode($atts); |
327 | - } |
|
328 | - else if ($code == "aesop_parallax") { |
|
325 | + } else if ($code == "aesop_parallax") { |
|
329 | 326 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
330 | 327 | echo aesop_parallax_shortcode($atts); |
331 | - } |
|
332 | - else if ($code == "aesop_character") { |
|
328 | + } else if ($code == "aesop_character") { |
|
333 | 329 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
334 | 330 | echo aesop_character_shortcode($atts); |
335 | - } |
|
336 | - else if ($code == "aesop_collection") { |
|
331 | + } else if ($code == "aesop_collection") { |
|
337 | 332 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
338 | 333 | echo aesop_collection_shortcode($atts); |
339 | - } |
|
340 | - else if ($code == "aesop_chapter") { |
|
334 | + } else if ($code == "aesop_chapter") { |
|
341 | 335 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
342 | 336 | echo aesop_chapter_shortcode($atts); |
343 | - } |
|
344 | - else if ($code == "aesop_content") { |
|
337 | + } else if ($code == "aesop_content") { |
|
345 | 338 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
346 | 339 | echo aesop_content_shortcode($atts, $atts['content_data']); |
347 | - } |
|
348 | - else if ($code == "aesop_gallery") { |
|
340 | + } else if ($code == "aesop_gallery") { |
|
349 | 341 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
350 | 342 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
351 | - } |
|
352 | - else if ($code == "aesop_audio") { |
|
343 | + } else if ($code == "aesop_audio") { |
|
353 | 344 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
354 | 345 | echo aesop_audio_shortcode($atts); |
355 | - } |
|
356 | - else { |
|
346 | + } else { |
|
357 | 347 | $code = '['.$code.' '; |
358 | 348 | foreach ($atts as $key => $value) { |
359 | 349 | $code = ''.$key.'="'.$value.'" '; |
@@ -12,32 +12,32 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
15 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
16 | 16 | function lasso_editor_controls() { |
17 | 17 | |
18 | 18 | global $post; |
19 | 19 | |
20 | - if ( lasso_user_can('edit_posts') ) { |
|
20 | + if (lasso_user_can('edit_posts')) { |
|
21 | 21 | |
22 | - $status = get_post_status( get_the_ID() ); |
|
22 | + $status = get_post_status(get_the_ID()); |
|
23 | 23 | |
24 | 24 | // let users add custom css classes |
25 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
25 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
26 | 26 | |
27 | 27 | $post_access_class = ''; |
28 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
29 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
30 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
28 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
29 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
30 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | // CSS class if adding new post objects is disabled |
34 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
34 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
35 | 35 | |
36 | 36 | // CSS class if adjust settings is disabled |
37 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
37 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
38 | 38 | |
39 | 39 | // CSS class if adding new post objects AND settings are disabled |
40 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
40 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
43 | 43 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -49,44 +49,44 @@ discard block |
||
49 | 49 | $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
50 | 50 | |
51 | 51 | |
52 | - ?><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();?>" > |
|
52 | + ?><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(); ?>" > |
|
53 | 53 | |
54 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
54 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
55 | 55 | |
56 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
56 | + <?php do_action('lasso_editor_controls_before'); |
|
57 | 57 | |
58 | - if ( $is_capable ) { ?> |
|
58 | + if ($is_capable) { ?> |
|
59 | 59 | |
60 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
60 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
61 | 61 | |
62 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
63 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
62 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
63 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
64 | 64 | <?php } |
65 | 65 | |
66 | 66 | } ?> |
67 | 67 | |
68 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
68 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
69 | 69 | |
70 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
71 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
70 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
71 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
72 | 72 | <?php } ?> |
73 | 73 | |
74 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?> |
|
75 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
74 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?> |
|
75 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
76 | 76 | <?php } ?> |
77 | 77 | |
78 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
78 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
79 | 79 | |
80 | 80 | </ul> |
81 | 81 | |
82 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
82 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
83 | 83 | |
84 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
84 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
85 | 85 | |
86 | - <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> |
|
86 | + <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> |
|
87 | 87 | |
88 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
89 | - <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> |
|
88 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
89 | + <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> |
|
90 | 90 | <?php } ?> |
91 | 91 | |
92 | 92 | </div> |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | |
110 | 110 | ob_start(); |
111 | 111 | |
112 | - if ( !lasso_user_can() ) |
|
112 | + if (!lasso_user_can()) |
|
113 | 113 | return; |
114 | 114 | |
115 | 115 | // let users add custom css classes |
116 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
116 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
117 | 117 | ?> |
118 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
118 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
119 | 119 | <div class="lasso--sidebar__inner"> |
120 | 120 | <div id="lasso--component__settings"></div> |
121 | 121 | </div> |
@@ -133,26 +133,26 @@ discard block |
||
133 | 133 | |
134 | 134 | ob_start(); |
135 | 135 | |
136 | - if ( !lasso_user_can() ) |
|
136 | + if (!lasso_user_can()) |
|
137 | 137 | return; |
138 | 138 | |
139 | 139 | $is_mobile = wp_is_mobile(); |
140 | 140 | |
141 | 141 | // check for lasso story engine and add a class doniting this |
142 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
142 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
143 | 143 | |
144 | 144 | // let users add custom css classes |
145 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
145 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
146 | 146 | |
147 | 147 | // are toolbar headings enabled |
148 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
149 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
148 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
149 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
150 | 150 | |
151 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
151 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
152 | 152 | |
153 | 153 | // mobile styles |
154 | 154 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
155 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
155 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
156 | 156 | |
157 | 157 | //show color |
158 | 158 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -160,102 +160,102 @@ discard block |
||
160 | 160 | //show alignment |
161 | 161 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
162 | 162 | |
163 | - $status = get_post_status( get_the_ID() ); |
|
163 | + $status = get_post_status(get_the_ID()); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | ?> |
167 | - <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 ?>> |
|
168 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
169 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
170 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
171 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
172 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
173 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
174 | - <?php if ( $toolbar_headings ): ?> |
|
175 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
176 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
167 | + <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 ?>> |
|
168 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
169 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
170 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
171 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
172 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
173 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
174 | + <?php if ($toolbar_headings): ?> |
|
175 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
176 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
177 | 177 | <?php endif; ?> |
178 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
179 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
180 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
181 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
178 | + <?php if ($toolbar_headings_h4): ?> |
|
179 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
180 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
181 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
182 | 182 | <?php endif; ?> |
183 | 183 | |
184 | - <?php if ( $show_color ): ?> |
|
185 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li> |
|
186 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
184 | + <?php if ($show_color): ?> |
|
185 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li> |
|
186 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
187 | 187 | <?php endif; ?> |
188 | 188 | |
189 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>"> |
|
189 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>"> |
|
190 | 190 | <ul id="lasso-toolbar--components__list" style="display:none;"> |
191 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
192 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
193 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
194 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
195 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
196 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
197 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
198 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
199 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
200 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
201 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
202 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
203 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
204 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
205 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
206 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
191 | + <?php if ('ase-active' == $ase_status): ?> |
|
192 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
193 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
194 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
195 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
196 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
197 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
198 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
199 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
200 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
201 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
202 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
203 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
204 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
205 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
206 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
207 | 207 | <?php }?> |
208 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
209 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
208 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
209 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
210 | 210 | <?php }?> |
211 | 211 | <?php else: ?> |
212 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
213 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
214 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
212 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
213 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
214 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
215 | 215 | <?php endif; ?> |
216 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
216 | + <?php do_action('lasso_toolbar_components'); ?> |
|
217 | 217 | </ul> |
218 | 218 | </li> |
219 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
219 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
220 | 220 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
221 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
222 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
221 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
222 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
223 | 223 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
224 | 224 | <label for="aesop-toolbar--link_newtab">Open in Another Tab</label> |
225 | 225 | </div> |
226 | 226 | </li> |
227 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
228 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>"> |
|
227 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
228 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>"> |
|
229 | 229 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
230 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
230 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
231 | 231 | <div id="lasso-toolbar--html__footer"> |
232 | 232 | <ul class="lasso-toolbar--html-snips"> |
233 | - <?php if ( !$toolbar_headings ): ?> |
|
234 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
235 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
233 | + <?php if (!$toolbar_headings): ?> |
|
234 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
235 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
236 | 236 | <?php endif; ?> |
237 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
238 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
237 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
238 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
239 | 239 | </ul> |
240 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
241 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
240 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
241 | + <a href="#" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
242 | 242 | </div> |
243 | 243 | </div> |
244 | 244 | </li> |
245 | - <?php if ( $show_align ): ?> |
|
246 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
247 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
248 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
245 | + <?php if ($show_align): ?> |
|
246 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
247 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
248 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
249 | 249 | <?php endif; ?> |
250 | 250 | </ul> |
251 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
251 | + <?php if (is_singular() && $is_mobile) { ?> |
|
252 | 252 | |
253 | - <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;"> |
|
253 | + <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;"> |
|
254 | 254 | |
255 | - <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> |
|
255 | + <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> |
|
256 | 256 | |
257 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
258 | - <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> |
|
257 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
258 | + <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> |
|
259 | 259 | <?php } ?> |
260 | 260 | |
261 | 261 | </div> |
@@ -273,22 +273,22 @@ discard block |
||
273 | 273 | */ |
274 | 274 | function lasso_editor_settings_toolbar() { |
275 | 275 | |
276 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
276 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
277 | 277 | |
278 | 278 | ob_start(); |
279 | 279 | |
280 | - if ( !lasso_user_can() ) |
|
280 | + if (!lasso_user_can()) |
|
281 | 281 | return; |
282 | 282 | |
283 | 283 | // let users add custom css classes |
284 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
284 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
285 | 285 | |
286 | 286 | ?> |
287 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
288 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
289 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
290 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
291 | - <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> |
|
287 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
288 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
289 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
290 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
291 | + <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> |
|
292 | 292 | </ul> |
293 | 293 | |
294 | 294 | <?php return ob_get_clean(); |
@@ -304,17 +304,17 @@ discard block |
||
304 | 304 | |
305 | 305 | ob_start(); |
306 | 306 | |
307 | - if ( !lasso_user_can() ) |
|
307 | + if (!lasso_user_can()) |
|
308 | 308 | return; |
309 | 309 | |
310 | 310 | // has post thumbnail |
311 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
311 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
312 | 312 | |
313 | 313 | ?> |
314 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
315 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
316 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
317 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
314 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
315 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
316 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
317 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
318 | 318 | </ul> |
319 | 319 | |
320 | 320 | <?php return ob_get_clean(); |
@@ -333,55 +333,55 @@ discard block |
||
333 | 333 | |
334 | 334 | ob_start(); |
335 | 335 | |
336 | - if ( !lasso_user_can() ) |
|
336 | + if (!lasso_user_can()) |
|
337 | 337 | return; |
338 | 338 | |
339 | 339 | global $post; |
340 | 340 | |
341 | 341 | $postid = get_the_ID(); |
342 | 342 | |
343 | - $status = get_post_status( $postid ); |
|
344 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
343 | + $status = get_post_status($postid); |
|
344 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
345 | 345 | |
346 | 346 | // let users add custom css classes |
347 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
347 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
348 | 348 | |
349 | 349 | // objects categories |
350 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
351 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
350 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
351 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
352 | 352 | |
353 | 353 | // modal tabs |
354 | - $tabs = lasso_modal_addons('tab'); |
|
355 | - $content = lasso_modal_addons('content'); |
|
354 | + $tabs = lasso_modal_addons('tab'); |
|
355 | + $content = lasso_modal_addons('content'); |
|
356 | 356 | |
357 | 357 | // are we singular |
358 | - $is_singular = is_singular(); |
|
358 | + $is_singular = is_singular(); |
|
359 | 359 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
360 | 360 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
361 | 361 | $theme_supports = current_theme_supports('post-thumbnails'); |
362 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
362 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
363 | 363 | |
364 | 364 | ?> |
365 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
365 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
366 | 366 | <div class="lasso--modal__inner"> |
367 | 367 | |
368 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
368 | + <?php if ($tabs) { echo $tabs; } ?> |
|
369 | 369 | |
370 | 370 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
371 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
371 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
372 | 372 | |
373 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
373 | + <?php if ($is_singular && $theme_supports) : ?> |
|
374 | 374 | <div class="lasso--postsettings__left"> |
375 | - <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> |
|
376 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
375 | + <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> |
|
376 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
377 | 377 | |
378 | 378 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
379 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
380 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
379 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
380 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
381 | 381 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
382 | 382 | </div> |
383 | 383 | |
384 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
384 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
385 | 385 | |
386 | 386 | </div> |
387 | 387 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -391,12 +391,12 @@ discard block |
||
391 | 391 | |
392 | 392 | <div class="lasso--postsettings__right"> |
393 | 393 | |
394 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
394 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
395 | 395 | <div class="lasso--postsettings__option story-status-option"> |
396 | - <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> |
|
397 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
398 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
399 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
396 | + <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> |
|
397 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
398 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
399 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
400 | 400 | </ul> |
401 | 401 | <div class="lasso--slider_wrap"> |
402 | 402 | <div id="lasso--slider"></div> |
@@ -404,10 +404,10 @@ discard block |
||
404 | 404 | </div> |
405 | 405 | <?php endif; ?> |
406 | 406 | |
407 | - <?php if ( 'publish' == $status ): ?> |
|
407 | + <?php if ('publish' == $status): ?> |
|
408 | 408 | <div class="lasso--postsettings__option story-slug-option"> |
409 | - <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> |
|
410 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
409 | + <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> |
|
410 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
411 | 411 | </div> |
412 | 412 | <?php endif; ?> |
413 | 413 | |
@@ -416,13 +416,13 @@ discard block |
||
416 | 416 | <div class="lasso--postsettings__middle"> |
417 | 417 | |
418 | 418 | <div class="lasso--postsettings__option story-categories-option"> |
419 | - <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> |
|
420 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
419 | + <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> |
|
420 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
421 | 421 | </div> |
422 | 422 | |
423 | 423 | <div class="lasso--postsettings__option story-tags-option"> |
424 | - <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> |
|
425 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
424 | + <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> |
|
425 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
426 | 426 | </div> |
427 | 427 | |
428 | 428 | </div> |
@@ -443,23 +443,23 @@ discard block |
||
443 | 443 | ?> |
444 | 444 | <!--/div--> |
445 | 445 | |
446 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
446 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
447 | 447 | |
448 | 448 | <div class="lasso--postsettings__footer" > |
449 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
449 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
450 | 450 | <input type="hidden" name="status" value=""> |
451 | 451 | <input type="hidden" name="categories" value=""> |
452 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
452 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
453 | 453 | <input type="hidden" name="action" value="process_update-object_post"> |
454 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
455 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
456 | - <input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
454 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
455 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
456 | + <input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
457 | 457 | </div> |
458 | 458 | |
459 | 459 | </form> |
460 | 460 | </div> |
461 | 461 | |
462 | - <?php if( $tabs ) { echo $content; } ?> |
|
462 | + <?php if ($tabs) { echo $content; } ?> |
|
463 | 463 | |
464 | 464 | </div> |
465 | 465 | |
@@ -480,45 +480,45 @@ discard block |
||
480 | 480 | |
481 | 481 | ob_start(); |
482 | 482 | |
483 | - if ( !lasso_user_can('edit_posts') ) |
|
483 | + if (!lasso_user_can('edit_posts')) |
|
484 | 484 | return; |
485 | 485 | |
486 | - $status = get_post_status( get_the_ID() ); |
|
486 | + $status = get_post_status(get_the_ID()); |
|
487 | 487 | |
488 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
488 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
489 | 489 | |
490 | 490 | // let users add custom css classes |
491 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
491 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
492 | 492 | |
493 | 493 | // return the post type |
494 | - $type = get_post_type( get_the_ID() ); |
|
494 | + $type = get_post_type(get_the_ID()); |
|
495 | 495 | |
496 | 496 | $mobile_style = ""; |
497 | 497 | if (wp_is_mobile()) { |
498 | 498 | $mobile_style = 'style="top:140px !important;"'; |
499 | 499 | } |
500 | 500 | ?> |
501 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
501 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
502 | 502 | <div class="lasso--modal__inner lasso--hasnewform"> |
503 | 503 | |
504 | 504 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
505 | 505 | |
506 | 506 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
507 | - <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> |
|
508 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>"> |
|
507 | + <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> |
|
508 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>"> |
|
509 | 509 | <div class="lasso--select-wrap" style="width:90px"> |
510 | 510 | <select id="lasso--select-type" name="story_type"> |
511 | 511 | |
512 | 512 | <?php |
513 | 513 | $types = lasso_post_types(); |
514 | 514 | |
515 | - if ( !empty( $types ) ) { |
|
515 | + if (!empty($types)) { |
|
516 | 516 | |
517 | - foreach( $types as $type ) { |
|
517 | + foreach ($types as $type) { |
|
518 | 518 | |
519 | - $type = preg_replace( '/s\b/','', $type ); |
|
519 | + $type = preg_replace('/s\b/', '', $type); |
|
520 | 520 | |
521 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) ); |
|
521 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type))); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | } |
@@ -528,12 +528,12 @@ discard block |
||
528 | 528 | </div> |
529 | 529 | </div> |
530 | 530 | |
531 | - <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>"> |
|
532 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
531 | + <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>"> |
|
532 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
533 | 533 | <input type="hidden" name="action" value="process_new-object_post"> |
534 | 534 | <input type="hidden" name="object" value="post"> |
535 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
536 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
535 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
536 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
537 | 537 | </div> |
538 | 538 | |
539 | 539 | </form> |
@@ -561,18 +561,18 @@ discard block |
||
561 | 561 | ob_start(); |
562 | 562 | |
563 | 563 | // post status |
564 | - $status = get_post_status( get_the_ID() ); |
|
564 | + $status = get_post_status(get_the_ID()); |
|
565 | 565 | |
566 | 566 | // let users add custom css classes |
567 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
567 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
568 | 568 | |
569 | 569 | ?> |
570 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
570 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
571 | 571 | <div class="lasso--modal__inner"> |
572 | 572 | |
573 | 573 | <div class="lasso--post-filtering not-visible"> |
574 | 574 | <div class="lasso--search__results"> |
575 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
575 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
576 | 576 | </div> |
577 | 577 | <div class="lasso--search"> |
578 | 578 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | $post_types = lasso_post_types_names(); |
587 | 587 | $rest_bases = lasso_post_types_rest_base(); |
588 | 588 | |
589 | - if ( ! empty( $post_types ) ) { |
|
589 | + if (!empty($post_types)) { |
|
590 | 590 | $first = 'active'; |
591 | - foreach( $post_types as $name => $label ) { |
|
592 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
591 | + foreach ($post_types as $name => $label) { |
|
592 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
593 | 593 | $first = ''; |
594 | 594 | } |
595 | 595 | |
596 | 596 | } |
597 | 597 | |
598 | - do_action('lasso_modal_post_objects');?> |
|
598 | + do_action('lasso_modal_post_objects'); ?> |
|
599 | 599 | |
600 | 600 | </ul> |
601 | 601 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -613,18 +613,18 @@ discard block |
||
613 | 613 | |
614 | 614 | ob_start(); |
615 | 615 | |
616 | - if ( !lasso_user_can() ) |
|
616 | + if (!lasso_user_can()) |
|
617 | 617 | return; |
618 | 618 | |
619 | 619 | // let users add custom css classes |
620 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
620 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
621 | 621 | |
622 | 622 | ?> |
623 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
624 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
625 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
626 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
627 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
623 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
624 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
625 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
626 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
627 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
628 | 628 | </ul> |
629 | 629 | |
630 | 630 | <?php return ob_get_clean(); |
@@ -634,18 +634,18 @@ discard block |
||
634 | 634 | |
635 | 635 | ob_start(); |
636 | 636 | |
637 | - if ( !lasso_user_can() ) |
|
637 | + if (!lasso_user_can()) |
|
638 | 638 | return; |
639 | 639 | |
640 | 640 | // let users add custom css classes |
641 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
641 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
642 | 642 | |
643 | 643 | ?> |
644 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
645 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
646 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
647 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
648 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
644 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
645 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
646 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
647 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
648 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
649 | 649 | </ul> |
650 | 650 | |
651 | 651 | <?php return ob_get_clean(); |
@@ -658,16 +658,16 @@ discard block |
||
658 | 658 | */ |
659 | 659 | function lasso_map_form_footer() { |
660 | 660 | |
661 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
661 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
662 | 662 | |
663 | 663 | ob_start(); |
664 | 664 | |
665 | 665 | ?> |
666 | 666 | <div class="lasso--map-form__footer"> |
667 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
668 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
667 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
668 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
669 | 669 | <input type="hidden" name="action" value="process_map_save"> |
670 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
670 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
671 | 671 | </div> |
672 | 672 | |
673 | 673 | <?php return ob_get_clean(); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | |
686 | 686 | ?> |
687 | 687 | <div id="lasso--pagerefresh" class="visible"> |
688 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
688 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
689 | 689 | </div> |
690 | 690 | |
691 | 691 | <?php return ob_get_clean(); |
@@ -699,43 +699,43 @@ discard block |
||
699 | 699 | */ |
700 | 700 | function lasso_editor_options_blob() { |
701 | 701 | |
702 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
703 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
702 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
703 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
704 | 704 | |
705 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
705 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
706 | 706 | |
707 | 707 | $blob = array(); |
708 | 708 | |
709 | - if ( empty( $codes ) ) |
|
709 | + if (empty($codes)) |
|
710 | 710 | return; |
711 | 711 | |
712 | - foreach ( $codes as $slug => $shortcode ) { |
|
712 | + foreach ($codes as $slug => $shortcode) { |
|
713 | 713 | $return = ''; |
714 | 714 | // Shortcode has atts |
715 | 715 | |
716 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
716 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
717 | 717 | |
718 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
718 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
719 | 719 | |
720 | 720 | |
721 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
721 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
722 | 722 | |
723 | 723 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
724 | 724 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">'; |
725 | - $return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
725 | + $return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
726 | 726 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
727 | 727 | // Select |
728 | 728 | |
729 | - if ( isset( $attr_info['values'] ) ) { |
|
729 | + if (isset($attr_info['values'])) { |
|
730 | 730 | |
731 | - $return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
731 | + $return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
732 | 732 | |
733 | - $i=0; |
|
733 | + $i = 0; |
|
734 | 734 | |
735 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
735 | + foreach ($attr_info['values'] as $attr_value) { |
|
736 | 736 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
737 | 737 | |
738 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
738 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
739 | 739 | |
740 | 740 | $i++; |
741 | 741 | } |
@@ -744,24 +744,24 @@ discard block |
||
744 | 744 | |
745 | 745 | } else { |
746 | 746 | |
747 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
747 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
748 | 748 | |
749 | 749 | // image upload |
750 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
750 | + if ('media_upload' == $attr_info['type']) { |
|
751 | 751 | |
752 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
752 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
753 | 753 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
754 | 754 | |
755 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
755 | + } elseif ('color' == $attr_info['type']) { |
|
756 | 756 | |
757 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
757 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
758 | 758 | |
759 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
759 | + } elseif ('text_area' == $attr_info['type']) { |
|
760 | 760 | |
761 | - $return .= '<textarea name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
761 | + $return .= '<textarea name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
762 | 762 | |
763 | 763 | } else { |
764 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
764 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
765 | 765 | } |
766 | 766 | } |
767 | 767 | $return .= '</p>'; |
@@ -772,9 +772,9 @@ discard block |
||
772 | 772 | /////////////////////////// |
773 | 773 | // START GALLERY AND MAP FRONT END STUFFS |
774 | 774 | /////////////////////////// |
775 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
775 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
776 | 776 | |
777 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
777 | + if ('gallery' == $shortcode['front_type']) { |
|
778 | 778 | |
779 | 779 | $return .= lasso_gallery_editor_module(); |
780 | 780 | |
@@ -785,13 +785,13 @@ discard block |
||
785 | 785 | /////////////////////////// |
786 | 786 | |
787 | 787 | // Single shortcode (not closed) |
788 | - if ( 'single' == $shortcode['type'] ) { |
|
788 | + if ('single' == $shortcode['type']) { |
|
789 | 789 | |
790 | 790 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
791 | 791 | |
792 | 792 | } else { |
793 | 793 | |
794 | - $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>'; |
|
794 | + $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>'; |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
825 | 825 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
826 | 826 | <i class="lasso-icon lasso-icon-move"></i> |
827 | - <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> |
|
827 | + <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> |
|
828 | 828 | <div class="lasso--slider_wrap"> |
829 | 829 | <div id="lasso--slider"></div> |
830 | 830 | </div> |
@@ -109,8 +109,9 @@ discard block |
||
109 | 109 | |
110 | 110 | ob_start(); |
111 | 111 | |
112 | - if ( !lasso_user_can() ) |
|
113 | - return; |
|
112 | + if ( !lasso_user_can() ) { |
|
113 | + return; |
|
114 | + } |
|
114 | 115 | |
115 | 116 | // let users add custom css classes |
116 | 117 | $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
@@ -133,8 +134,9 @@ discard block |
||
133 | 134 | |
134 | 135 | ob_start(); |
135 | 136 | |
136 | - if ( !lasso_user_can() ) |
|
137 | - return; |
|
137 | + if ( !lasso_user_can() ) { |
|
138 | + return; |
|
139 | + } |
|
138 | 140 | |
139 | 141 | $is_mobile = wp_is_mobile(); |
140 | 142 | |
@@ -208,8 +210,11 @@ discard block |
||
208 | 210 | <?php if ( class_exists ('Aesop_Events') ) { ?> |
209 | 211 | <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
210 | 212 | <?php }?> |
211 | - <?php else: ?> |
|
212 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
213 | + <?php else { |
|
214 | + : ?> |
|
215 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
216 | +} |
|
217 | +?>" class="image lasso-toolbar--component__image"></li> |
|
213 | 218 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
214 | 219 | <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
215 | 220 | <?php endif; ?> |
@@ -277,8 +282,9 @@ discard block |
||
277 | 282 | |
278 | 283 | ob_start(); |
279 | 284 | |
280 | - if ( !lasso_user_can() ) |
|
281 | - return; |
|
285 | + if ( !lasso_user_can() ) { |
|
286 | + return; |
|
287 | + } |
|
282 | 288 | |
283 | 289 | // let users add custom css classes |
284 | 290 | $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
@@ -304,8 +310,9 @@ discard block |
||
304 | 310 | |
305 | 311 | ob_start(); |
306 | 312 | |
307 | - if ( !lasso_user_can() ) |
|
308 | - return; |
|
313 | + if ( !lasso_user_can() ) { |
|
314 | + return; |
|
315 | + } |
|
309 | 316 | |
310 | 317 | // has post thumbnail |
311 | 318 | $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
@@ -333,8 +340,9 @@ discard block |
||
333 | 340 | |
334 | 341 | ob_start(); |
335 | 342 | |
336 | - if ( !lasso_user_can() ) |
|
337 | - return; |
|
343 | + if ( !lasso_user_can() ) { |
|
344 | + return; |
|
345 | + } |
|
338 | 346 | |
339 | 347 | global $post; |
340 | 348 | |
@@ -480,8 +488,9 @@ discard block |
||
480 | 488 | |
481 | 489 | ob_start(); |
482 | 490 | |
483 | - if ( !lasso_user_can('edit_posts') ) |
|
484 | - return; |
|
491 | + if ( !lasso_user_can('edit_posts') ) { |
|
492 | + return; |
|
493 | + } |
|
485 | 494 | |
486 | 495 | $status = get_post_status( get_the_ID() ); |
487 | 496 | |
@@ -613,8 +622,9 @@ discard block |
||
613 | 622 | |
614 | 623 | ob_start(); |
615 | 624 | |
616 | - if ( !lasso_user_can() ) |
|
617 | - return; |
|
625 | + if ( !lasso_user_can() ) { |
|
626 | + return; |
|
627 | + } |
|
618 | 628 | |
619 | 629 | // let users add custom css classes |
620 | 630 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -634,8 +644,9 @@ discard block |
||
634 | 644 | |
635 | 645 | ob_start(); |
636 | 646 | |
637 | - if ( !lasso_user_can() ) |
|
638 | - return; |
|
647 | + if ( !lasso_user_can() ) { |
|
648 | + return; |
|
649 | + } |
|
639 | 650 | |
640 | 651 | // let users add custom css classes |
641 | 652 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -706,8 +717,9 @@ discard block |
||
706 | 717 | |
707 | 718 | $blob = array(); |
708 | 719 | |
709 | - if ( empty( $codes ) ) |
|
710 | - return; |
|
720 | + if ( empty( $codes ) ) { |
|
721 | + return; |
|
722 | + } |
|
711 | 723 | |
712 | 724 | foreach ( $codes as $slug => $shortcode ) { |
713 | 725 | $return = ''; |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | |
11 | 11 | class assets { |
12 | 12 | |
13 | - public function __construct(){ |
|
13 | + public function __construct() { |
|
14 | 14 | |
15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function scripts(){ |
|
18 | + public function scripts() { |
|
19 | 19 | |
20 | 20 | |
21 | - if ( lasso_user_can('edit_posts')) { |
|
21 | + if (lasso_user_can('edit_posts')) { |
|
22 | 22 | |
23 | 23 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
24 | 24 | |
@@ -33,26 +33,26 @@ discard block |
||
33 | 33 | // url for json api |
34 | 34 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
35 | 35 | |
36 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
36 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
37 | 37 | |
38 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
38 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
39 | 39 | |
40 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
41 | - if (empty( $featImgClass )) { |
|
40 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
41 | + if (empty($featImgClass)) { |
|
42 | 42 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
43 | 43 | } |
44 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
45 | - if (empty( $titleClass )) { |
|
44 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
45 | + if (empty($titleClass)) { |
|
46 | 46 | $titleClass = lasso_get_supported_theme_title_class(); |
47 | 47 | } |
48 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
50 | 50 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
51 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
51 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
52 | 52 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
53 | 53 | |
54 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
55 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
54 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
55 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | //text alignement |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | |
64 | 64 | if ($show_color) { |
65 | 65 | //color picker |
66 | - wp_enqueue_style( 'wp-color-picker' ); |
|
67 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
66 | + wp_enqueue_style('wp-color-picker'); |
|
67 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // custom fields |
71 | 71 | |
72 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
72 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
73 | 73 | |
74 | 74 | |
75 | 75 | |
@@ -80,60 +80,60 @@ discard block |
||
80 | 80 | $delta = time() - $post_date; |
81 | 81 | |
82 | 82 | $strings = array( |
83 | - 'save' => __('Save','lasso'), |
|
84 | - 'saving' => __('Saving...','lasso'), |
|
85 | - 'saved' => __('Saved!','lasso'), |
|
86 | - 'adding' => __('Adding...','lasso'), |
|
87 | - 'added' => __('Added!','lasso'), |
|
88 | - 'loading' => __('Loading...','lasso'), |
|
89 | - 'loadMore' => __('Load More','lasso'), |
|
90 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
91 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
92 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
93 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
94 | - 'justWrite' => __('Just write...','lasso'), |
|
95 | - 'chooseImage' => __('Choose an image','lasso'), |
|
96 | - 'updateImage' => __('Update Image','lasso'), |
|
97 | - 'insertImage' => __('Insert Image','lasso'), |
|
98 | - 'selectImage' => __('Select Image','lasso'), |
|
99 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
100 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
101 | - 'chooseImages' => __('Choose images','lasso'), |
|
102 | - 'editImage' => __('Edit Image','lasso'), |
|
103 | - 'addImages' => __('Add Images','lasso'), |
|
104 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
105 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
106 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
107 | - 'publishPost' => __('Publish Post?','lasso'), |
|
108 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
109 | - 'deletePost' => __('Trash Post?','lasso'), |
|
110 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
111 | - 'warning' => __('Oh snap!','laso'), |
|
112 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
113 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
83 | + 'save' => __('Save', 'lasso'), |
|
84 | + 'saving' => __('Saving...', 'lasso'), |
|
85 | + 'saved' => __('Saved!', 'lasso'), |
|
86 | + 'adding' => __('Adding...', 'lasso'), |
|
87 | + 'added' => __('Added!', 'lasso'), |
|
88 | + 'loading' => __('Loading...', 'lasso'), |
|
89 | + 'loadMore' => __('Load More', 'lasso'), |
|
90 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
91 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
92 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
93 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
94 | + 'justWrite' => __('Just write...', 'lasso'), |
|
95 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
96 | + 'updateImage' => __('Update Image', 'lasso'), |
|
97 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
98 | + 'selectImage' => __('Select Image', 'lasso'), |
|
99 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
100 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
101 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
102 | + 'editImage' => __('Edit Image', 'lasso'), |
|
103 | + 'addImages' => __('Add Images', 'lasso'), |
|
104 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
105 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
106 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
107 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
108 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
109 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
110 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
111 | + 'warning' => __('Oh snap!', 'laso'), |
|
112 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
113 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
114 | 114 | 'missingConfirm' => __('Update Settings', 'lasso'), |
115 | - 'helperText' => __('one more letter','lasso'), |
|
115 | + 'helperText' => __('one more letter', 'lasso'), |
|
116 | 116 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
117 | 117 | ); |
118 | 118 | |
119 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
119 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
120 | 120 | |
121 | 121 | $gallery_class = new gallery(); |
122 | 122 | $gallery_nonce_action = $gallery_class->nonce_action; |
123 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
123 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
124 | 124 | |
125 | 125 | // rest api |
126 | 126 | $rest_nonce = ''; |
127 | - $rest_root =''; |
|
127 | + $rest_root = ''; |
|
128 | 128 | if (function_exists('rest_url')) { |
129 | - $rest_root = esc_url_raw( rest_url()); |
|
130 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
131 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
132 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
133 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
134 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
129 | + $rest_root = esc_url_raw(rest_url()); |
|
130 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
131 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
132 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
133 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
134 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
135 | 135 | |
136 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
136 | + if (class_exists('WP_REST_Controller')) { |
|
137 | 137 | // we are using REST API V2 |
138 | 138 | $using_restapiv2 = true; |
139 | 139 | } |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | |
142 | 142 | // localized objects |
143 | 143 | $objects = array( |
144 | - 'ajaxurl' => esc_url( $api_url ), |
|
145 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
144 | + 'ajaxurl' => esc_url($api_url), |
|
145 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
146 | 146 | 'rest_root' => $rest_root, |
147 | 147 | 'rest_nonce' => $rest_nonce, |
148 | 148 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | 'featImgClass' => $featImgClass, |
151 | 151 | 'titleClass' => $titleClass, |
152 | 152 | 'strings' => $strings, |
153 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
154 | - 'post_status' => get_post_status( $postid ), |
|
153 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
154 | + 'post_status' => get_post_status($postid), |
|
155 | 155 | 'postid' => $postid, |
156 | 156 | 'permalink' => get_permalink(), |
157 | 157 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
158 | 158 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
159 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
159 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
160 | 160 | 'can_publish_posts' => current_user_can('publish_posts'), |
161 | 161 | 'can_publish_pages' => current_user_can('publish_pages'), |
162 | 162 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -191,23 +191,23 @@ discard block |
||
191 | 191 | 'postTags' => lasso_get_objects('tag'), |
192 | 192 | 'noResultsDiv' => lasso_editor_empty_results(), |
193 | 193 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
194 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
195 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
196 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
197 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
194 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
195 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
196 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
197 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
198 | 198 | 'revisionModal' => lasso_editor_revision_modal(), |
199 | 199 | 'isMobile' => wp_is_mobile(), |
200 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
200 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
201 | 201 | 'showColor' => $show_color, |
202 | 202 | 'showAlignment' => $show_align, |
203 | 203 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
204 | 204 | 'restapi2' => $using_restapiv2, |
205 | 205 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
206 | - 'newObjectContent' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ), |
|
206 | + 'newObjectContent' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')), |
|
207 | 207 | 'boldTag' => $bold_tag, |
208 | 208 | 'iTag' => $i_tag, |
209 | 209 | 'customFields' => $custom_fields, |
210 | - 'skipToEdit' =>( $delta < 30 ) // if it's a new post, skip to edit mode |
|
210 | + 'skipToEdit' =>($delta < 30) // if it's a new post, skip to edit mode |
|
211 | 211 | ); |
212 | 212 | |
213 | 213 | |
@@ -216,18 +216,18 @@ discard block |
||
216 | 216 | |
217 | 217 | if (!$using_restapiv2) { |
218 | 218 | // enqueue REST API V1 |
219 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
220 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
221 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
219 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
220 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
221 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
222 | 222 | } |
223 | 223 | |
224 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
224 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
225 | 225 | if ($show_color) { |
226 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
226 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
227 | 227 | } else { |
228 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
228 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
229 | 229 | } |
230 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
230 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
231 | 231 | |
232 | 232 | |
233 | 233 | } |