@@ -12,65 +12,65 @@ |
||
12 | 12 | /** |
13 | 13 | * Update an existing galleries options |
14 | 14 | */ |
15 | - public static function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
15 | + public static function save_gallery_options($postid, $gallery_ids, $options, $type = false) { |
|
16 | 16 | |
17 | 17 | // gallery width |
18 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
18 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
19 | 19 | |
20 | 20 | // gallery grid item width |
21 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
21 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
22 | 22 | |
23 | 23 | // caption |
24 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
24 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
25 | 25 | |
26 | 26 | // gallery transition |
27 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
27 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
28 | 28 | |
29 | 29 | // gallery transition speed |
30 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
30 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
31 | 31 | |
32 | 32 | // gallery hide thumbs |
33 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
33 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
34 | 34 | |
35 | 35 | // photoset layout hardwired to on for now |
36 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
36 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
37 | 37 | |
38 | 38 | // photoset layout |
39 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
39 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
40 | 40 | |
41 | 41 | // hero gallery height |
42 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
42 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
43 | 43 | |
44 | 44 | // update gallery ids |
45 | - if ( !empty( $gallery_ids ) ) { |
|
45 | + if (!empty($gallery_ids)) { |
|
46 | 46 | |
47 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
47 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
48 | 48 | |
49 | 49 | } |
50 | 50 | |
51 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
51 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
52 | 52 | |
53 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
53 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
54 | 54 | |
55 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
55 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
56 | 56 | |
57 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
57 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
58 | 58 | |
59 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
59 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
60 | 60 | |
61 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
61 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
62 | 62 | |
63 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
63 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
64 | 64 | |
65 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
65 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
66 | 66 | |
67 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
67 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
68 | 68 | |
69 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
69 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
70 | 70 | |
71 | 71 | //hardwired for now |
72 | 72 | |
73 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
73 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | ob_start(); |
13 | 13 | |
14 | - if ( $galleries ) { ?> |
|
14 | + if ($galleries) { ?> |
|
15 | 15 | |
16 | - <?php if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
16 | + <?php if (lasso_user_can('publish_posts')): ?> |
|
17 | 17 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important"> |
18 | 18 | <div class="ase-gallery-opts--single lasso-option"> |
19 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a> |
|
19 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a> |
|
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | <?php endif; ?> |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | <div class="ase-gallery-opts ase-gallery-opts--edit-gallery" > |
25 | 25 | <div class="ase-gallery-opts--single lasso-option"> |
26 | 26 | |
27 | - <label><?php _e( 'Manage Images', 'lasso' );?> |
|
28 | - <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a> |
|
27 | + <label><?php _e('Manage Images', 'lasso'); ?> |
|
28 | + <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a> |
|
29 | 29 | |
30 | 30 | </label> |
31 | - <small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small> |
|
31 | + <small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small> |
|
32 | 32 | |
33 | 33 | <div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div> |
34 | 34 | |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | |
39 | 39 | <?php } |
40 | 40 | |
41 | - if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
41 | + if (lasso_user_can('publish_posts')): ?> |
|
42 | 42 | |
43 | 43 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" > |
44 | 44 | |
45 | 45 | <div class="ase-gallery-opts--single lasso-option"> |
46 | 46 | |
47 | - <label><?php _e( 'Create a Gallery', 'lasso' );?></label> |
|
47 | + <label><?php _e('Create a Gallery', 'lasso'); ?></label> |
|
48 | 48 | <small class="lasso-option-desc">Gallery Name:</small> |
49 | 49 | <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br> |
50 | 50 | |
51 | - <small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small> |
|
52 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a> |
|
51 | + <small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small> |
|
52 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a> |
|
53 | 53 | |
54 | 54 | <div id="ase-gallery-images"></div> |
55 | 55 | |
56 | - <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a> |
|
56 | + <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a> |
|
57 | 57 | |
58 | 58 | </div> |
59 | 59 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | <!-- Gallery Layout/Type Chooser --> |
65 | 65 | <div class="ase-gallery-opts ase-gallery-opts--type" > |
66 | 66 | <div data-option="gallery-type" class="ase-gallery-opts--single lasso-option"> |
67 | - <label><?php _e( 'Gallery Type', 'lasso' );?></label> |
|
68 | - <small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small> |
|
67 | + <label><?php _e('Gallery Type', 'lasso'); ?></label> |
|
68 | + <small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small> |
|
69 | 69 | <fieldset> |
70 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label> |
|
71 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label> |
|
70 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label> |
|
71 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label> |
|
72 | 72 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label> |
73 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label> |
|
74 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label> |
|
73 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label> |
|
74 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label> |
|
75 | 75 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label> |
76 | 76 | </fieldset> |
77 | 77 | </div> |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | <div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;"> |
82 | 82 | |
83 | 83 | <div data-option="itemwidth" class="ase-gallery-opts--single lasso-option"> |
84 | - <label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label> |
|
85 | - <small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small> |
|
84 | + <label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label> |
|
85 | + <small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small> |
|
86 | 86 | <input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value=""> |
87 | 87 | </div> |
88 | 88 | |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | <div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;"> |
93 | 93 | |
94 | 94 | <div data-option="transition" class="ase-gallery-opts--single lasso-option"> |
95 | - <label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label> |
|
96 | - <small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small> |
|
95 | + <label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label> |
|
96 | + <small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small> |
|
97 | 97 | <select name="lasso_thumb_gallery_transition" class="lasso-generator-attr"> |
98 | - <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option> |
|
99 | - <option value="slide"><?php _e( 'Slide', 'lasso' );?></option> |
|
100 | - <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option> |
|
98 | + <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option> |
|
99 | + <option value="slide"><?php _e('Slide', 'lasso'); ?></option> |
|
100 | + <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option> |
|
101 | 101 | </select> |
102 | 102 | </div> |
103 | 103 | |
104 | 104 | <div data-option="speed" class="ase-gallery-opts--single lasso-option"> |
105 | - <label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label> |
|
106 | - <small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small> |
|
105 | + <label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label> |
|
106 | + <small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small> |
|
107 | 107 | <input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value=""> |
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option"> |
111 | 111 | <input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs"> |
112 | - <label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label> |
|
112 | + <label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label> |
|
113 | 113 | </div> |
114 | 114 | |
115 | 115 | </div> |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | <div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;"> |
119 | 119 | |
120 | 120 | <div data-option="pslayout" class="ase-gallery-opts--single lasso-option"> |
121 | - <label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label> |
|
122 | - <small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small> |
|
121 | + <label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label> |
|
122 | + <small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small> |
|
123 | 123 | <input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value=""> |
124 | 124 | </div> |
125 | 125 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | <div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;"> |
135 | 135 | |
136 | 136 | <div data-option="height" class="ase-gallery-opts--single lasso-option"> |
137 | - <label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label> |
|
138 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
137 | + <label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label> |
|
138 | + <small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
139 | 139 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value=""> |
140 | 140 | </div> |
141 | 141 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | <div class="ase-gallery-opts ase-gallery-opts--global"> |
146 | 146 | |
147 | 147 | <div data-option="width" class="ase-gallery-opts--single lasso-option"> |
148 | - <label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label> |
|
149 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
148 | + <label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label> |
|
149 | + <small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
150 | 150 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value=""> |
151 | 151 | </div> |
152 | 152 | <div data-option="caption" class="ase-gallery-opts--single lasso-option"> |
153 | - <label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label> |
|
154 | - <small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small> |
|
153 | + <label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label> |
|
154 | + <small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small> |
|
155 | 155 | <textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea> |
156 | 156 | </div> |
157 | 157 |
@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | |
12 | 12 | public function __construct() { |
13 | 13 | |
14 | - $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
14 | + $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * Draw the modal used to house the walk through |
|
22 | - * @since 0.6 |
|
23 | - */ |
|
21 | + * Draw the modal used to house the walk through |
|
22 | + * @since 0.6 |
|
23 | + */ |
|
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | 26 | $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Draw the inner slides for the welcome walkthrough |
|
84 | - * @since 0.6 |
|
85 | - */ |
|
83 | + * Draw the inner slides for the welcome walkthrough |
|
84 | + * @since 0.6 |
|
85 | + */ |
|
86 | 86 | public function tour_slides() { ?> |
87 | 87 | |
88 | 88 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action('wp_footer', array($this, 'draw_tour')); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
@@ -23,34 +23,34 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | - $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
|
26 | + $tour_hidden = get_user_meta(get_current_user_ID(), 'lasso_hide_tour', true); |
|
27 | 27 | |
28 | - if ( lasso_user_can() && !$tour_hidden ) { |
|
28 | + if (lasso_user_can() && !$tour_hidden) { |
|
29 | 29 | |
30 | 30 | global $post; |
31 | 31 | |
32 | - $nonce = wp_create_nonce( 'lasso-editor-tour' ); |
|
32 | + $nonce = wp_create_nonce('lasso-editor-tour'); |
|
33 | 33 | |
34 | 34 | // let users add custom css classes |
35 | - $custom_classes = apply_filters( 'lasso_modal_tour_classes', '' ); |
|
35 | + $custom_classes = apply_filters('lasso_modal_tour_classes', ''); |
|
36 | 36 | |
37 | 37 | ?> |
38 | - <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class( $custom_classes );?>"> |
|
38 | + <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class($custom_classes); ?>"> |
|
39 | 39 | <div class="lasso--modal__inner"> |
40 | 40 | |
41 | - <?php echo self::tour_slides();?> |
|
41 | + <?php echo self::tour_slides(); ?> |
|
42 | 42 | |
43 | 43 | <div class="lasso--postsettings__footer"> |
44 | 44 | |
45 | 45 | <div class="lasso--postsettings__option"> |
46 | 46 | <label for="hide_tour" class="checkbox-control checkbox"> |
47 | - <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked( $tour_hidden, 1 ); ?>> |
|
47 | + <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked($tour_hidden, 1); ?>> |
|
48 | 48 | <span class="control-indicator"></span> |
49 | - <?php _e('Don\'t show this again','lasso');?> |
|
49 | + <?php _e('Don\'t show this again', 'lasso'); ?> |
|
50 | 50 | </label> |
51 | 51 | </div> |
52 | 52 | |
53 | - <input type="submit" value="<?php _e( 'Okay, got it!', 'lasso' );?>" data-nonce="<?php echo $nonce;?>" > |
|
53 | + <input type="submit" value="<?php _e('Okay, got it!', 'lasso'); ?>" data-nonce="<?php echo $nonce; ?>" > |
|
54 | 54 | </div> |
55 | 55 | |
56 | 56 | </div> |
@@ -74,20 +74,20 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | |
76 | 76 | $out = '<ul><li>'; |
77 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg' ); |
|
78 | - $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.','lasso').'</p>'; |
|
77 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg'); |
|
78 | + $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.', 'lasso').'</p>'; |
|
79 | 79 | $out .= '</li><li>'; |
80 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg' ); |
|
81 | - $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.','lasso').'</p>'; |
|
80 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg'); |
|
81 | + $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.', 'lasso').'</p>'; |
|
82 | 82 | $out .= '</li><li>'; |
83 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg' ); |
|
84 | - $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.','lasso').'</p>'; |
|
83 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg'); |
|
84 | + $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.', 'lasso').'</p>'; |
|
85 | 85 | $out .= '</li><li>'; |
86 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg' ); |
|
87 | - $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.','lasso').'</p>'; |
|
86 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg'); |
|
87 | + $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.', 'lasso').'</p>'; |
|
88 | 88 | $out .= '</li></ul>'; |
89 | 89 | |
90 | - echo apply_filters( 'lasso_tour_slides', $out ); |
|
90 | + echo apply_filters('lasso_tour_slides', $out); |
|
91 | 91 | |
92 | 92 | ?></div><?php |
93 | 93 |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | 13 | if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | - // using rest api v1 |
|
14 | + if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | + // using rest api v1 |
|
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php |
32 | 32 | } else { |
33 | 33 | // using rest api v2 |
34 | - ?> |
|
34 | + ?> |
|
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | 37 | <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </li> |
48 | 48 | </script> |
49 | 49 | <?php |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( !function_exists( 'lasso_backbone_templates' ) ): |
|
3 | +if (!function_exists('lasso_backbone_templates')): |
|
4 | 4 | |
5 | 5 | add_action('wp_footer', 'lasso_backbone_templates'); |
6 | - function lasso_backbone_templates(){ |
|
6 | + function lasso_backbone_templates() { |
|
7 | 7 | |
8 | 8 | $can_delete = lasso_user_can('delete_others_posts'); |
9 | 9 | $can_delete_class = $can_delete ? false : 'no-delete'; |
10 | 10 | |
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | - if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
|
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
13 | + if (is_user_logged_in() && lasso_user_can('edit_posts')) { |
|
14 | + if (!class_exists('WP_REST_Controller')) { |
|
15 | 15 | // using rest api v1 |
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
19 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
19 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
20 | 20 | <%= post.title %> |
21 | 21 | |
22 | 22 | <div class="lasso--post-list__controls"> |
23 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
24 | - <?php if( $can_delete ): ?> |
|
25 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
23 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
24 | + <?php if ($can_delete): ?> |
|
25 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
26 | 26 | <?php endif; ?> |
27 | 27 | </div> |
28 | 28 | </a> |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | ?> |
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
37 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
38 | 38 | <%= post.title.rendered %> |
39 | 39 | |
40 | 40 | <div class="lasso--post-list__controls"> |
41 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
42 | - <?php if( $can_delete ): ?> |
|
43 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
41 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
42 | + <?php if ($can_delete): ?> |
|
43 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
44 | 44 | <?php endif; ?> |
45 | 45 | </div> |
46 | 46 | </a> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $postid = get_the_ID(); |
69 | 69 | |
70 | 70 | $post_date = get_the_time('U', $postid); |
71 | - $delta = time() - $post_date; |
|
71 | + $delta = time() - $post_date; |
|
72 | 72 | |
73 | 73 | $strings = array( |
74 | 74 | 'save' => __('Save','lasso'), |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | |
195 | 195 | if (!$using_restapiv2) { |
196 | - // enqueue REST API V1 |
|
196 | + // enqueue REST API V1 |
|
197 | 197 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
198 | 198 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
199 | 199 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | if ($show_color) { |
204 | 204 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true); |
205 | 205 | } else { |
206 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
206 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
207 | 207 | } |
208 | 208 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
209 | 209 |
@@ -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,21 +33,21 @@ 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'); |
|
48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | 49 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
50 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
50 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
51 | 51 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
52 | 52 | |
53 | 53 | |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | |
60 | 60 | if ($show_color) { |
61 | 61 | //color picker |
62 | - wp_enqueue_style( 'wp-color-picker' ); |
|
63 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
62 | + wp_enqueue_style('wp-color-picker'); |
|
63 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
@@ -72,59 +72,59 @@ discard block |
||
72 | 72 | $delta = time() - $post_date; |
73 | 73 | |
74 | 74 | $strings = array( |
75 | - 'save' => __('Save','lasso'), |
|
76 | - 'saving' => __('Saving...','lasso'), |
|
77 | - 'saved' => __('Saved!','lasso'), |
|
78 | - 'adding' => __('Adding...','lasso'), |
|
79 | - 'added' => __('Added!','lasso'), |
|
80 | - 'loading' => __('Loading...','lasso'), |
|
81 | - 'loadMore' => __('Load More','lasso'), |
|
82 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
83 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
84 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
85 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
86 | - 'justWrite' => __('Just write...','lasso'), |
|
87 | - 'chooseImage' => __('Choose an image','lasso'), |
|
88 | - 'updateImage' => __('Update Image','lasso'), |
|
89 | - 'insertImage' => __('Insert Image','lasso'), |
|
90 | - 'selectImage' => __('Select Image','lasso'), |
|
91 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
92 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
93 | - 'chooseImages' => __('Choose images','lasso'), |
|
94 | - 'editImage' => __('Edit Image','lasso'), |
|
95 | - 'addImages' => __('Add Images','lasso'), |
|
96 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
97 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
98 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
99 | - 'publishPost' => __('Publish Post?','lasso'), |
|
100 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
101 | - 'deletePost' => __('Trash Post?','lasso'), |
|
102 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
103 | - 'warning' => __('Oh snap!','laso'), |
|
104 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
105 | - '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'), |
|
75 | + 'save' => __('Save', 'lasso'), |
|
76 | + 'saving' => __('Saving...', 'lasso'), |
|
77 | + 'saved' => __('Saved!', 'lasso'), |
|
78 | + 'adding' => __('Adding...', 'lasso'), |
|
79 | + 'added' => __('Added!', 'lasso'), |
|
80 | + 'loading' => __('Loading...', 'lasso'), |
|
81 | + 'loadMore' => __('Load More', 'lasso'), |
|
82 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
83 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
84 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
85 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
86 | + 'justWrite' => __('Just write...', 'lasso'), |
|
87 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
88 | + 'updateImage' => __('Update Image', 'lasso'), |
|
89 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
90 | + 'selectImage' => __('Select Image', 'lasso'), |
|
91 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
92 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
93 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
94 | + 'editImage' => __('Edit Image', 'lasso'), |
|
95 | + 'addImages' => __('Add Images', 'lasso'), |
|
96 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
97 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
98 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
99 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
100 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
101 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
102 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
103 | + 'warning' => __('Oh snap!', 'laso'), |
|
104 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
105 | + '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'), |
|
106 | 106 | 'missingConfirm' => __('Update Settings', 'lasso'), |
107 | - 'helperText' => __('one more letter','lasso'), |
|
107 | + 'helperText' => __('one more letter', 'lasso'), |
|
108 | 108 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
109 | 109 | ); |
110 | 110 | |
111 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
111 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
112 | 112 | |
113 | 113 | $gallery_class = new gallery(); |
114 | 114 | $gallery_nonce_action = $gallery_class->nonce_action; |
115 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
115 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
116 | 116 | $rest_nonce = ''; |
117 | - $rest_root =''; |
|
117 | + $rest_root = ''; |
|
118 | 118 | if (function_exists('rest_url')) { |
119 | - $rest_root = esc_url_raw( rest_url()); |
|
120 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
121 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
119 | + $rest_root = esc_url_raw(rest_url()); |
|
120 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
121 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
122 | 122 | //wp_enqueue_script( 'wp-api' ); |
123 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
124 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
125 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
123 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
124 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
125 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
126 | 126 | |
127 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
127 | + if (class_exists('WP_REST_Controller')) { |
|
128 | 128 | // we are using REST API V2 |
129 | 129 | $using_restapiv2 = true; |
130 | 130 | } |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | |
133 | 133 | // localized objects |
134 | 134 | $objects = array( |
135 | - 'ajaxurl' => esc_url( $api_url ), |
|
136 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
135 | + 'ajaxurl' => esc_url($api_url), |
|
136 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
137 | 137 | 'rest_root' => $rest_root, |
138 | 138 | 'rest_nonce' => $rest_nonce, |
139 | 139 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | 'featImgClass' => $featImgClass, |
142 | 142 | 'titleClass' => $titleClass, |
143 | 143 | 'strings' => $strings, |
144 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
145 | - 'post_status' => get_post_status( $postid ), |
|
144 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
145 | + 'post_status' => get_post_status($postid), |
|
146 | 146 | 'postid' => $postid, |
147 | 147 | 'permalink' => get_permalink(), |
148 | 148 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
149 | 149 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
150 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
150 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
151 | 151 | 'can_publish_posts' => current_user_can('publish_posts'), |
152 | 152 | 'can_publish_pages' => current_user_can('publish_pages'), |
153 | 153 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -181,20 +181,20 @@ discard block |
||
181 | 181 | 'postTags' => lasso_get_objects('tag'), |
182 | 182 | 'noResultsDiv' => lasso_editor_empty_results(), |
183 | 183 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
184 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
185 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
186 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
187 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
184 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
185 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
186 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
187 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
188 | 188 | 'revisionModal' => lasso_editor_revision_modal(), |
189 | 189 | 'isMobile' => wp_is_mobile(), |
190 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
190 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
191 | 191 | 'showColor' => $show_color, |
192 | 192 | 'showAlignment' => $show_align, |
193 | 193 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
194 | 194 | 'restapi2' => $using_restapiv2, |
195 | 195 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
196 | - 'newObjectContent' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ), |
|
197 | - 'skipToEdit' =>( $delta < 30 ) // if it's a new post, skip to edit mode |
|
196 | + 'newObjectContent' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')), |
|
197 | + 'skipToEdit' =>($delta < 30) // if it's a new post, skip to edit mode |
|
198 | 198 | ); |
199 | 199 | |
200 | 200 | |
@@ -203,18 +203,18 @@ discard block |
||
203 | 203 | |
204 | 204 | if (!$using_restapiv2) { |
205 | 205 | // enqueue REST API V1 |
206 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
207 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
208 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
206 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
207 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
208 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
209 | 209 | } |
210 | 210 | |
211 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
211 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
212 | 212 | if ($show_color) { |
213 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true); |
|
213 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'iris'), LASSO_VERSION, true); |
|
214 | 214 | } else { |
215 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
215 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
216 | 216 | } |
217 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
217 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
218 | 218 | |
219 | 219 | |
220 | 220 | } |
@@ -163,6 +163,9 @@ |
||
163 | 163 | return $content; |
164 | 164 | } |
165 | 165 | |
166 | + /** |
|
167 | + * @param string $content |
|
168 | + */ |
|
166 | 169 | protected function remove_comments($content) { |
167 | 170 | return preg_replace('/<!--(.*)-->/Uis', '', $content); |
168 | 171 | } |
@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | protected function replace_rendered_shortcodes( $content ) { |
148 | 148 | //debug line |
149 | - //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
149 | + //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
150 | 150 | |
151 | 151 | |
152 | 152 | if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
@@ -19,27 +19,27 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return bool Always returns true. |
21 | 21 | */ |
22 | - public function content( $data ) { |
|
22 | + public function content($data) { |
|
23 | 23 | |
24 | 24 | $save_to_post_disabled = $this->save_to_post_disables(); |
25 | 25 | |
26 | - $postid = (int) $data[ 'post_id' ]; |
|
27 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
28 | - $content = $this->remove_comments( $content ); |
|
26 | + $postid = (int) $data['post_id']; |
|
27 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
28 | + $content = $this->remove_comments($content); |
|
29 | 29 | |
30 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
30 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
31 | 31 | |
32 | 32 | $args = array( |
33 | 33 | 'ID' => (int) $postid, |
34 | 34 | 'post_content' => $content |
35 | 35 | ); |
36 | 36 | |
37 | - wp_update_post( apply_filters( 'lasso_object_save_args', $args ) ); |
|
37 | + wp_update_post(apply_filters('lasso_object_save_args', $args)); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | 41 | // run save action |
42 | - do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() ); |
|
42 | + do_action('lasso_post_saved', $postid, $content, get_current_user_ID()); |
|
43 | 43 | |
44 | 44 | return true; |
45 | 45 | |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return bool Always returns true. |
56 | 56 | */ |
57 | - public function publish_content( $data ) { |
|
57 | + public function publish_content($data) { |
|
58 | 58 | $save_to_post_disabled = $this->save_to_post_disables(); |
59 | 59 | |
60 | - $postid = (int) $data[ 'post_id' ]; |
|
61 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
62 | - $content = $this->remove_comments( $content ); |
|
60 | + $postid = (int) $data['post_id']; |
|
61 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
62 | + $content = $this->remove_comments($content); |
|
63 | 63 | |
64 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
64 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
65 | 65 | |
66 | - $args = array ( |
|
66 | + $args = array( |
|
67 | 67 | 'ID' => $postid, |
68 | 68 | 'post_content' => $content, |
69 | 69 | 'post_status' => 'publish' |
70 | 70 | ); |
71 | - wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) ); |
|
71 | + wp_update_post(apply_filters('lasso_object_publish_args', $args)); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | - do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() ); |
|
75 | + do_action('lasso_post_published', $postid, $content, get_current_user_ID()); |
|
76 | 76 | |
77 | 77 | return true; |
78 | 78 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
87 | 87 | */ |
88 | - public static function params(){ |
|
89 | - $params[ 'process_save_content' ] = array( |
|
88 | + public static function params() { |
|
89 | + $params['process_save_content'] = array( |
|
90 | 90 | 'post_id' => 'absint', |
91 | 91 | 'content' => 'wp_kses_post' |
92 | 92 | ); |
93 | 93 | |
94 | - $params[ 'process_save_publish_content' ] = array( |
|
94 | + $params['process_save_publish_content'] = array( |
|
95 | 95 | 'post_id' => 'absint', |
96 | 96 | 'content' => 'wp_kses_post' |
97 | 97 | ); |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * @return array Array of additional functions to use to authorize action. |
108 | 108 | */ |
109 | 109 | public static function auth_callbacks() { |
110 | - $params[ 'process_save_content' ] = array( |
|
110 | + $params['process_save_content'] = array( |
|
111 | 111 | 'lasso_user_can' |
112 | 112 | ); |
113 | 113 | |
114 | - $params[ 'process_save_publish_content' ] = array(); |
|
114 | + $params['process_save_publish_content'] = array(); |
|
115 | 115 | |
116 | 116 | return $params; |
117 | 117 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @return bool |
128 | 128 | */ |
129 | 129 | protected function save_to_post_disables() { |
130 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
130 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
131 | 131 | |
132 | 132 | return $save_to_post_disabled; |
133 | 133 | |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @return string |
146 | 146 | */ |
147 | - protected function replace_rendered_shortcodes( $content ) { |
|
147 | + protected function replace_rendered_shortcodes($content) { |
|
148 | 148 | //debug line |
149 | 149 | //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
150 | 150 | |
151 | 151 | |
152 | - if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
|
152 | + if (false === strpos($content, '--EDITUS_OTHER_SHORTCODE_START|')) { |
|
153 | 153 | return $content; |
154 | 154 | } |
155 | - $content = htmlspecialchars_decode ($content); |
|
155 | + $content = htmlspecialchars_decode($content); |
|
156 | 156 | |
157 | 157 | $content = preg_replace( |
158 | 158 | '/<!--EDITUS_OTHER_SHORTCODE_START\|\[(.*?)\]-->(.*?)<!--EDITUS_OTHER_SHORTCODE_END-->/s', |
@@ -107,8 +107,9 @@ discard block |
||
107 | 107 | |
108 | 108 | ob_start(); |
109 | 109 | |
110 | - if ( !lasso_user_can() ) |
|
111 | - return; |
|
110 | + if ( !lasso_user_can() ) { |
|
111 | + return; |
|
112 | + } |
|
112 | 113 | |
113 | 114 | // let users add custom css classes |
114 | 115 | $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
@@ -131,8 +132,9 @@ discard block |
||
131 | 132 | |
132 | 133 | ob_start(); |
133 | 134 | |
134 | - if ( !lasso_user_can() ) |
|
135 | - return; |
|
135 | + if ( !lasso_user_can() ) { |
|
136 | + return; |
|
137 | + } |
|
136 | 138 | |
137 | 139 | $is_mobile = wp_is_mobile(); |
138 | 140 | |
@@ -199,8 +201,11 @@ discard block |
||
199 | 201 | <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
200 | 202 | <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
201 | 203 | <?php }?> |
202 | - <?php else: ?> |
|
203 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
204 | + <?php else { |
|
205 | + : ?> |
|
206 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
207 | +} |
|
208 | +?>" class="image lasso-toolbar--component__image"></li> |
|
204 | 209 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
205 | 210 | <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
206 | 211 | <?php endif; ?> |
@@ -255,8 +260,9 @@ discard block |
||
255 | 260 | |
256 | 261 | ob_start(); |
257 | 262 | |
258 | - if ( !lasso_user_can() ) |
|
259 | - return; |
|
263 | + if ( !lasso_user_can() ) { |
|
264 | + return; |
|
265 | + } |
|
260 | 266 | |
261 | 267 | // let users add custom css classes |
262 | 268 | $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
@@ -282,8 +288,9 @@ discard block |
||
282 | 288 | |
283 | 289 | ob_start(); |
284 | 290 | |
285 | - if ( !lasso_user_can() ) |
|
286 | - return; |
|
291 | + if ( !lasso_user_can() ) { |
|
292 | + return; |
|
293 | + } |
|
287 | 294 | |
288 | 295 | // has post thumbnail |
289 | 296 | $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
@@ -311,8 +318,9 @@ discard block |
||
311 | 318 | |
312 | 319 | ob_start(); |
313 | 320 | |
314 | - if ( !lasso_user_can() ) |
|
315 | - return; |
|
321 | + if ( !lasso_user_can() ) { |
|
322 | + return; |
|
323 | + } |
|
316 | 324 | |
317 | 325 | global $post; |
318 | 326 | |
@@ -442,8 +450,9 @@ discard block |
||
442 | 450 | |
443 | 451 | ob_start(); |
444 | 452 | |
445 | - if ( !lasso_user_can('edit_posts') ) |
|
446 | - return; |
|
453 | + if ( !lasso_user_can('edit_posts') ) { |
|
454 | + return; |
|
455 | + } |
|
447 | 456 | |
448 | 457 | $status = get_post_status( get_the_ID() ); |
449 | 458 | |
@@ -572,8 +581,9 @@ discard block |
||
572 | 581 | |
573 | 582 | ob_start(); |
574 | 583 | |
575 | - if ( !lasso_user_can() ) |
|
576 | - return; |
|
584 | + if ( !lasso_user_can() ) { |
|
585 | + return; |
|
586 | + } |
|
577 | 587 | |
578 | 588 | // let users add custom css classes |
579 | 589 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -593,8 +603,9 @@ discard block |
||
593 | 603 | |
594 | 604 | ob_start(); |
595 | 605 | |
596 | - if ( !lasso_user_can() ) |
|
597 | - return; |
|
606 | + if ( !lasso_user_can() ) { |
|
607 | + return; |
|
608 | + } |
|
598 | 609 | |
599 | 610 | // let users add custom css classes |
600 | 611 | $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
@@ -665,8 +676,9 @@ discard block |
||
665 | 676 | |
666 | 677 | $blob = array(); |
667 | 678 | |
668 | - if ( empty( $codes ) ) |
|
669 | - return; |
|
679 | + if ( empty( $codes ) ) { |
|
680 | + return; |
|
681 | + } |
|
670 | 682 | |
671 | 683 | foreach ( $codes as $slug => $shortcode ) { |
672 | 684 | $return = ''; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
151 | 151 | |
152 | 152 | // mobile styles |
153 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
153 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
154 | 154 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
155 | 155 | |
156 | 156 | //show color |
@@ -529,8 +529,8 @@ discard block |
||
529 | 529 | global $post; |
530 | 530 | |
531 | 531 | global $wp_post_types; |
532 | - $labels = &$wp_post_types['post']->labels; |
|
533 | - $labels->name = 'Articles'; |
|
532 | + $labels = &$wp_post_types['post']->labels; |
|
533 | + $labels->name = 'Articles'; |
|
534 | 534 | |
535 | 535 | ob_start(); |
536 | 536 |
@@ -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,25 +133,25 @@ 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' ); |
|
148 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
149 | 149 | |
150 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
150 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
151 | 151 | |
152 | 152 | // mobile styles |
153 | 153 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
154 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
154 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
155 | 155 | |
156 | 156 | //show color |
157 | 157 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -159,94 +159,94 @@ discard block |
||
159 | 159 | //show alignment |
160 | 160 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
161 | 161 | |
162 | - $status = get_post_status( get_the_ID() ); |
|
162 | + $status = get_post_status(get_the_ID()); |
|
163 | 163 | |
164 | 164 | |
165 | 165 | ?> |
166 | - <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 ?>> |
|
167 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
168 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
169 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
170 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
171 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
172 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
173 | - <?php if ( $toolbar_headings ): ?> |
|
174 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
175 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
166 | + <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 ?>> |
|
167 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
168 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
169 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
170 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
171 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
172 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
173 | + <?php if ($toolbar_headings): ?> |
|
174 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
175 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
176 | 176 | <?php endif; ?> |
177 | 177 | |
178 | - <?php if ( $show_color ): ?> |
|
179 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li> |
|
180 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
178 | + <?php if ($show_color): ?> |
|
179 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li> |
|
180 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
181 | 181 | <?php endif; ?> |
182 | 182 | |
183 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>"> |
|
183 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>"> |
|
184 | 184 | <ul id="lasso-toolbar--components__list" style="display:none;"> |
185 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
186 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
187 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
188 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
189 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
190 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
191 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
192 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
193 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
194 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
195 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
196 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
197 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
198 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
199 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
200 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
185 | + <?php if ('ase-active' == $ase_status): ?> |
|
186 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
187 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
188 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
189 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
190 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
191 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
192 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
193 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
194 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
195 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
196 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
197 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
198 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
199 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
200 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
201 | 201 | <?php }?> |
202 | 202 | <?php else: ?> |
203 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
204 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
205 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
203 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
204 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
205 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
206 | 206 | <?php endif; ?> |
207 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
207 | + <?php do_action('lasso_toolbar_components'); ?> |
|
208 | 208 | </ul> |
209 | 209 | </li> |
210 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
210 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
211 | 211 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
212 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
213 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
212 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
213 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
214 | 214 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
215 | 215 | <label for="aesop-toolbar--link_newtab">Open in Another Tab</label> |
216 | 216 | </div> |
217 | 217 | </li> |
218 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
219 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>"> |
|
218 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
219 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>"> |
|
220 | 220 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
221 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
221 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
222 | 222 | <div id="lasso-toolbar--html__footer"> |
223 | 223 | <ul class="lasso-toolbar--html-snips"> |
224 | - <?php if ( !$toolbar_headings ): ?> |
|
225 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
226 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
224 | + <?php if (!$toolbar_headings): ?> |
|
225 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
226 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
227 | 227 | <?php endif; ?> |
228 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
229 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
228 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
229 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
230 | 230 | </ul> |
231 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
232 | - <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> |
|
231 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
232 | + <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> |
|
233 | 233 | </div> |
234 | 234 | </div> |
235 | 235 | </li> |
236 | - <?php if ( $show_align ): ?> |
|
237 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
238 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
239 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
236 | + <?php if ($show_align): ?> |
|
237 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
238 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
239 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
240 | 240 | <?php endif; ?> |
241 | 241 | </ul> |
242 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
242 | + <?php if (is_singular() && $is_mobile) { ?> |
|
243 | 243 | |
244 | - <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;"> |
|
244 | + <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;"> |
|
245 | 245 | |
246 | - <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> |
|
246 | + <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> |
|
247 | 247 | |
248 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
249 | - <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> |
|
248 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
249 | + <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> |
|
250 | 250 | <?php } ?> |
251 | 251 | |
252 | 252 | </div> |
@@ -264,22 +264,22 @@ discard block |
||
264 | 264 | */ |
265 | 265 | function lasso_editor_settings_toolbar() { |
266 | 266 | |
267 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
267 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
268 | 268 | |
269 | 269 | ob_start(); |
270 | 270 | |
271 | - if ( !lasso_user_can() ) |
|
271 | + if (!lasso_user_can()) |
|
272 | 272 | return; |
273 | 273 | |
274 | 274 | // let users add custom css classes |
275 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
275 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
276 | 276 | |
277 | 277 | ?> |
278 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
279 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
280 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
281 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
282 | - <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> |
|
278 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
279 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
280 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
281 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
282 | + <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> |
|
283 | 283 | </ul> |
284 | 284 | |
285 | 285 | <?php return ob_get_clean(); |
@@ -295,17 +295,17 @@ discard block |
||
295 | 295 | |
296 | 296 | ob_start(); |
297 | 297 | |
298 | - if ( !lasso_user_can() ) |
|
298 | + if (!lasso_user_can()) |
|
299 | 299 | return; |
300 | 300 | |
301 | 301 | // has post thumbnail |
302 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
302 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
303 | 303 | |
304 | 304 | ?> |
305 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
306 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
307 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
308 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
305 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
306 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
307 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
308 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
309 | 309 | </ul> |
310 | 310 | |
311 | 311 | <?php return ob_get_clean(); |
@@ -324,55 +324,55 @@ discard block |
||
324 | 324 | |
325 | 325 | ob_start(); |
326 | 326 | |
327 | - if ( !lasso_user_can() ) |
|
327 | + if (!lasso_user_can()) |
|
328 | 328 | return; |
329 | 329 | |
330 | 330 | global $post; |
331 | 331 | |
332 | 332 | $postid = get_the_ID(); |
333 | 333 | |
334 | - $status = get_post_status( $postid ); |
|
335 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
334 | + $status = get_post_status($postid); |
|
335 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
336 | 336 | |
337 | 337 | // let users add custom css classes |
338 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
338 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
339 | 339 | |
340 | 340 | // objects categories |
341 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
342 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
341 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
342 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
343 | 343 | |
344 | 344 | // modal tabs |
345 | - $tabs = lasso_modal_addons('tab'); |
|
346 | - $content = lasso_modal_addons('content'); |
|
345 | + $tabs = lasso_modal_addons('tab'); |
|
346 | + $content = lasso_modal_addons('content'); |
|
347 | 347 | |
348 | 348 | // are we singular |
349 | - $is_singular = is_singular(); |
|
349 | + $is_singular = is_singular(); |
|
350 | 350 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
351 | 351 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
352 | 352 | $theme_supports = current_theme_supports('post-thumbnails'); |
353 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
353 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
354 | 354 | |
355 | 355 | ?> |
356 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
356 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
357 | 357 | <div class="lasso--modal__inner"> |
358 | 358 | |
359 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
359 | + <?php if ($tabs) { echo $tabs; } ?> |
|
360 | 360 | |
361 | 361 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
362 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
362 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
363 | 363 | |
364 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
364 | + <?php if ($is_singular && $theme_supports) : ?> |
|
365 | 365 | <div class="lasso--postsettings__left"> |
366 | - <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> |
|
367 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
366 | + <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> |
|
367 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
368 | 368 | |
369 | 369 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
370 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
371 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
370 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
371 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
372 | 372 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
373 | 373 | </div> |
374 | 374 | |
375 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
375 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
376 | 376 | |
377 | 377 | </div> |
378 | 378 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -382,12 +382,12 @@ discard block |
||
382 | 382 | |
383 | 383 | <div class="lasso--postsettings__right"> |
384 | 384 | |
385 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
385 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
386 | 386 | <div class="lasso--postsettings__option story-status-option"> |
387 | - <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> |
|
388 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
389 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
390 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
387 | + <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> |
|
388 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
389 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
390 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
391 | 391 | </ul> |
392 | 392 | <div class="lasso--slider_wrap"> |
393 | 393 | <div id="lasso--slider"></div> |
@@ -395,10 +395,10 @@ discard block |
||
395 | 395 | </div> |
396 | 396 | <?php endif; ?> |
397 | 397 | |
398 | - <?php if ( 'publish' == $status ): ?> |
|
398 | + <?php if ('publish' == $status): ?> |
|
399 | 399 | <div class="lasso--postsettings__option story-slug-option"> |
400 | - <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> |
|
401 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
400 | + <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> |
|
401 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
402 | 402 | </div> |
403 | 403 | <?php endif; ?> |
404 | 404 | |
@@ -407,34 +407,34 @@ discard block |
||
407 | 407 | <div class="lasso--postsettings__middle"> |
408 | 408 | |
409 | 409 | <div class="lasso--postsettings__option story-categories-option"> |
410 | - <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> |
|
411 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
410 | + <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> |
|
411 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
412 | 412 | </div> |
413 | 413 | |
414 | 414 | <div class="lasso--postsettings__option story-tags-option"> |
415 | - <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> |
|
416 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
415 | + <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> |
|
416 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
417 | 417 | </div> |
418 | 418 | |
419 | 419 | </div> |
420 | 420 | |
421 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
421 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
422 | 422 | |
423 | 423 | <div class="lasso--postsettings__footer" style="display:none;"> |
424 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
424 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
425 | 425 | <input type="hidden" name="status" value=""> |
426 | 426 | <input type="hidden" name="categories" value=""> |
427 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
427 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
428 | 428 | <input type="hidden" name="action" value="process_update-object_post"> |
429 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
430 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
431 | - <input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
429 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
430 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
431 | + <input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
432 | 432 | </div> |
433 | 433 | |
434 | 434 | </form> |
435 | 435 | </div> |
436 | 436 | |
437 | - <?php if( $tabs ) { echo $content; } ?> |
|
437 | + <?php if ($tabs) { echo $content; } ?> |
|
438 | 438 | |
439 | 439 | </div> |
440 | 440 | |
@@ -455,44 +455,44 @@ discard block |
||
455 | 455 | |
456 | 456 | ob_start(); |
457 | 457 | |
458 | - if ( !lasso_user_can('edit_posts') ) |
|
458 | + if (!lasso_user_can('edit_posts')) |
|
459 | 459 | return; |
460 | 460 | |
461 | - $status = get_post_status( get_the_ID() ); |
|
461 | + $status = get_post_status(get_the_ID()); |
|
462 | 462 | |
463 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
463 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
464 | 464 | |
465 | 465 | // let users add custom css classes |
466 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
466 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
467 | 467 | |
468 | 468 | // return the post type |
469 | - $type = get_post_type( get_the_ID() ); |
|
469 | + $type = get_post_type(get_the_ID()); |
|
470 | 470 | |
471 | 471 | if (wp_is_mobile()) { |
472 | 472 | $mobile_style = 'style="top:140px !important;"'; |
473 | 473 | } |
474 | 474 | ?> |
475 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
475 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
476 | 476 | <div class="lasso--modal__inner"> |
477 | 477 | |
478 | 478 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
479 | 479 | |
480 | 480 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
481 | - <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> |
|
482 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>"> |
|
481 | + <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> |
|
482 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>"> |
|
483 | 483 | <div class="lasso--select-wrap" style="width:90px"> |
484 | 484 | <select id="lasso--select-type" name="story_type"> |
485 | 485 | |
486 | 486 | <?php |
487 | 487 | $types = lasso_post_types(); |
488 | 488 | |
489 | - if ( !empty( $types ) ) { |
|
489 | + if (!empty($types)) { |
|
490 | 490 | |
491 | - foreach( $types as $type ) { |
|
491 | + foreach ($types as $type) { |
|
492 | 492 | |
493 | - $type = preg_replace( '/s\b/','', $type ); |
|
493 | + $type = preg_replace('/s\b/', '', $type); |
|
494 | 494 | |
495 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) ); |
|
495 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type))); |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | } |
@@ -502,12 +502,12 @@ discard block |
||
502 | 502 | </div> |
503 | 503 | </div> |
504 | 504 | |
505 | - <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>"> |
|
506 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
505 | + <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>"> |
|
506 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
507 | 507 | <input type="hidden" name="action" value="process_new-object_post"> |
508 | 508 | <input type="hidden" name="object" value="post"> |
509 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
510 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
509 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
510 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
511 | 511 | </div> |
512 | 512 | |
513 | 513 | </form> |
@@ -535,18 +535,18 @@ discard block |
||
535 | 535 | ob_start(); |
536 | 536 | |
537 | 537 | // post status |
538 | - $status = get_post_status( get_the_ID() ); |
|
538 | + $status = get_post_status(get_the_ID()); |
|
539 | 539 | |
540 | 540 | // let users add custom css classes |
541 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
541 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
542 | 542 | |
543 | 543 | ?> |
544 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
544 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
545 | 545 | <div class="lasso--modal__inner"> |
546 | 546 | |
547 | 547 | <div class="lasso--post-filtering not-visible"> |
548 | 548 | <div class="lasso--search__results"> |
549 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
549 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
550 | 550 | </div> |
551 | 551 | <div class="lasso--search"> |
552 | 552 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -559,18 +559,18 @@ discard block |
||
559 | 559 | |
560 | 560 | $post_types = lasso_post_types_names(); |
561 | 561 | |
562 | - if ( ! empty( $post_types ) ) { |
|
562 | + if (!empty($post_types)) { |
|
563 | 563 | $first = 'active'; |
564 | - foreach( $post_types as $name => $label ) { |
|
564 | + foreach ($post_types as $name => $label) { |
|
565 | 565 | //printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $name ), esc_attr( $label ) ); |
566 | 566 | //print_r($post_types); |
567 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $name ), esc_attr( $label ) ); |
|
567 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($name), esc_attr($label)); |
|
568 | 568 | $first = ''; |
569 | 569 | } |
570 | 570 | |
571 | 571 | } |
572 | 572 | |
573 | - do_action('lasso_modal_post_objects');?> |
|
573 | + do_action('lasso_modal_post_objects'); ?> |
|
574 | 574 | |
575 | 575 | </ul> |
576 | 576 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -588,18 +588,18 @@ discard block |
||
588 | 588 | |
589 | 589 | ob_start(); |
590 | 590 | |
591 | - if ( !lasso_user_can() ) |
|
591 | + if (!lasso_user_can()) |
|
592 | 592 | return; |
593 | 593 | |
594 | 594 | // let users add custom css classes |
595 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
595 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
596 | 596 | |
597 | 597 | ?> |
598 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
599 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
600 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
601 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
602 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
598 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
599 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
600 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
601 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
602 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
603 | 603 | </ul> |
604 | 604 | |
605 | 605 | <?php return ob_get_clean(); |
@@ -609,18 +609,18 @@ discard block |
||
609 | 609 | |
610 | 610 | ob_start(); |
611 | 611 | |
612 | - if ( !lasso_user_can() ) |
|
612 | + if (!lasso_user_can()) |
|
613 | 613 | return; |
614 | 614 | |
615 | 615 | // let users add custom css classes |
616 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
616 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
617 | 617 | |
618 | 618 | ?> |
619 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
620 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
621 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
622 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
623 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
619 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
620 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
621 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
622 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
623 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
624 | 624 | </ul> |
625 | 625 | |
626 | 626 | <?php return ob_get_clean(); |
@@ -633,16 +633,16 @@ discard block |
||
633 | 633 | */ |
634 | 634 | function lasso_map_form_footer() { |
635 | 635 | |
636 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
636 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
637 | 637 | |
638 | 638 | ob_start(); |
639 | 639 | |
640 | 640 | ?> |
641 | 641 | <div class="lasso--map-form__footer"> |
642 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
643 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
642 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
643 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
644 | 644 | <input type="hidden" name="action" value="process_map_save"> |
645 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
645 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
646 | 646 | </div> |
647 | 647 | |
648 | 648 | <?php return ob_get_clean(); |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | |
661 | 661 | ?> |
662 | 662 | <div id="lasso--pagerefresh" class="visible"> |
663 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
663 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
664 | 664 | </div> |
665 | 665 | |
666 | 666 | <?php return ob_get_clean(); |
@@ -674,43 +674,43 @@ discard block |
||
674 | 674 | */ |
675 | 675 | function lasso_editor_options_blob() { |
676 | 676 | |
677 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
678 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
677 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
678 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
679 | 679 | |
680 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
680 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
681 | 681 | |
682 | 682 | $blob = array(); |
683 | 683 | |
684 | - if ( empty( $codes ) ) |
|
684 | + if (empty($codes)) |
|
685 | 685 | return; |
686 | 686 | |
687 | - foreach ( $codes as $slug => $shortcode ) { |
|
687 | + foreach ($codes as $slug => $shortcode) { |
|
688 | 688 | $return = ''; |
689 | 689 | // Shortcode has atts |
690 | 690 | |
691 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
691 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
692 | 692 | |
693 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
693 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
694 | 694 | |
695 | 695 | |
696 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
696 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
697 | 697 | |
698 | 698 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
699 | 699 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">'; |
700 | - $return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
700 | + $return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
701 | 701 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
702 | 702 | // Select |
703 | 703 | |
704 | - if ( isset( $attr_info['values'] ) ) { |
|
704 | + if (isset($attr_info['values'])) { |
|
705 | 705 | |
706 | - $return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
706 | + $return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
707 | 707 | |
708 | - $i=0; |
|
708 | + $i = 0; |
|
709 | 709 | |
710 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
710 | + foreach ($attr_info['values'] as $attr_value) { |
|
711 | 711 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
712 | 712 | |
713 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
713 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
714 | 714 | |
715 | 715 | $i++; |
716 | 716 | } |
@@ -719,24 +719,24 @@ discard block |
||
719 | 719 | |
720 | 720 | } else { |
721 | 721 | |
722 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
722 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
723 | 723 | |
724 | 724 | // image upload |
725 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
725 | + if ('media_upload' == $attr_info['type']) { |
|
726 | 726 | |
727 | - $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.'" />'; |
|
727 | + $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.'" />'; |
|
728 | 728 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
729 | 729 | |
730 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
730 | + } elseif ('color' == $attr_info['type']) { |
|
731 | 731 | |
732 | - $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.'" />'; |
|
732 | + $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.'" />'; |
|
733 | 733 | |
734 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
734 | + } elseif ('text_area' == $attr_info['type']) { |
|
735 | 735 | |
736 | - $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.''; |
|
736 | + $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.''; |
|
737 | 737 | |
738 | 738 | } else { |
739 | - $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.''; |
|
739 | + $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.''; |
|
740 | 740 | } |
741 | 741 | } |
742 | 742 | $return .= '</p>'; |
@@ -747,9 +747,9 @@ discard block |
||
747 | 747 | /////////////////////////// |
748 | 748 | // START GALLERY AND MAP FRONT END STUFFS |
749 | 749 | /////////////////////////// |
750 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
750 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
751 | 751 | |
752 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
752 | + if ('gallery' == $shortcode['front_type']) { |
|
753 | 753 | |
754 | 754 | $return .= lasso_gallery_editor_module(); |
755 | 755 | |
@@ -760,13 +760,13 @@ discard block |
||
760 | 760 | /////////////////////////// |
761 | 761 | |
762 | 762 | // Single shortcode (not closed) |
763 | - if ( 'single' == $shortcode['type'] ) { |
|
763 | + if ('single' == $shortcode['type']) { |
|
764 | 764 | |
765 | 765 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
766 | 766 | |
767 | 767 | } else { |
768 | 768 | |
769 | - $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>'; |
|
769 | + $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>'; |
|
770 | 770 | } |
771 | 771 | |
772 | 772 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
800 | 800 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
801 | 801 | <i class="lasso-icon lasso-icon-move"></i> |
802 | - <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> |
|
802 | + <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> |
|
803 | 803 | <div class="lasso--slider_wrap"> |
804 | 804 | <div id="lasso--slider"></div> |
805 | 805 | </div> |
@@ -18,27 +18,27 @@ |
||
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.14.2' ); |
|
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.14.2'); |
|
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 |