@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '0.9.17.4' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '0.9.17.4'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
49 | +function lasso_show_in_rest($args, $post_type) { |
|
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
66 | + if (empty($option)) |
|
67 | 67 | return; |
68 | 68 | |
69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
70 | 70 | |
71 | - $options = get_site_option( $section ); |
|
71 | + $options = get_site_option($section); |
|
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - $options = get_option( $section ); |
|
75 | + $options = get_option($section); |
|
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $options[$option] ) ) { |
|
78 | + if (isset($options[$option])) { |
|
79 | 79 | return $options[$option]; |
80 | 80 | } |
81 | 81 |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
262 | 262 | } |
263 | 263 | |
264 | - // new ajax function to lock post for editing |
|
264 | + // new ajax function to lock post for editing |
|
265 | 265 | public function editus_lock_post() |
266 | 266 | { |
267 | 267 | $post_id= $_POST["postid"]; |
268 | 268 | $locked = wp_check_post_lock($post_id); |
269 | 269 | |
270 | 270 | if (!$locked) { |
271 | - wp_set_post_lock($post_id); |
|
271 | + wp_set_post_lock($post_id); |
|
272 | 272 | echo "true"; |
273 | 273 | } else { |
274 | 274 | $user_info = get_userdata($locked); |
@@ -366,59 +366,59 @@ discard block |
||
366 | 366 | ); |
367 | 367 | foreach ($_POST as $key => $value) { |
368 | 368 | if ($key !="code" && $key !="action") { |
369 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
369 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
370 | 370 | $atts[$key] = $value; |
371 | 371 | } |
372 | 372 | } |
373 | 373 | if ($code == "aesop_video") { |
374 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
375 | - echo aesop_video_shortcode($atts); |
|
374 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
375 | + echo aesop_video_shortcode($atts); |
|
376 | 376 | } |
377 | 377 | else if ($code == "aesop_image") { |
378 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
379 | - echo aesop_image_shortcode($atts); |
|
378 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
379 | + echo aesop_image_shortcode($atts); |
|
380 | 380 | } |
381 | 381 | else if ($code == "aesop_quote") { |
382 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
383 | - echo aesop_quote_shortcode($atts); |
|
382 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
383 | + echo aesop_quote_shortcode($atts); |
|
384 | 384 | } |
385 | 385 | else if ($code == "aesop_parallax") { |
386 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
387 | - echo aesop_parallax_shortcode($atts); |
|
386 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
387 | + echo aesop_parallax_shortcode($atts); |
|
388 | 388 | } |
389 | 389 | else if ($code == "aesop_character") { |
390 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
391 | - echo aesop_character_shortcode($atts); |
|
390 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
391 | + echo aesop_character_shortcode($atts); |
|
392 | 392 | } |
393 | 393 | else if ($code == "aesop_collection") { |
394 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
395 | - echo aesop_collection_shortcode($atts); |
|
394 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
395 | + echo aesop_collection_shortcode($atts); |
|
396 | 396 | } |
397 | 397 | else if ($code == "aesop_chapter") { |
398 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
399 | - echo aesop_chapter_shortcode($atts); |
|
398 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
399 | + echo aesop_chapter_shortcode($atts); |
|
400 | 400 | } |
401 | 401 | else if ($code == "aesop_content") { |
402 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
403 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
402 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
403 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
404 | 404 | } |
405 | 405 | else if ($code == "aesop_gallery") { |
406 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
407 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
406 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
407 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
408 | 408 | } |
409 | 409 | else if ($code == "aesop_audio") { |
410 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
411 | - echo aesop_audio_shortcode($atts); |
|
410 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
411 | + echo aesop_audio_shortcode($atts); |
|
412 | 412 | } |
413 | 413 | else { |
414 | 414 | $code = '['.$code.' '; |
415 | 415 | foreach ($atts as $key => $value) { |
416 | - $code = ''.$key.'="'.$value.'" '; |
|
416 | + $code = ''.$key.'="'.$value.'" '; |
|
417 | 417 | } |
418 | 418 | $code = $code.']'; |
419 | 419 | echo do_shortcode($code); |
420 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
421 | - //echo aesop_audio_shortcode($atts); |
|
420 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
421 | + //echo aesop_audio_shortcode($atts); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | exit; |
@@ -429,14 +429,14 @@ discard block |
||
429 | 429 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
430 | 430 | |
431 | 431 | if ($taxonomy =='category') { |
432 | - // convert from names to category ids |
|
432 | + // convert from names to category ids |
|
433 | 433 | $cats = array(); |
434 | 434 | foreach ($value as $cat) { |
435 | 435 | $cat_id = get_cat_ID($cat); |
436 | 436 | if ($cat_id !=0) { |
437 | 437 | $cats [] = $cat_id; |
438 | 438 | } else if ($allow_new_category) { |
439 | - $cats [] = wp_create_category($cat); |
|
439 | + $cats [] = wp_create_category($cat); |
|
440 | 440 | } |
441 | 441 | } |
442 | 442 | $value = $cats; |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | |
459 | 459 | public function set_date( $postid, $value) { |
460 | 460 | if( $value ) { |
461 | - wp_update_post( |
|
461 | + wp_update_post( |
|
462 | 462 | array ( |
463 | 463 | 'ID' => $postid, // ID of the post to update |
464 | 464 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -52,16 +52,16 @@ 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' ) ); |
|
63 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
64 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
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 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
64 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
65 | 65 | |
66 | 66 | // enable saving custom fields through REST API |
67 | 67 | self::enable_metasave('post'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public static function get_instance() { |
93 | 93 | |
94 | 94 | // If the single instance hasn't been set, set it now. |
95 | - if ( null == self::$instance ) { |
|
95 | + if (null == self::$instance) { |
|
96 | 96 | self::$instance = new self; |
97 | 97 | } |
98 | 98 | |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | * WPMU is disabled or plugin is |
110 | 110 | * activated on an individual blog. |
111 | 111 | */ |
112 | - public static function activate( $network_wide ) { |
|
112 | + public static function activate($network_wide) { |
|
113 | 113 | |
114 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
114 | + if (function_exists('is_multisite') && is_multisite()) { |
|
115 | 115 | |
116 | - if ( $network_wide ) { |
|
116 | + if ($network_wide) { |
|
117 | 117 | |
118 | 118 | // Get all blog ids |
119 | 119 | $blog_ids = self::get_blog_ids(); |
120 | 120 | |
121 | - foreach ( $blog_ids as $blog_id ) { |
|
121 | + foreach ($blog_ids as $blog_id) { |
|
122 | 122 | |
123 | - switch_to_blog( $blog_id ); |
|
123 | + switch_to_blog($blog_id); |
|
124 | 124 | self::single_activate(); |
125 | 125 | } |
126 | 126 | |
@@ -146,18 +146,18 @@ discard block |
||
146 | 146 | * WPMU is disabled or plugin is |
147 | 147 | * deactivated on an individual blog. |
148 | 148 | */ |
149 | - public static function deactivate( $network_wide ) { |
|
149 | + public static function deactivate($network_wide) { |
|
150 | 150 | |
151 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
151 | + if (function_exists('is_multisite') && is_multisite()) { |
|
152 | 152 | |
153 | - if ( $network_wide ) { |
|
153 | + if ($network_wide) { |
|
154 | 154 | |
155 | 155 | // Get all blog ids |
156 | 156 | $blog_ids = self::get_blog_ids(); |
157 | 157 | |
158 | - foreach ( $blog_ids as $blog_id ) { |
|
158 | + foreach ($blog_ids as $blog_id) { |
|
159 | 159 | |
160 | - switch_to_blog( $blog_id ); |
|
160 | + switch_to_blog($blog_id); |
|
161 | 161 | self::single_deactivate(); |
162 | 162 | |
163 | 163 | } |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @param int $blog_id ID of the new blog. |
183 | 183 | */ |
184 | - public function activate_new_site( $blog_id ) { |
|
184 | + public function activate_new_site($blog_id) { |
|
185 | 185 | |
186 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
186 | + if (1 !== did_action('wpmu_new_blog')) { |
|
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
190 | - switch_to_blog( $blog_id ); |
|
190 | + switch_to_blog($blog_id); |
|
191 | 191 | self::single_activate(); |
192 | 192 | restore_current_blog(); |
193 | 193 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | WHERE archived = '0' AND spam = '0' |
213 | 213 | AND deleted = '0'"; |
214 | 214 | |
215 | - return $wpdb->get_col( $sql ); |
|
215 | + return $wpdb->get_col($sql); |
|
216 | 216 | |
217 | 217 | } |
218 | 218 | |
@@ -223,18 +223,18 @@ discard block |
||
223 | 223 | */ |
224 | 224 | private static function single_activate() { |
225 | 225 | |
226 | - $curr_version = get_option( 'lasso_version' ); |
|
226 | + $curr_version = get_option('lasso_version'); |
|
227 | 227 | |
228 | 228 | // update upgraded from |
229 | - if ( $curr_version ) { |
|
230 | - update_option( 'lasso_updated_from', $curr_version ); |
|
229 | + if ($curr_version) { |
|
230 | + update_option('lasso_updated_from', $curr_version); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | // update lasso version option |
234 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
234 | + update_option('lasso_version', LASSO_VERSION); |
|
235 | 235 | |
236 | 236 | // set transietn for activation welcome |
237 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
237 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
238 | 238 | |
239 | 239 | |
240 | 240 | } |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | public function load_plugin_textdomain() { |
257 | 257 | |
258 | 258 | $domain = $this->plugin_slug; |
259 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
259 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
260 | 260 | |
261 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
261 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | // new ajax function to lock post for editing |
265 | 265 | public function editus_lock_post() |
266 | 266 | { |
267 | - $post_id= $_POST["postid"]; |
|
267 | + $post_id = $_POST["postid"]; |
|
268 | 268 | $locked = wp_check_post_lock($post_id); |
269 | 269 | |
270 | 270 | if (!$locked) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | echo "true"; |
273 | 273 | } else { |
274 | 274 | $user_info = get_userdata($locked); |
275 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
275 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
276 | 276 | } |
277 | 277 | exit; |
278 | 278 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | { |
283 | 283 | $user_id = get_current_user_ID(); |
284 | 284 | |
285 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
285 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
286 | 286 | exit; |
287 | 287 | } |
288 | 288 | |
@@ -293,14 +293,14 @@ discard block |
||
293 | 293 | $data = array(); |
294 | 294 | parse_str($_POST['data'], $data); |
295 | 295 | |
296 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
296 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
297 | 297 | wp_send_json_error(); |
298 | 298 | exit; |
299 | 299 | } |
300 | 300 | |
301 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
302 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
303 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
301 | + $status = isset($data['status']) ? $data['status'] : false; |
|
302 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
303 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
304 | 304 | |
305 | 305 | |
306 | 306 | $args = array( |
@@ -311,33 +311,33 @@ discard block |
||
311 | 311 | |
312 | 312 | |
313 | 313 | |
314 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
314 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
315 | 315 | |
316 | 316 | // update categories |
317 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
317 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
318 | 318 | |
319 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
319 | + self::set_post_terms($postid, $cats, 'category'); |
|
320 | 320 | |
321 | 321 | // update tags |
322 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
323 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
322 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
323 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
324 | 324 | |
325 | 325 | //update date |
326 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
327 | - self::set_date( $postid, $date ); |
|
326 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
327 | + self::set_date($postid, $date); |
|
328 | 328 | |
329 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
329 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
330 | 330 | wp_send_json_success(); |
331 | 331 | exit; |
332 | 332 | } |
333 | 333 | |
334 | 334 | public static function enable_metasave($type) |
335 | 335 | { |
336 | - register_rest_field( $type, 'metadata', array( |
|
337 | - 'get_callback' => function ( $data ) { |
|
338 | - return get_post_meta( $data['id']);//, '', '' ); |
|
336 | + register_rest_field($type, 'metadata', array( |
|
337 | + 'get_callback' => function($data) { |
|
338 | + return get_post_meta($data['id']); //, '', '' ); |
|
339 | 339 | }, |
340 | - 'update_callback' => function( $data, $post ) { |
|
340 | + 'update_callback' => function($data, $post) { |
|
341 | 341 | foreach ($data as $key => $value) { |
342 | 342 | update_post_meta($post->ID, $key, $value); |
343 | 343 | } |
@@ -349,10 +349,10 @@ discard block |
||
349 | 349 | public function editus_do_shortcode() |
350 | 350 | { |
351 | 351 | |
352 | - $code= $_POST["code"]; |
|
352 | + $code = $_POST["code"]; |
|
353 | 353 | $code = str_replace('\"', '"', $code); |
354 | - $out = lasso_wrap_shortcodes( $code); |
|
355 | - $out = do_shortcode($out); |
|
354 | + $out = lasso_wrap_shortcodes($code); |
|
355 | + $out = do_shortcode($out); |
|
356 | 356 | echo $out; |
357 | 357 | exit; |
358 | 358 | } |
@@ -361,53 +361,53 @@ discard block |
||
361 | 361 | { |
362 | 362 | |
363 | 363 | |
364 | - $code= $_POST["code"]; |
|
364 | + $code = $_POST["code"]; |
|
365 | 365 | $atts = array( |
366 | 366 | ); |
367 | 367 | foreach ($_POST as $key => $value) { |
368 | - if ($key !="code" && $key !="action") { |
|
368 | + if ($key != "code" && $key != "action") { |
|
369 | 369 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
370 | 370 | $atts[$key] = $value; |
371 | 371 | } |
372 | 372 | } |
373 | 373 | if ($code == "aesop_video") { |
374 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
374 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
375 | 375 | echo aesop_video_shortcode($atts); |
376 | 376 | } |
377 | 377 | else if ($code == "aesop_image") { |
378 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
378 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
379 | 379 | echo aesop_image_shortcode($atts); |
380 | 380 | } |
381 | 381 | else if ($code == "aesop_quote") { |
382 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
382 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
383 | 383 | echo aesop_quote_shortcode($atts); |
384 | 384 | } |
385 | 385 | else if ($code == "aesop_parallax") { |
386 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
386 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
387 | 387 | echo aesop_parallax_shortcode($atts); |
388 | 388 | } |
389 | 389 | else if ($code == "aesop_character") { |
390 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
390 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
391 | 391 | echo aesop_character_shortcode($atts); |
392 | 392 | } |
393 | 393 | else if ($code == "aesop_collection") { |
394 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
394 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
395 | 395 | echo aesop_collection_shortcode($atts); |
396 | 396 | } |
397 | 397 | else if ($code == "aesop_chapter") { |
398 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
398 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
399 | 399 | echo aesop_chapter_shortcode($atts); |
400 | 400 | } |
401 | 401 | else if ($code == "aesop_content") { |
402 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
402 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
403 | 403 | echo aesop_content_shortcode($atts, $atts['content_data']); |
404 | 404 | } |
405 | 405 | else if ($code == "aesop_gallery") { |
406 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
407 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
406 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
407 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
408 | 408 | } |
409 | 409 | else if ($code == "aesop_audio") { |
410 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
410 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
411 | 411 | echo aesop_audio_shortcode($atts); |
412 | 412 | } |
413 | 413 | else { |
@@ -423,17 +423,17 @@ discard block |
||
423 | 423 | |
424 | 424 | exit; |
425 | 425 | } |
426 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
427 | - if( $value ) { |
|
428 | - $value = explode( ',', $value ); |
|
429 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
426 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
427 | + if ($value) { |
|
428 | + $value = explode(',', $value); |
|
429 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
430 | 430 | |
431 | - if ($taxonomy =='category') { |
|
431 | + if ($taxonomy == 'category') { |
|
432 | 432 | // convert from names to category ids |
433 | 433 | $cats = array(); |
434 | 434 | foreach ($value as $cat) { |
435 | 435 | $cat_id = get_cat_ID($cat); |
436 | - if ($cat_id !=0) { |
|
436 | + if ($cat_id != 0) { |
|
437 | 437 | $cats [] = $cat_id; |
438 | 438 | } else if ($allow_new_category) { |
439 | 439 | $cats [] = wp_create_category($cat); |
@@ -442,27 +442,27 @@ discard block |
||
442 | 442 | $value = $cats; |
443 | 443 | } |
444 | 444 | |
445 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
445 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
446 | 446 | } |
447 | - else { |
|
447 | + else { |
|
448 | 448 | //remove all terms from post |
449 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
449 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
450 | 450 | } |
451 | 451 | |
452 | - if ( ! is_wp_error( $result ) ) { |
|
452 | + if (!is_wp_error($result)) { |
|
453 | 453 | return true; |
454 | - }else{ |
|
454 | + } else { |
|
455 | 455 | return false; |
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
459 | - public function set_date( $postid, $value) { |
|
460 | - if( $value ) { |
|
459 | + public function set_date($postid, $value) { |
|
460 | + if ($value) { |
|
461 | 461 | wp_update_post( |
462 | - array ( |
|
462 | + array( |
|
463 | 463 | 'ID' => $postid, // ID of the post to update |
464 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
465 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
464 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
465 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
466 | 466 | ) |
467 | 467 | ); |
468 | 468 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
152 | 152 | |
153 | 153 | // mobile styles |
154 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
154 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
155 | 155 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
156 | 156 | |
157 | 157 | //show color |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | </div> |
436 | 436 | <?php |
437 | 437 | if ($allow_change_date) { |
438 | - $dateformat = get_option( 'date_format' ); |
|
438 | + $dateformat = get_option( 'date_format' ); |
|
439 | 439 | ?> |
440 | 440 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
441 | 441 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | <?php |
548 | 548 | if ( !empty( $types ) ) { |
549 | 549 | // get the first element |
550 | - $type = reset($types); |
|
550 | + $type = reset($types); |
|
551 | 551 | $type = preg_replace( '/s\b/','', $type ); |
552 | 552 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
553 | 553 | } |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | global $post; |
576 | 576 | |
577 | 577 | global $wp_post_types; |
578 | - $labels = &$wp_post_types['post']->labels; |
|
579 | - $labels->name = 'Articles'; |
|
578 | + $labels = &$wp_post_types['post']->labels; |
|
579 | + $labels->name = 'Articles'; |
|
580 | 580 | |
581 | 581 | ob_start(); |
582 | 582 |
@@ -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,108 +160,108 @@ 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 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
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 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
175 | 175 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
176 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
177 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
178 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
179 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
180 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
181 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
182 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
183 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
184 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
185 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
186 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
187 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
188 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
189 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
190 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
191 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
176 | + <?php if ('ase-active' == $ase_status): ?> |
|
177 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
178 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
179 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
180 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
181 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
182 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
183 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
184 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
185 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
186 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
187 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
188 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
189 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
190 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
191 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
192 | 192 | <?php }?> |
193 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
194 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
193 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
194 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
195 | 195 | <?php }?> |
196 | 196 | <?php else: ?> |
197 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
198 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
199 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
197 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
198 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
199 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
200 | 200 | <?php endif; ?> |
201 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
201 | + <?php do_action('lasso_toolbar_components'); ?> |
|
202 | 202 | </ul> |
203 | 203 | </li> |
204 | - <?php if ( $toolbar_headings ): ?> |
|
205 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
206 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
204 | + <?php if ($toolbar_headings): ?> |
|
205 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
206 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
207 | 207 | <?php endif; ?> |
208 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
209 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
210 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
211 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
208 | + <?php if ($toolbar_headings_h4): ?> |
|
209 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
210 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
211 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
212 | 212 | <?php endif; ?> |
213 | 213 | |
214 | - <?php if ( $show_color ): ?> |
|
215 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li> |
|
216 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
214 | + <?php if ($show_color): ?> |
|
215 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li> |
|
216 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
217 | 217 | <?php endif; ?> |
218 | 218 | |
219 | 219 | |
220 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
220 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
221 | 221 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
222 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
223 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
222 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
223 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
224 | 224 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
225 | 225 | <label for="aesop-toolbar--link_newtab">Open in Another Tab</label> |
226 | 226 | </div> |
227 | 227 | </li> |
228 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
229 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>"> |
|
228 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
229 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>"> |
|
230 | 230 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
231 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
231 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
232 | 232 | <div id="lasso-toolbar--html__footer"> |
233 | 233 | <div id="lasso-toolbar--html__footer_desc" > |
234 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
235 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?> |
|
234 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
235 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?> |
|
236 | 236 | </div> |
237 | 237 | <ul class="lasso-toolbar--html-snips"> |
238 | 238 | |
239 | - <?php if ( !$toolbar_headings ): ?> |
|
240 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
241 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
239 | + <?php if (!$toolbar_headings): ?> |
|
240 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
241 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
242 | 242 | <?php endif; ?> |
243 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
244 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
243 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
244 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
245 | 245 | </ul> |
246 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
247 | - <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> |
|
246 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
247 | + <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> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | </li> |
251 | - <?php if ( $show_align ): ?> |
|
252 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
253 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
254 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
251 | + <?php if ($show_align): ?> |
|
252 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
253 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
254 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
255 | 255 | <?php endif; ?> |
256 | 256 | </ul> |
257 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
257 | + <?php if (is_singular() && $is_mobile) { ?> |
|
258 | 258 | |
259 | - <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;"> |
|
259 | + <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;"> |
|
260 | 260 | |
261 | - <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> |
|
261 | + <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> |
|
262 | 262 | |
263 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
264 | - <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> |
|
263 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
264 | + <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> |
|
265 | 265 | <?php } ?> |
266 | 266 | |
267 | 267 | </div> |
@@ -279,22 +279,22 @@ discard block |
||
279 | 279 | */ |
280 | 280 | function lasso_editor_settings_toolbar() { |
281 | 281 | |
282 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
282 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
283 | 283 | |
284 | 284 | ob_start(); |
285 | 285 | |
286 | - if ( !lasso_user_can() ) |
|
286 | + if (!lasso_user_can()) |
|
287 | 287 | return; |
288 | 288 | |
289 | 289 | // let users add custom css classes |
290 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
290 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
291 | 291 | |
292 | 292 | ?> |
293 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
294 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
295 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
296 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
297 | - <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> |
|
293 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
294 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
295 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
296 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
297 | + <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> |
|
298 | 298 | </ul> |
299 | 299 | |
300 | 300 | <?php return ob_get_clean(); |
@@ -310,17 +310,17 @@ discard block |
||
310 | 310 | |
311 | 311 | ob_start(); |
312 | 312 | |
313 | - if ( !lasso_user_can() ) |
|
313 | + if (!lasso_user_can()) |
|
314 | 314 | return; |
315 | 315 | |
316 | 316 | // has post thumbnail |
317 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
317 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
318 | 318 | |
319 | 319 | ?> |
320 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
321 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
322 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
323 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
320 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
321 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
322 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
323 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
324 | 324 | </ul> |
325 | 325 | |
326 | 326 | <?php return ob_get_clean(); |
@@ -339,58 +339,58 @@ discard block |
||
339 | 339 | |
340 | 340 | ob_start(); |
341 | 341 | |
342 | - if ( !lasso_user_can() ) |
|
342 | + if (!lasso_user_can()) |
|
343 | 343 | return; |
344 | 344 | |
345 | 345 | global $post; |
346 | 346 | |
347 | 347 | $postid = get_the_ID(); |
348 | 348 | |
349 | - $status = get_post_status( $postid ); |
|
350 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
349 | + $status = get_post_status($postid); |
|
350 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
351 | 351 | |
352 | 352 | // let users add custom css classes |
353 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
353 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
354 | 354 | |
355 | 355 | // objects categories |
356 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
357 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
356 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
357 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
358 | 358 | |
359 | 359 | // modal tabs |
360 | - $tabs = lasso_modal_addons('tab'); |
|
361 | - $content = lasso_modal_addons('content'); |
|
360 | + $tabs = lasso_modal_addons('tab'); |
|
361 | + $content = lasso_modal_addons('content'); |
|
362 | 362 | |
363 | 363 | //editor options |
364 | 364 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
365 | 365 | |
366 | 366 | // are we singular |
367 | - $is_singular = is_singular(); |
|
367 | + $is_singular = is_singular(); |
|
368 | 368 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
369 | 369 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
370 | 370 | $theme_supports = current_theme_supports('post-thumbnails'); |
371 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
371 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
372 | 372 | |
373 | 373 | ?> |
374 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
374 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
375 | 375 | <div class="lasso--modal__inner"> |
376 | 376 | |
377 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
377 | + <?php if ($tabs) { echo $tabs; } ?> |
|
378 | 378 | |
379 | 379 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
380 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
380 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
381 | 381 | |
382 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
382 | + <?php if ($is_singular && $theme_supports) : ?> |
|
383 | 383 | <div class="lasso--postsettings__left"> |
384 | - <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> |
|
385 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
384 | + <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> |
|
385 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
386 | 386 | |
387 | 387 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
388 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
389 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
388 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
389 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
390 | 390 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
391 | 391 | </div> |
392 | 392 | |
393 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
393 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
394 | 394 | |
395 | 395 | </div> |
396 | 396 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | |
401 | 401 | <div class="lasso--postsettings__right"> |
402 | 402 | |
403 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
403 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
404 | 404 | <div class="lasso--postsettings__option story-status-option"> |
405 | - <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> |
|
406 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
407 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
408 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
405 | + <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> |
|
406 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
407 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
408 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
409 | 409 | </ul> |
410 | 410 | <div class="lasso--slider_wrap"> |
411 | 411 | <div id="lasso--slider"></div> |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | </div> |
414 | 414 | <?php endif; ?> |
415 | 415 | |
416 | - <?php if ( 'publish' == $status ): ?> |
|
416 | + <?php if ('publish' == $status): ?> |
|
417 | 417 | <div class="lasso--postsettings__option story-slug-option"> |
418 | - <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> |
|
419 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
418 | + <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> |
|
419 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
420 | 420 | </div> |
421 | 421 | <?php endif; ?> |
422 | 422 | |
@@ -425,20 +425,20 @@ discard block |
||
425 | 425 | <div class="lasso--postsettings__middle"> |
426 | 426 | |
427 | 427 | <div class="lasso--postsettings__option story-categories-option"> |
428 | - <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> |
|
429 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
428 | + <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> |
|
429 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
430 | 430 | </div> |
431 | 431 | |
432 | 432 | <div class="lasso--postsettings__option story-tags-option"> |
433 | - <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> |
|
434 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
433 | + <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> |
|
434 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
435 | 435 | </div> |
436 | 436 | <?php |
437 | 437 | if ($allow_change_date) { |
438 | - $dateformat = get_option( 'date_format' ); |
|
438 | + $dateformat = get_option('date_format'); |
|
439 | 439 | ?> |
440 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
441 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
440 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
441 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
442 | 442 | <?php |
443 | 443 | }?> |
444 | 444 | |
@@ -460,23 +460,23 @@ discard block |
||
460 | 460 | ?> |
461 | 461 | <!--/div--> |
462 | 462 | |
463 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
463 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
464 | 464 | |
465 | 465 | <div class="lasso--postsettings__footer" > |
466 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
466 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
467 | 467 | <input type="hidden" name="status" value=""> |
468 | 468 | <input type="hidden" name="categories" value=""> |
469 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
469 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
470 | 470 | <input type="hidden" name="action" value="process_update-object_post"> |
471 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
472 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
473 | - <input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
471 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
472 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
473 | + <input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
474 | 474 | </div> |
475 | 475 | |
476 | 476 | </form> |
477 | 477 | </div> |
478 | 478 | |
479 | - <?php if( $tabs ) { echo $content; } ?> |
|
479 | + <?php if ($tabs) { echo $content; } ?> |
|
480 | 480 | |
481 | 481 | </div> |
482 | 482 | |
@@ -497,41 +497,41 @@ discard block |
||
497 | 497 | |
498 | 498 | ob_start(); |
499 | 499 | |
500 | - if ( !lasso_user_can('edit_posts') ) |
|
500 | + if (!lasso_user_can('edit_posts')) |
|
501 | 501 | return; |
502 | 502 | |
503 | - $status = get_post_status( get_the_ID() ); |
|
503 | + $status = get_post_status(get_the_ID()); |
|
504 | 504 | |
505 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
505 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
506 | 506 | |
507 | 507 | // let users add custom css classes |
508 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
508 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
509 | 509 | |
510 | 510 | // return the post type |
511 | - $type = get_post_type( get_the_ID() ); |
|
511 | + $type = get_post_type(get_the_ID()); |
|
512 | 512 | |
513 | 513 | $mobile_style = ""; |
514 | 514 | if (wp_is_mobile()) { |
515 | 515 | $mobile_style = 'style="top:140px !important;"'; |
516 | 516 | } |
517 | 517 | ?> |
518 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
518 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
519 | 519 | <div class="lasso--modal__inner lasso--hasnewform"> |
520 | 520 | |
521 | 521 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
522 | 522 | |
523 | 523 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
524 | - <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> |
|
525 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>"> |
|
524 | + <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> |
|
525 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>"> |
|
526 | 526 | <div class="lasso--select-wrap" style="width:90px"> |
527 | 527 | <select id="lasso--select-type" name="story_type"> |
528 | 528 | |
529 | 529 | <?php |
530 | 530 | $types = lasso_post_types(); |
531 | - if ( !empty( $types ) ) { |
|
532 | - foreach( $types as $type ) { |
|
533 | - $type = preg_replace( '/s\b/','', $type ); |
|
534 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) ); |
|
531 | + if (!empty($types)) { |
|
532 | + foreach ($types as $type) { |
|
533 | + $type = preg_replace('/s\b/', '', $type); |
|
534 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type))); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | } |
@@ -541,19 +541,19 @@ discard block |
||
541 | 541 | </div> |
542 | 542 | </div> |
543 | 543 | |
544 | - <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>"> |
|
545 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
544 | + <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>"> |
|
545 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
546 | 546 | <input type="hidden" name="action" value="process_new-object_post"> |
547 | 547 | <?php |
548 | - if ( !empty( $types ) ) { |
|
548 | + if (!empty($types)) { |
|
549 | 549 | // get the first element |
550 | 550 | $type = reset($types); |
551 | - $type = preg_replace( '/s\b/','', $type ); |
|
552 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
551 | + $type = preg_replace('/s\b/', '', $type); |
|
552 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
553 | 553 | } |
554 | 554 | ?> |
555 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
556 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
555 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
556 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
557 | 557 | </div> |
558 | 558 | |
559 | 559 | </form> |
@@ -581,18 +581,18 @@ discard block |
||
581 | 581 | ob_start(); |
582 | 582 | |
583 | 583 | // post status |
584 | - $status = get_post_status( get_the_ID() ); |
|
584 | + $status = get_post_status(get_the_ID()); |
|
585 | 585 | |
586 | 586 | // let users add custom css classes |
587 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
587 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
588 | 588 | |
589 | 589 | ?> |
590 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
590 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
591 | 591 | <div class="lasso--modal__inner"> |
592 | 592 | |
593 | 593 | <div class="lasso--post-filtering not-visible"> |
594 | 594 | <div class="lasso--search__results"> |
595 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
595 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
596 | 596 | </div> |
597 | 597 | <div class="lasso--search"> |
598 | 598 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -606,18 +606,18 @@ discard block |
||
606 | 606 | $post_types = lasso_post_types_names(); |
607 | 607 | $rest_bases = lasso_post_types_rest_base(); |
608 | 608 | |
609 | - if ( ! empty( $post_types ) ) { |
|
609 | + if (!empty($post_types)) { |
|
610 | 610 | $first = 'active'; |
611 | - foreach( $post_types as $name => $label ) { |
|
611 | + foreach ($post_types as $name => $label) { |
|
612 | 612 | if (array_key_exists($name, $rest_bases)) { |
613 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
613 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
614 | 614 | } |
615 | 615 | $first = ''; |
616 | 616 | } |
617 | 617 | |
618 | 618 | } |
619 | 619 | |
620 | - do_action('lasso_modal_post_objects');?> |
|
620 | + do_action('lasso_modal_post_objects'); ?> |
|
621 | 621 | |
622 | 622 | </ul> |
623 | 623 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -635,18 +635,18 @@ discard block |
||
635 | 635 | |
636 | 636 | ob_start(); |
637 | 637 | |
638 | - if ( !lasso_user_can() ) |
|
638 | + if (!lasso_user_can()) |
|
639 | 639 | return; |
640 | 640 | |
641 | 641 | // let users add custom css classes |
642 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
642 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
643 | 643 | |
644 | 644 | ?> |
645 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
646 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
647 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
648 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
649 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
645 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
646 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
647 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
648 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
649 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
650 | 650 | </ul> |
651 | 651 | |
652 | 652 | <?php return ob_get_clean(); |
@@ -656,18 +656,18 @@ discard block |
||
656 | 656 | |
657 | 657 | ob_start(); |
658 | 658 | |
659 | - if ( !lasso_user_can() ) |
|
659 | + if (!lasso_user_can()) |
|
660 | 660 | return; |
661 | 661 | |
662 | 662 | // let users add custom css classes |
663 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
663 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
664 | 664 | |
665 | 665 | ?> |
666 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
667 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
668 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
669 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
670 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
666 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
667 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
668 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
669 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
670 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
671 | 671 | </ul> |
672 | 672 | |
673 | 673 | <?php return ob_get_clean(); |
@@ -680,16 +680,16 @@ discard block |
||
680 | 680 | */ |
681 | 681 | function lasso_map_form_footer() { |
682 | 682 | |
683 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
683 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
684 | 684 | |
685 | 685 | ob_start(); |
686 | 686 | |
687 | 687 | ?> |
688 | 688 | <div class="lasso--map-form__footer"> |
689 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
690 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
689 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
690 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
691 | 691 | <input type="hidden" name="action" value="process_map_save"> |
692 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
692 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
693 | 693 | </div> |
694 | 694 | |
695 | 695 | <?php return ob_get_clean(); |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | |
708 | 708 | ?> |
709 | 709 | <div id="lasso--pagerefresh" class="visible"> |
710 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
710 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
711 | 711 | </div> |
712 | 712 | |
713 | 713 | <?php return ob_get_clean(); |
@@ -721,43 +721,43 @@ discard block |
||
721 | 721 | */ |
722 | 722 | function lasso_editor_options_blob() { |
723 | 723 | |
724 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
725 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
724 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
725 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
726 | 726 | |
727 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
727 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
728 | 728 | |
729 | 729 | $blob = array(); |
730 | 730 | |
731 | - if ( empty( $codes ) ) |
|
731 | + if (empty($codes)) |
|
732 | 732 | return; |
733 | 733 | |
734 | - foreach ( $codes as $slug => $shortcode ) { |
|
734 | + foreach ($codes as $slug => $shortcode) { |
|
735 | 735 | $return = ''; |
736 | 736 | // Shortcode has atts |
737 | 737 | |
738 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
738 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
739 | 739 | |
740 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
740 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
741 | 741 | |
742 | 742 | |
743 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
743 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
744 | 744 | |
745 | 745 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
746 | 746 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">'; |
747 | - $return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
747 | + $return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
748 | 748 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
749 | 749 | // Select |
750 | 750 | |
751 | - if ( isset( $attr_info['values'] ) ) { |
|
751 | + if (isset($attr_info['values'])) { |
|
752 | 752 | |
753 | - $return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
753 | + $return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
754 | 754 | |
755 | - $i=0; |
|
755 | + $i = 0; |
|
756 | 756 | |
757 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
757 | + foreach ($attr_info['values'] as $attr_value) { |
|
758 | 758 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
759 | 759 | |
760 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
760 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
761 | 761 | |
762 | 762 | $i++; |
763 | 763 | } |
@@ -766,24 +766,24 @@ discard block |
||
766 | 766 | |
767 | 767 | } else { |
768 | 768 | |
769 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
769 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
770 | 770 | |
771 | 771 | // image upload |
772 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
772 | + if ('media_upload' == $attr_info['type']) { |
|
773 | 773 | |
774 | - $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.'" />'; |
|
774 | + $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.'" />'; |
|
775 | 775 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
776 | 776 | |
777 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
777 | + } elseif ('color' == $attr_info['type']) { |
|
778 | 778 | |
779 | - $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.'" />'; |
|
779 | + $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.'" />'; |
|
780 | 780 | |
781 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
781 | + } elseif ('text_area' == $attr_info['type']) { |
|
782 | 782 | |
783 | - $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.''; |
|
783 | + $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.''; |
|
784 | 784 | |
785 | 785 | } else { |
786 | - $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.''; |
|
786 | + $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.''; |
|
787 | 787 | } |
788 | 788 | } |
789 | 789 | $return .= '</p>'; |
@@ -794,9 +794,9 @@ discard block |
||
794 | 794 | /////////////////////////// |
795 | 795 | // START GALLERY AND MAP FRONT END STUFFS |
796 | 796 | /////////////////////////// |
797 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
797 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
798 | 798 | |
799 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
799 | + if ('gallery' == $shortcode['front_type']) { |
|
800 | 800 | |
801 | 801 | $return .= lasso_gallery_editor_module(); |
802 | 802 | |
@@ -807,13 +807,13 @@ discard block |
||
807 | 807 | /////////////////////////// |
808 | 808 | |
809 | 809 | // Single shortcode (not closed) |
810 | - if ( 'single' == $shortcode['type'] ) { |
|
810 | + if ('single' == $shortcode['type']) { |
|
811 | 811 | |
812 | 812 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
813 | 813 | |
814 | 814 | } else { |
815 | 815 | |
816 | - $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>'; |
|
816 | + $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>'; |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
847 | 847 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
848 | 848 | <i class="lasso-icon lasso-icon-move"></i> |
849 | - <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> |
|
849 | + <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> |
|
850 | 850 | <div class="lasso--slider_wrap"> |
851 | 851 | <div id="lasso--slider"></div> |
852 | 852 | </div> |