@@ -279,6 +279,9 @@ |
||
279 | 279 | endif; |
280 | 280 | |
281 | 281 | // helper function to retrieve one id for default option |
282 | +/** |
|
283 | + * @param string $type |
|
284 | + */ |
|
282 | 285 | function editus_get_one_id($type) |
283 | 286 | { |
284 | 287 | $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
@@ -16,80 +16,80 @@ discard block |
||
16 | 16 | |
17 | 17 | $array = array( |
18 | 18 | 'quote' => array( |
19 | - 'name' => __('Quote','lasso'), |
|
19 | + 'name' => __('Quote', 'lasso'), |
|
20 | 20 | 'content' => lasso_quote_component(), |
21 | 21 | ), |
22 | 22 | 'image' => array( |
23 | - 'name' => __('Image','lasso'), |
|
23 | + 'name' => __('Image', 'lasso'), |
|
24 | 24 | 'content' => lasso_image_component(), |
25 | 25 | ), |
26 | 26 | 'parallax' => array( |
27 | - 'name' => __('Parallax','lasso'), |
|
27 | + 'name' => __('Parallax', 'lasso'), |
|
28 | 28 | 'content' => lasso_parallax_component(), |
29 | 29 | ), |
30 | 30 | 'audio' => array( |
31 | - 'name' => __('Audio','lasso'), |
|
31 | + 'name' => __('Audio', 'lasso'), |
|
32 | 32 | 'content' => lasso_audio_component(), |
33 | 33 | ), |
34 | 34 | 'content' => array( |
35 | - 'name' => __('Content','lasso'), |
|
35 | + 'name' => __('Content', 'lasso'), |
|
36 | 36 | 'content' => lasso_content_component(), |
37 | 37 | ), |
38 | 38 | 'character' => array( |
39 | - 'name' => __('Character','lasso'), |
|
39 | + 'name' => __('Character', 'lasso'), |
|
40 | 40 | 'content' => lasso_character_component(), |
41 | 41 | ), |
42 | 42 | 'collection' => array( |
43 | - 'name' => __('Collection','lasso'), |
|
43 | + 'name' => __('Collection', 'lasso'), |
|
44 | 44 | 'content' => lasso_collections_component(), |
45 | 45 | ), |
46 | 46 | 'document' => array( |
47 | - 'name' => __('Document','lasso'), |
|
47 | + 'name' => __('Document', 'lasso'), |
|
48 | 48 | 'content' => lasso_document_component(), |
49 | 49 | ), |
50 | 50 | 'gallery' => array( |
51 | - 'name' => __('Gallery','lasso'), |
|
51 | + 'name' => __('Gallery', 'lasso'), |
|
52 | 52 | 'content' => lasso_gallery_component(), |
53 | 53 | ), |
54 | 54 | 'chapter' => array( |
55 | - 'name' => __('Chapter','lasso'), |
|
55 | + 'name' => __('Chapter', 'lasso'), |
|
56 | 56 | 'content' => lasso_heading_component(), |
57 | 57 | ), |
58 | 58 | 'map' => array( |
59 | - 'name' => __('Map','lasso'), |
|
59 | + 'name' => __('Map', 'lasso'), |
|
60 | 60 | 'content' => lasso_map_component(), |
61 | 61 | ), |
62 | 62 | 'timeline_stop' => array( |
63 | - 'name' => __('Timeline','lasso'), |
|
63 | + 'name' => __('Timeline', 'lasso'), |
|
64 | 64 | 'content' => lasso_timeline_component(), |
65 | 65 | ), |
66 | 66 | 'video' => array( |
67 | - 'name' => __('Video','lasso'), |
|
67 | + 'name' => __('Video', 'lasso'), |
|
68 | 68 | 'content' => lasso_video_component(), |
69 | 69 | ), |
70 | 70 | 'wpimg' => array( |
71 | - 'name' => __('WordPress Image','lasso'), |
|
71 | + 'name' => __('WordPress Image', 'lasso'), |
|
72 | 72 | 'content' => lasso_wp_image(), |
73 | 73 | ), |
74 | 74 | 'wpquote' => array( |
75 | - 'name' => __('WordPress Quote','lasso'), |
|
75 | + 'name' => __('WordPress Quote', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_quote(), |
77 | 77 | ), |
78 | 78 | 'gallery_pop' => array( |
79 | - 'name' => __('Gallery Pop','lasso'), |
|
79 | + 'name' => __('Gallery Pop', 'lasso'), |
|
80 | 80 | 'content' => lasso_gallery_pop_component(), |
81 | 81 | ), |
82 | 82 | 'events' => array( |
83 | - 'name' => __('Events','lasso'), |
|
83 | + 'name' => __('Events', 'lasso'), |
|
84 | 84 | 'content' => lasso_event_component(), |
85 | 85 | ), |
86 | 86 | 'wpvideo' => array( |
87 | - 'name' => __('WordPress Image','lasso'), |
|
87 | + 'name' => __('WordPress Image', 'lasso'), |
|
88 | 88 | 'content' => lasso_wp_video(), |
89 | 89 | ), |
90 | 90 | ); |
91 | 91 | |
92 | - return apply_filters( 'lasso_components', $array ); |
|
92 | + return apply_filters('lasso_components', $array); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -115,132 +115,132 @@ discard block |
||
115 | 115 | */ |
116 | 116 | |
117 | 117 | // 1 |
118 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
118 | +if (!function_exists('lasso_quote_component')): |
|
119 | 119 | function lasso_quote_component() { |
120 | 120 | |
121 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
121 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
122 | 122 | } |
123 | 123 | endif; |
124 | 124 | |
125 | 125 | // 2 |
126 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
126 | +if (!function_exists('lasso_image_component')): |
|
127 | 127 | function lasso_image_component() { |
128 | 128 | |
129 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' ); |
|
129 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]'); |
|
130 | 130 | } |
131 | 131 | endif; |
132 | 132 | |
133 | 133 | // 3 |
134 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
134 | +if (!function_exists('lasso_parallax_component')): |
|
135 | 135 | function lasso_parallax_component() { |
136 | 136 | |
137 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
137 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
138 | 138 | } |
139 | 139 | endif; |
140 | 140 | |
141 | 141 | // 4 |
142 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
142 | +if (!function_exists('lasso_audio_component')): |
|
143 | 143 | function lasso_audio_component() { |
144 | 144 | |
145 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
145 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
146 | 146 | |
147 | 147 | } |
148 | 148 | endif; |
149 | 149 | |
150 | 150 | // 5 |
151 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
151 | +if (!function_exists('lasso_content_component')): |
|
152 | 152 | function lasso_content_component() { |
153 | 153 | |
154 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
154 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
155 | 155 | } |
156 | 156 | endif; |
157 | 157 | |
158 | 158 | // 6 |
159 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
159 | +if (!function_exists('lasso_character_component')): |
|
160 | 160 | function lasso_character_component() { |
161 | 161 | |
162 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
162 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | endif; |
166 | 166 | |
167 | 167 | // 7 |
168 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
168 | +if (!function_exists('lasso_collections_component')): |
|
169 | 169 | function lasso_collections_component() { |
170 | 170 | |
171 | - return do_shortcode( '[aesop_collection]' ); |
|
171 | + return do_shortcode('[aesop_collection]'); |
|
172 | 172 | } |
173 | 173 | endif; |
174 | 174 | |
175 | 175 | // 8 |
176 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
176 | +if (!function_exists('lasso_document_component')): |
|
177 | 177 | function lasso_document_component() { |
178 | 178 | |
179 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
179 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
180 | 180 | |
181 | 181 | } |
182 | 182 | endif; |
183 | 183 | |
184 | 184 | // 9 |
185 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
185 | +if (!function_exists('lasso_gallery_component')): |
|
186 | 186 | function lasso_gallery_component() { |
187 | 187 | |
188 | - return do_shortcode( '[aesop_gallery]' ); |
|
188 | + return do_shortcode('[aesop_gallery]'); |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | endif; |
192 | 192 | |
193 | 193 | // 10 |
194 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
194 | +if (!function_exists('lasso_heading_component')): |
|
195 | 195 | function lasso_heading_component() { |
196 | 196 | |
197 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
197 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
198 | 198 | } |
199 | 199 | endif; |
200 | 200 | |
201 | 201 | // 11 |
202 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
202 | +if (!function_exists('lasso_map_component')): |
|
203 | 203 | function lasso_map_component() { |
204 | 204 | |
205 | 205 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
206 | 206 | '.lasso_map_form_footer().' |
207 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
207 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
208 | 208 | </form>'; |
209 | 209 | |
210 | 210 | } |
211 | 211 | endif; |
212 | 212 | |
213 | 213 | // 12 |
214 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
214 | +if (!function_exists('lasso_timeline_component')): |
|
215 | 215 | function lasso_timeline_component() { |
216 | 216 | |
217 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
217 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
218 | 218 | |
219 | 219 | } |
220 | 220 | endif; |
221 | 221 | |
222 | 222 | // 13 |
223 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
223 | +if (!function_exists('lasso_video_component')): |
|
224 | 224 | function lasso_video_component() { |
225 | 225 | |
226 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
226 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | endif; |
230 | 230 | |
231 | 231 | // 14 - since 0.9.1 |
232 | -if ( !function_exists('lasso_wp_image') ): |
|
232 | +if (!function_exists('lasso_wp_image')): |
|
233 | 233 | |
234 | - function lasso_wp_image(){ |
|
234 | + function lasso_wp_image() { |
|
235 | 235 | return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>'; |
236 | 236 | } |
237 | 237 | |
238 | 238 | endif; |
239 | 239 | |
240 | 240 | // 15 - since 0.9.2 |
241 | -if ( !function_exists('lasso_wp_quote') ): |
|
241 | +if (!function_exists('lasso_wp_quote')): |
|
242 | 242 | |
243 | - function lasso_wp_quote(){ |
|
243 | + function lasso_wp_quote() { |
|
244 | 244 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>'; |
245 | 245 | } |
246 | 246 | |
@@ -248,15 +248,15 @@ discard block |
||
248 | 248 | |
249 | 249 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
250 | 250 | |
251 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
251 | +if (!function_exists('lasso_gallery_pop_component')): |
|
252 | 252 | function lasso_gallery_pop_component() { |
253 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
253 | + return do_shortcode('[aesop_gallery_pop]'); |
|
254 | 254 | } |
255 | 255 | endif; |
256 | 256 | |
257 | 257 | // 17 - work in progress |
258 | 258 | |
259 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
259 | +if (!function_exists('lasso_event_component')): |
|
260 | 260 | function lasso_event_component() { |
261 | 261 | $id = editus_get_one_id('aesop_events'); |
262 | 262 | return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>'; |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | endif; |
265 | 265 | |
266 | 266 | // 18 - work in progress |
267 | -if ( !function_exists('lasso_wp_video') ): |
|
267 | +if (!function_exists('lasso_wp_video')): |
|
268 | 268 | |
269 | - function lasso_wp_video(){ |
|
269 | + function lasso_wp_video() { |
|
270 | 270 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
271 | 271 | } |
272 | 272 | |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | // helper function to retrieve one id for default option |
276 | 276 | function editus_get_one_id($type) |
277 | 277 | { |
278 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
279 | - $posts = get_posts( $args ); |
|
280 | - if ( $posts ) { |
|
281 | - foreach ( $posts as $post ) { |
|
278 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
279 | + $posts = get_posts($args); |
|
280 | + if ($posts) { |
|
281 | + foreach ($posts as $post) { |
|
282 | 282 | return $post->ID; |
283 | 283 | } |
284 | 284 | } |
@@ -182,7 +182,7 @@ |
||
182 | 182 | * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | - * @return bool True if update was successful, false if not. |
|
185 | + * @return boolean|null True if update was successful, false if not. |
|
186 | 186 | */ |
187 | 187 | public function set_custom_taxonomy( $postid, $value) { |
188 | 188 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @since 0.9.3 |
135 | 135 | * |
136 | 136 | * @param int $postid The current postid |
137 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
137 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
138 | 138 | * @param string $taxonomy The name of the taxonomy to which the term belongs. |
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($taxonomy =='category') { |
150 | - // convert from names to category ids |
|
150 | + // convert from names to category ids |
|
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
153 | 153 | foreach ($value as $cat) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * |
181 | 181 | * @param int $postid The current postid |
182 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
182 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $value = explode( ',', $value ); |
193 | 193 | } |
194 | 194 | |
195 | - // Deleting first array item |
|
195 | + // Deleting first array item |
|
196 | 196 | $taxonomy = array_shift($value); |
197 | 197 | $cats = array(); |
198 | 198 | foreach ($value as $cat) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | if( $value ) { |
216 | 216 | $time = current_time('mysql'); |
217 | - wp_update_post( |
|
217 | + wp_update_post( |
|
218 | 218 | array ( |
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | 220 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | use lasso\internal_api\api_action; |
11 | 11 | |
12 | -class update_object implements api_action{ |
|
12 | +class update_object implements api_action { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The nonce action for this request. |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return bool Always returns true. |
31 | 31 | */ |
32 | - public function post( $data ) { |
|
32 | + public function post($data) { |
|
33 | 33 | |
34 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
35 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
36 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
34 | + $status = isset($data['status']) ? $data['status'] : false; |
|
35 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
36 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
37 | 37 | |
38 | 38 | |
39 | 39 | |
@@ -43,28 +43,28 @@ discard block |
||
43 | 43 | 'post_status' => $status |
44 | 44 | ); |
45 | 45 | |
46 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
46 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
47 | 47 | |
48 | 48 | |
49 | 49 | // update categories |
50 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
51 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
50 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
51 | + self::set_post_terms($postid, $cats, 'category'); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | // update tags |
55 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
56 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
55 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
56 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
57 | 57 | |
58 | 58 | // update custom taxonomy |
59 | - $taxs = isset( $data['story_custom_taxonomy'] ) ? $data['story_custom_taxonomy'] : false; |
|
60 | - self::set_custom_taxonomy( $postid, $taxs ); |
|
59 | + $taxs = isset($data['story_custom_taxonomy']) ? $data['story_custom_taxonomy'] : false; |
|
60 | + self::set_custom_taxonomy($postid, $taxs); |
|
61 | 61 | |
62 | 62 | //update date |
63 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
64 | - self::set_date( $postid, $date ); |
|
63 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
64 | + self::set_date($postid, $date); |
|
65 | 65 | |
66 | 66 | |
67 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
67 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
68 | 68 | |
69 | 69 | return true; |
70 | 70 | |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
80 | 80 | */ |
81 | - public static function params(){ |
|
82 | - $params[ 'process_update_object_post' ] = array( |
|
81 | + public static function params() { |
|
82 | + $params['process_update_object_post'] = array( |
|
83 | 83 | 'postid' => 'absint', |
84 | 84 | 'status' => 'strip_tags', |
85 | 85 | 'story_slug' => array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return array Array of additional functions to use to authorize action. |
118 | 118 | */ |
119 | 119 | public static function auth_callbacks() { |
120 | - $params[ 'process_update_object_post' ] = array( |
|
120 | + $params['process_update_object_post'] = array( |
|
121 | 121 | 'lasso_user_can' |
122 | 122 | ); |
123 | 123 | |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
141 | 141 | */ |
142 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
143 | - if( $value ) { |
|
142 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
143 | + if ($value) { |
|
144 | 144 | // first check if multiple, make array if so. |
145 | - if ( self::has_multiple_objects( $value ) ) { |
|
146 | - $value = explode( ',', $value ); |
|
145 | + if (self::has_multiple_objects($value)) { |
|
146 | + $value = explode(',', $value); |
|
147 | 147 | } |
148 | 148 | |
149 | - if ($taxonomy =='category') { |
|
149 | + if ($taxonomy == 'category') { |
|
150 | 150 | // convert from names to category ids |
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
@@ -159,17 +159,17 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
162 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
163 | 163 | } |
164 | - else { |
|
164 | + else { |
|
165 | 165 | //remove all terms from post |
166 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
166 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - if ( ! is_wp_error( $result ) ) { |
|
170 | + if (!is_wp_error($result)) { |
|
171 | 171 | return true; |
172 | - }else{ |
|
172 | + } else { |
|
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | } |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
186 | 186 | */ |
187 | - public function set_custom_taxonomy( $postid, $value) { |
|
187 | + public function set_custom_taxonomy($postid, $value) { |
|
188 | 188 | |
189 | - if( $value ) { |
|
189 | + if ($value) { |
|
190 | 190 | // first check if multiple, make array if so. |
191 | - if ( self::has_multiple_objects( $value ) ) { |
|
192 | - $value = explode( ',', $value ); |
|
191 | + if (self::has_multiple_objects($value)) { |
|
192 | + $value = explode(',', $value); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | // Deleting first array item |
@@ -201,24 +201,24 @@ discard block |
||
201 | 201 | $value = $cats; |
202 | 202 | |
203 | 203 | |
204 | - $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
|
205 | - if ( ! is_wp_error( $result ) ) { |
|
204 | + $result = wp_set_object_terms($postid, $cats, $taxonomy); |
|
205 | + if (!is_wp_error($result)) { |
|
206 | 206 | return true; |
207 | - }else{ |
|
207 | + } else { |
|
208 | 208 | return false; |
209 | 209 | } |
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | - public function set_date( $postid, $value) { |
|
213 | + public function set_date($postid, $value) { |
|
214 | 214 | |
215 | - if( $value ) { |
|
215 | + if ($value) { |
|
216 | 216 | $time = current_time('mysql'); |
217 | 217 | wp_update_post( |
218 | - array ( |
|
218 | + array( |
|
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
221 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
220 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
221 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
222 | 222 | ) |
223 | 223 | ); |
224 | 224 | } |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | * @return bool True if there are multiple terms; otherwise, false. |
233 | 233 | * @since 0.9.3 |
234 | 234 | */ |
235 | - public function has_multiple_objects( $value ) { |
|
235 | + public function has_multiple_objects($value) { |
|
236 | 236 | |
237 | - return 0 < strpos( $value, ',' ); |
|
237 | + return 0 < strpos($value, ','); |
|
238 | 238 | |
239 | 239 | } |
240 | 240 |
@@ -160,8 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
163 | - } |
|
164 | - else { |
|
163 | + } else { |
|
165 | 164 | //remove all terms from post |
166 | 165 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
167 | 166 | |
@@ -169,7 +168,7 @@ discard block |
||
169 | 168 | |
170 | 169 | if ( ! is_wp_error( $result ) ) { |
171 | 170 | return true; |
172 | - }else{ |
|
171 | + } else{ |
|
173 | 172 | return false; |
174 | 173 | } |
175 | 174 | } |
@@ -204,7 +203,7 @@ discard block |
||
204 | 203 | $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
205 | 204 | if ( ! is_wp_error( $result ) ) { |
206 | 205 | return true; |
207 | - }else{ |
|
206 | + } else{ |
|
208 | 207 | return false; |
209 | 208 | } |
210 | 209 | } |
@@ -28,26 +28,26 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.0 |
30 | 30 | */ |
31 | - public function post( $data ) { |
|
31 | + public function post($data) { |
|
32 | 32 | |
33 | - $title = $data[ 'story_title' ]; |
|
33 | + $title = $data['story_title']; |
|
34 | 34 | |
35 | - $object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ]; |
|
35 | + $object = is_null($data['object']) ? false : $data['object']; |
|
36 | 36 | |
37 | 37 | // insert a new post |
38 | 38 | $args = array( |
39 | 39 | 'post_title' => $title, |
40 | 40 | 'post_status' => 'draft', |
41 | 41 | 'post_type' => $object, |
42 | - 'post_content' => apply_filters( 'lasso_new_object_content', '<p>'.__( 'Once upon a time...','lasso').'</p>' ) |
|
42 | + 'post_content' => apply_filters('lasso_new_object_content', '<p>'.__('Once upon a time...', 'lasso').'</p>') |
|
43 | 43 | ); |
44 | 44 | |
45 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) ); |
|
45 | + $postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args)); |
|
46 | 46 | |
47 | - do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() ); |
|
47 | + do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID()); |
|
48 | 48 | |
49 | 49 | return array( |
50 | - 'postlink' => get_permalink( $postid ) |
|
50 | + 'postlink' => get_permalink($postid) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | } |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
61 | 61 | */ |
62 | 62 | public static function params() { |
63 | - $params[ 'process_new_object_post' ] = array( |
|
64 | - 'story_title' => array( 'wp_strip_all_tags', 'trim' ), |
|
63 | + $params['process_new_object_post'] = array( |
|
64 | + 'story_title' => array('wp_strip_all_tags', 'trim'), |
|
65 | 65 | 'object' => 'trim' |
66 | 66 | ); |
67 | 67 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return array Array of additional functions to use to authorize action. |
78 | 78 | */ |
79 | 79 | public static function auth_callbacks() { |
80 | - $params[ 'process_new_object_post' ] = array(); |
|
80 | + $params['process_new_object_post'] = array(); |
|
81 | 81 | |
82 | 82 | return $params; |
83 | 83 |
@@ -188,8 +188,11 @@ discard block |
||
188 | 188 | <?php if ( class_exists ('Aesop_Events') ) { ?> |
189 | 189 | <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
190 | 190 | <?php }?> |
191 | - <?php else: ?> |
|
192 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
191 | + <?php else { |
|
192 | + : ?> |
|
193 | + <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' ); |
|
194 | +} |
|
195 | +?>" class="image lasso-toolbar--component__image"></li> |
|
193 | 196 | <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
194 | 197 | <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
195 | 198 | <?php endif; ?> |
@@ -712,8 +715,9 @@ discard block |
||
712 | 715 | |
713 | 716 | $blob = array(); |
714 | 717 | |
715 | - if ( empty( $codes ) ) |
|
716 | - return; |
|
718 | + if ( empty( $codes ) ) { |
|
719 | + return; |
|
720 | + } |
|
717 | 721 | |
718 | 722 | foreach ( $codes as $slug => $shortcode ) { |
719 | 723 | $return = ''; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
205 | 205 | |
206 | 206 | // mobile styles |
207 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
207 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
208 | 208 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
209 | 209 | |
210 | 210 | //show color |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | </div> |
485 | 485 | <?php |
486 | 486 | if ($allow_change_date) { |
487 | - $dateformat = get_option( 'date_format' ); |
|
487 | + $dateformat = get_option( 'date_format' ); |
|
488 | 488 | ?> |
489 | 489 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
490 | 490 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | if ( !empty( $types ) ) { |
599 | 599 | // get the first element |
600 | 600 | $keys = array_keys($types); |
601 | - $type =$keys[0]; |
|
601 | + $type =$keys[0]; |
|
602 | 602 | $type = preg_replace( '/s\b/','', $type ); |
603 | 603 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
604 | 604 | } |
@@ -626,8 +626,8 @@ discard block |
||
626 | 626 | global $post; |
627 | 627 | |
628 | 628 | global $wp_post_types; |
629 | - $labels = &$wp_post_types['post']->labels; |
|
630 | - $labels->name = 'Articles'; |
|
629 | + $labels = &$wp_post_types['post']->labels; |
|
630 | + $labels->name = 'Articles'; |
|
631 | 631 | |
632 | 632 | ob_start(); |
633 | 633 | |
@@ -870,9 +870,9 @@ discard block |
||
870 | 870 | $return .= '</form>'; |
871 | 871 | |
872 | 872 | // extra JS codes |
873 | - if (isset($shortcode['codes'])) { |
|
874 | - $return .= $shortcode['codes']; |
|
875 | - } |
|
873 | + if (isset($shortcode['codes'])) { |
|
874 | + $return .= $shortcode['codes']; |
|
875 | + } |
|
876 | 876 | $blob[$slug] = $return; |
877 | 877 | } |
878 | 878 | |
@@ -921,23 +921,23 @@ discard block |
||
921 | 921 | * @return string |
922 | 922 | */ |
923 | 923 | function lasso_editor_adjustBrightness($hex, $steps) { |
924 | - $steps = max(-255, min(255, $steps)); |
|
924 | + $steps = max(-255, min(255, $steps)); |
|
925 | 925 | |
926 | - // Normalize into a six character long hex string |
|
927 | - $hex = str_replace('#', '', $hex); |
|
928 | - if (strlen($hex) == 3) { |
|
929 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
930 | - } |
|
926 | + // Normalize into a six character long hex string |
|
927 | + $hex = str_replace('#', '', $hex); |
|
928 | + if (strlen($hex) == 3) { |
|
929 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
930 | + } |
|
931 | 931 | |
932 | - // Split into three parts: R, G and B |
|
933 | - $color_parts = str_split($hex, 2); |
|
934 | - $return = '#'; |
|
932 | + // Split into three parts: R, G and B |
|
933 | + $color_parts = str_split($hex, 2); |
|
934 | + $return = '#'; |
|
935 | 935 | |
936 | - foreach ($color_parts as $color) { |
|
937 | - $color = hexdec($color); // Convert to decimal |
|
938 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
939 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
940 | - } |
|
936 | + foreach ($color_parts as $color) { |
|
937 | + $color = hexdec($color); // Convert to decimal |
|
938 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
939 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
940 | + } |
|
941 | 941 | |
942 | - return $return; |
|
942 | + return $return; |
|
943 | 943 | } |
@@ -923,6 +923,7 @@ |
||
923 | 923 | * Takes a color code and returns an adjusted value |
924 | 924 | * @since 1.0.0 |
925 | 925 | * Steps should be between -255 and 255. Negative = darker, positive = lighter |
926 | + * @param integer $steps |
|
926 | 927 | * @return string |
927 | 928 | */ |
928 | 929 | function lasso_editor_adjustBrightness($hex, $steps) { |
@@ -11,39 +11,39 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @since 1.0 |
13 | 13 | */ |
14 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
14 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
15 | 15 | function lasso_editor_controls() { |
16 | 16 | |
17 | 17 | global $post; |
18 | 18 | |
19 | - if ( lasso_user_can('edit_posts') ) { |
|
19 | + if (lasso_user_can('edit_posts')) { |
|
20 | 20 | |
21 | - $status = get_post_status( get_the_ID() ); |
|
22 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
23 | - $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff'); |
|
24 | - $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000'); |
|
25 | - $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055'); |
|
26 | - $text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff'); |
|
21 | + $status = get_post_status(get_the_ID()); |
|
22 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
23 | + $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff'); |
|
24 | + $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000'); |
|
25 | + $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055'); |
|
26 | + $text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff'); |
|
27 | 27 | $hover_color1 = lasso_editor_adjustBrightness($button_color1, 50); |
28 | 28 | $hover_color2 = lasso_editor_adjustBrightness($button_color2, 50); |
29 | 29 | |
30 | 30 | // let users add custom css classes |
31 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
31 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
32 | 32 | |
33 | 33 | $post_access_class = ''; |
34 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
35 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
36 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
34 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
35 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
36 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // CSS class if adding new post objects is disabled |
40 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
40 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if adjust settings is disabled |
43 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
43 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
44 | 44 | |
45 | 45 | // CSS class if adding new post objects AND settings are disabled |
46 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
46 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
47 | 47 | |
48 | 48 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
49 | 49 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -60,29 +60,29 @@ discard block |
||
60 | 60 | ?> |
61 | 61 | <style> |
62 | 62 | .lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish { |
63 | - background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
64 | - background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
65 | - background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
66 | - color: <?php echo $text_color;?>; |
|
63 | + background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
64 | + background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
65 | + background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
66 | + color: <?php echo $text_color; ?>; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | .lasso--controls__right a:before, #lasso-toolbar--html__footer_desc { |
70 | - color: <?php echo $text_color;?> !important; |
|
70 | + color: <?php echo $text_color; ?> !important; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover { |
74 | - background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
75 | - background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
76 | - background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
74 | + background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
75 | + background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
76 | + background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | .lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap, |
80 | 80 | #lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap { |
81 | - background: <?php echo $dialog_color;?>; |
|
82 | - color: <?php echo $text_color;?>; |
|
81 | + background: <?php echo $dialog_color; ?>; |
|
82 | + color: <?php echo $text_color; ?>; |
|
83 | 83 | } |
84 | 84 | .sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label { |
85 | - color: <?php echo $text_color;?> !important; |
|
85 | + color: <?php echo $text_color; ?> !important; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | <?php if (!$is_mobile) { ?> |
@@ -112,48 +112,48 @@ discard block |
||
112 | 112 | <?php |
113 | 113 | } |
114 | 114 | ?> |
115 | - <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();?>" > |
|
115 | + <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(); ?>" > |
|
116 | 116 | |
117 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
117 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
118 | 118 | |
119 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
119 | + <?php do_action('lasso_editor_controls_before'); |
|
120 | 120 | |
121 | - if ( $is_capable ) { ?> |
|
121 | + if ($is_capable) { ?> |
|
122 | 122 | |
123 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
123 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
124 | 124 | |
125 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
126 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
125 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
126 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
127 | 127 | <?php } |
128 | 128 | |
129 | 129 | } ?> |
130 | 130 | |
131 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
131 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
132 | 132 | |
133 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
134 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
133 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
134 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
135 | 135 | <?php } ?> |
136 | 136 | |
137 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?> |
|
138 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
137 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?> |
|
138 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
139 | 139 | <?php } ?> |
140 | 140 | |
141 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
141 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
142 | 142 | |
143 | 143 | </ul> |
144 | 144 | |
145 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
145 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
146 | 146 | |
147 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
147 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
148 | 148 | |
149 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
150 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
149 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
150 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
151 | 151 | |
152 | 152 | |
153 | - <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> |
|
153 | + <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> |
|
154 | 154 | |
155 | - <?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?> |
|
156 | - <a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
155 | + <?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?> |
|
156 | + <a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
157 | 157 | <?php } ?> |
158 | 158 | |
159 | 159 | |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | |
180 | 180 | |
181 | 181 | // let users add custom css classes |
182 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
182 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
183 | 183 | ?> |
184 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
184 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
185 | 185 | <div class="lasso--sidebar__inner"> |
186 | 186 | <div id="lasso--component__settings"></div> |
187 | 187 | </div> |
@@ -203,20 +203,20 @@ discard block |
||
203 | 203 | $is_mobile = wp_is_mobile(); |
204 | 204 | |
205 | 205 | // check for lasso story engine and add a class doniting this |
206 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
206 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
207 | 207 | |
208 | 208 | // let users add custom css classes |
209 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
209 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
210 | 210 | |
211 | 211 | // are toolbar headings enabled |
212 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
213 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
212 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
213 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
214 | 214 | |
215 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
215 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
216 | 216 | |
217 | 217 | // mobile styles |
218 | 218 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
219 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
219 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
220 | 220 | |
221 | 221 | //show color |
222 | 222 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -224,116 +224,116 @@ discard block |
||
224 | 224 | //show alignment |
225 | 225 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
226 | 226 | |
227 | - $status = get_post_status( get_the_ID() ); |
|
227 | + $status = get_post_status(get_the_ID()); |
|
228 | 228 | |
229 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
229 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
230 | 230 | |
231 | 231 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
232 | 232 | |
233 | 233 | |
234 | 234 | ?> |
235 | - <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 ?>> |
|
236 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
237 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
238 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
239 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
240 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
241 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
242 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
235 | + <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 ?>> |
|
236 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
237 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
238 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
239 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
240 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
241 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
242 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
243 | 243 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
244 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
245 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
246 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
247 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
248 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
249 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
250 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
251 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
252 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
253 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
254 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
255 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
256 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
257 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
258 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
259 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
244 | + <?php if ('ase-active' == $ase_status): ?> |
|
245 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
246 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
247 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
248 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
249 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
250 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
251 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
252 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
253 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
254 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
255 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
256 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
257 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
258 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
259 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
260 | 260 | <?php }?> |
261 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
262 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
261 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
262 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
263 | 263 | <?php }?> |
264 | 264 | <?php else: ?> |
265 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
266 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
267 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
265 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
266 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
267 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
268 | 268 | <?php endif; ?> |
269 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
269 | + <?php do_action('lasso_toolbar_components'); ?> |
|
270 | 270 | </ul> |
271 | 271 | </li> |
272 | - <?php if ( $toolbar_headings ): ?> |
|
273 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
274 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
272 | + <?php if ($toolbar_headings): ?> |
|
273 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
274 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
275 | 275 | <?php endif; ?> |
276 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
277 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
278 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
279 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
276 | + <?php if ($toolbar_headings_h4): ?> |
|
277 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
278 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
279 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
280 | 280 | <?php endif; ?> |
281 | 281 | |
282 | - <?php if ( $show_color ): ?> |
|
283 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
284 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
282 | + <?php if ($show_color): ?> |
|
283 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
284 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
285 | 285 | <?php endif; ?> |
286 | 286 | |
287 | 287 | |
288 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
288 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
289 | 289 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
290 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
291 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
290 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
291 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
292 | 292 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
293 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
293 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
294 | 294 | </div> |
295 | 295 | </li> |
296 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
297 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
296 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
297 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
298 | 298 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
299 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
299 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
300 | 300 | <div id="lasso-toolbar--html__footer"> |
301 | 301 | <div id="lasso-toolbar--html__footer_desc" > |
302 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
303 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
304 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
302 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
303 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
304 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
305 | 305 | </div> |
306 | 306 | <ul class="lasso-toolbar--html-snips"> |
307 | 307 | |
308 | - <?php if ( !$toolbar_headings ): ?> |
|
309 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
310 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
308 | + <?php if (!$toolbar_headings): ?> |
|
309 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
310 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
311 | 311 | <?php endif; ?> |
312 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
313 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
312 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
313 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
314 | 314 | </ul> |
315 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
316 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
315 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
316 | + <a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
317 | 317 | </div> |
318 | 318 | </div> |
319 | 319 | </li> |
320 | - <?php if ( $show_align ): ?> |
|
321 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
322 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
323 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
320 | + <?php if ($show_align): ?> |
|
321 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
322 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
323 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
324 | 324 | <?php endif; ?> |
325 | 325 | </ul> |
326 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
326 | + <?php if (is_singular() && $is_mobile) { ?> |
|
327 | 327 | |
328 | - <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;"> |
|
328 | + <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;"> |
|
329 | 329 | |
330 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
331 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
330 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
331 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
332 | 332 | |
333 | - <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> |
|
333 | + <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> |
|
334 | 334 | |
335 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
336 | - <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> |
|
335 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
336 | + <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> |
|
337 | 337 | <?php } ?> |
338 | 338 | |
339 | 339 | </div> |
@@ -351,20 +351,20 @@ discard block |
||
351 | 351 | */ |
352 | 352 | function lasso_editor_settings_toolbar() { |
353 | 353 | |
354 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
354 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
355 | 355 | |
356 | 356 | ob_start(); |
357 | 357 | |
358 | 358 | |
359 | 359 | // let users add custom css classes |
360 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
360 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
361 | 361 | |
362 | 362 | ?> |
363 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
364 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
365 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
366 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
367 | - <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> |
|
363 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
364 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
365 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
366 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
367 | + <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> |
|
368 | 368 | </ul> |
369 | 369 | |
370 | 370 | <?php return ob_get_clean(); |
@@ -382,13 +382,13 @@ discard block |
||
382 | 382 | |
383 | 383 | |
384 | 384 | // has post thumbnail |
385 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
385 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
386 | 386 | |
387 | 387 | ?> |
388 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
389 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
390 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
391 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
388 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
389 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
390 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
391 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
392 | 392 | </ul> |
393 | 393 | |
394 | 394 | <?php return ob_get_clean(); |
@@ -412,55 +412,55 @@ discard block |
||
412 | 412 | |
413 | 413 | $postid = get_the_ID(); |
414 | 414 | |
415 | - $status = get_post_status( $postid ); |
|
416 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
415 | + $status = get_post_status($postid); |
|
416 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
417 | 417 | |
418 | 418 | // let users add custom css classes |
419 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
419 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
420 | 420 | |
421 | 421 | // objects categories |
422 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
423 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
422 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
423 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
424 | 424 | |
425 | 425 | // modal tabs |
426 | - $tabs = lasso_modal_addons('tab'); |
|
427 | - $content = lasso_modal_addons('content'); |
|
426 | + $tabs = lasso_modal_addons('tab'); |
|
427 | + $content = lasso_modal_addons('content'); |
|
428 | 428 | |
429 | 429 | //editor options |
430 | 430 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
431 | 431 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
432 | 432 | |
433 | 433 | // are we singular |
434 | - $is_singular = is_singular(); |
|
434 | + $is_singular = is_singular(); |
|
435 | 435 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
436 | 436 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
437 | 437 | $theme_supports = current_theme_supports('post-thumbnails'); |
438 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
438 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
439 | 439 | |
440 | 440 | // do we support pending status |
441 | 441 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
442 | 442 | |
443 | 443 | ?> |
444 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
444 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
445 | 445 | <div class="lasso--modal__inner"> |
446 | 446 | |
447 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
447 | + <?php if ($tabs) { echo $tabs; } ?> |
|
448 | 448 | |
449 | 449 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
450 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
450 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
451 | 451 | |
452 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
452 | + <?php if ($is_singular && $theme_supports) : ?> |
|
453 | 453 | <div class="lasso--postsettings__left"> |
454 | - <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> |
|
455 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
454 | + <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> |
|
455 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
456 | 456 | |
457 | 457 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
458 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
459 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
458 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
459 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
460 | 460 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
461 | 461 | </div> |
462 | 462 | |
463 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
463 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
464 | 464 | |
465 | 465 | </div> |
466 | 466 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -470,15 +470,15 @@ discard block |
||
470 | 470 | |
471 | 471 | <div class="lasso--postsettings__right"> |
472 | 472 | |
473 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
473 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
474 | 474 | <div class="lasso--postsettings__option story-status-option"> |
475 | - <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> |
|
476 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
477 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
478 | - <?php if( !$no_pending_status ): ?> |
|
479 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
475 | + <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> |
|
476 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
477 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
478 | + <?php if (!$no_pending_status): ?> |
|
479 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
480 | 480 | <?php endif; ?> |
481 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
481 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
482 | 482 | </ul> |
483 | 483 | <div class="lasso--slider_wrap"> |
484 | 484 | <div id="lasso--slider"></div> |
@@ -486,10 +486,10 @@ discard block |
||
486 | 486 | </div> |
487 | 487 | <?php endif; ?> |
488 | 488 | |
489 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
489 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
490 | 490 | <div class="lasso--postsettings__option story-slug-option"> |
491 | - <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> |
|
492 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
491 | + <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> |
|
492 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
493 | 493 | </div> |
494 | 494 | <?php endif; ?> |
495 | 495 | |
@@ -498,21 +498,21 @@ discard block |
||
498 | 498 | <div class="lasso--postsettings__middle"> |
499 | 499 | |
500 | 500 | <div class="lasso--postsettings__option story-categories-option"> |
501 | - <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> |
|
502 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
501 | + <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> |
|
502 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
503 | 503 | </div> |
504 | 504 | |
505 | 505 | <div class="lasso--postsettings__option story-tags-option"> |
506 | - <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> |
|
507 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
506 | + <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> |
|
507 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
508 | 508 | </div> |
509 | 509 | <?php |
510 | 510 | if ($allow_change_date) { |
511 | - $dateformat = get_option( 'date_format' ); |
|
511 | + $dateformat = get_option('date_format'); |
|
512 | 512 | ?> |
513 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
514 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
515 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
513 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
514 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
515 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
516 | 516 | <?php |
517 | 517 | }?> |
518 | 518 | |
@@ -534,23 +534,23 @@ discard block |
||
534 | 534 | ?> |
535 | 535 | <!--/div--> |
536 | 536 | |
537 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
537 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
538 | 538 | |
539 | 539 | <div class="lasso--postsettings__footer" > |
540 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
540 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
541 | 541 | <input type="hidden" name="status" value=""> |
542 | 542 | <input type="hidden" name="categories" value=""> |
543 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
543 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
544 | 544 | <input type="hidden" name="action" value="process_update-object_post"> |
545 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
546 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
547 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
545 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
546 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
547 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
548 | 548 | </div> |
549 | 549 | |
550 | 550 | </form> |
551 | 551 | </div> |
552 | 552 | |
553 | - <?php if( $tabs ) { echo $content; } ?> |
|
553 | + <?php if ($tabs) { echo $content; } ?> |
|
554 | 554 | |
555 | 555 | </div> |
556 | 556 | |
@@ -572,41 +572,41 @@ discard block |
||
572 | 572 | ob_start(); |
573 | 573 | |
574 | 574 | |
575 | - $status = get_post_status( get_the_ID() ); |
|
575 | + $status = get_post_status(get_the_ID()); |
|
576 | 576 | |
577 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
577 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
578 | 578 | |
579 | 579 | // let users add custom css classes |
580 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
580 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
581 | 581 | |
582 | 582 | // return the post type |
583 | - $type = get_post_type( get_the_ID() ); |
|
583 | + $type = get_post_type(get_the_ID()); |
|
584 | 584 | |
585 | 585 | $mobile_style = ""; |
586 | 586 | if (wp_is_mobile()) { |
587 | 587 | $mobile_style = 'style="top:140px !important;"'; |
588 | 588 | } |
589 | 589 | ?> |
590 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
590 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
591 | 591 | <div class="lasso--modal__inner lasso--hasnewform"> |
592 | 592 | |
593 | 593 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
594 | 594 | |
595 | 595 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
596 | - <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> |
|
597 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
596 | + <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> |
|
597 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
598 | 598 | <div class="lasso--select-wrap" style="width:90px"> |
599 | 599 | <select id="lasso--select-type" name="story_type"> |
600 | 600 | |
601 | 601 | <?php |
602 | 602 | $types = lasso_post_types_names(); |
603 | - if ( !empty( $types ) ) { |
|
604 | - foreach( $types as $name => $label ) { |
|
605 | - $type = preg_replace( '/s\b/','', $name ); |
|
603 | + if (!empty($types)) { |
|
604 | + foreach ($types as $name => $label) { |
|
605 | + $type = preg_replace('/s\b/', '', $name); |
|
606 | 606 | if ($type == 'page' && !current_user_can('edit_pages')) { |
607 | 607 | continue; |
608 | 608 | } |
609 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
609 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
610 | 610 | } |
611 | 611 | |
612 | 612 | } |
@@ -617,19 +617,19 @@ discard block |
||
617 | 617 | </div> |
618 | 618 | |
619 | 619 | <div class="lasso--postsettings__footer"> |
620 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
620 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
621 | 621 | <input type="hidden" name="action" value="process_new-object_post"> |
622 | 622 | <?php |
623 | - if ( !empty( $types ) ) { |
|
623 | + if (!empty($types)) { |
|
624 | 624 | // get the first element |
625 | 625 | $keys = array_keys($types); |
626 | - $type =$keys[0]; |
|
627 | - $type = preg_replace( '/s\b/','', $type ); |
|
628 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
626 | + $type = $keys[0]; |
|
627 | + $type = preg_replace('/s\b/', '', $type); |
|
628 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
629 | 629 | } |
630 | 630 | ?> |
631 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
632 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
631 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
632 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
633 | 633 | </div> |
634 | 634 | |
635 | 635 | </form> |
@@ -657,18 +657,18 @@ discard block |
||
657 | 657 | ob_start(); |
658 | 658 | |
659 | 659 | // post status |
660 | - $status = get_post_status( get_the_ID() ); |
|
660 | + $status = get_post_status(get_the_ID()); |
|
661 | 661 | |
662 | 662 | // let users add custom css classes |
663 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
663 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
664 | 664 | |
665 | 665 | ?> |
666 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
666 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
667 | 667 | <div class="lasso--modal__inner"> |
668 | 668 | |
669 | 669 | <div class="lasso--post-filtering not-visible"> |
670 | 670 | <div class="lasso--search__results"> |
671 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
671 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
672 | 672 | </div> |
673 | 673 | <div class="lasso--search"> |
674 | 674 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -682,18 +682,18 @@ discard block |
||
682 | 682 | $post_types = lasso_post_types_names(); |
683 | 683 | $rest_bases = lasso_post_types_rest_base(); |
684 | 684 | |
685 | - if ( ! empty( $post_types ) ) { |
|
685 | + if (!empty($post_types)) { |
|
686 | 686 | $first = 'active'; |
687 | - foreach( $post_types as $name => $label ) { |
|
687 | + foreach ($post_types as $name => $label) { |
|
688 | 688 | if (array_key_exists($name, $rest_bases)) { |
689 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
689 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
690 | 690 | } |
691 | 691 | $first = ''; |
692 | 692 | } |
693 | 693 | |
694 | 694 | } |
695 | 695 | |
696 | - do_action('lasso_modal_post_objects');?> |
|
696 | + do_action('lasso_modal_post_objects'); ?> |
|
697 | 697 | |
698 | 698 | </ul> |
699 | 699 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -713,14 +713,14 @@ discard block |
||
713 | 713 | |
714 | 714 | |
715 | 715 | // let users add custom css classes |
716 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
716 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
717 | 717 | |
718 | 718 | ?> |
719 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
720 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
721 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
722 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
723 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
719 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
720 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
721 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
722 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
723 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
724 | 724 | </ul> |
725 | 725 | |
726 | 726 | <?php return ob_get_clean(); |
@@ -732,14 +732,14 @@ discard block |
||
732 | 732 | |
733 | 733 | |
734 | 734 | // let users add custom css classes |
735 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
735 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
736 | 736 | |
737 | 737 | ?> |
738 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
739 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
740 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
741 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
742 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
738 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
739 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
740 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
741 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
742 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
743 | 743 | </ul> |
744 | 744 | |
745 | 745 | <?php return ob_get_clean(); |
@@ -752,16 +752,16 @@ discard block |
||
752 | 752 | */ |
753 | 753 | function lasso_map_form_footer() { |
754 | 754 | |
755 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
755 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
756 | 756 | |
757 | 757 | ob_start(); |
758 | 758 | |
759 | 759 | ?> |
760 | 760 | <div class="lasso--map-form__footer"> |
761 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
762 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
761 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
762 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
763 | 763 | <input type="hidden" name="action" value="process_map_save"> |
764 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
764 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
765 | 765 | </div> |
766 | 766 | |
767 | 767 | <?php return ob_get_clean(); |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | |
780 | 780 | ?> |
781 | 781 | <div id="lasso--pagerefresh" class="visible"> |
782 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
782 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
783 | 783 | </div> |
784 | 784 | |
785 | 785 | <?php return ob_get_clean(); |
@@ -793,43 +793,43 @@ discard block |
||
793 | 793 | */ |
794 | 794 | function lasso_editor_options_blob() { |
795 | 795 | |
796 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
797 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
796 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
797 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
798 | 798 | |
799 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
799 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
800 | 800 | |
801 | 801 | $blob = array(); |
802 | 802 | |
803 | - if ( empty( $codes ) ) |
|
803 | + if (empty($codes)) |
|
804 | 804 | return; |
805 | 805 | |
806 | - foreach ( $codes as $slug => $shortcode ) { |
|
806 | + foreach ($codes as $slug => $shortcode) { |
|
807 | 807 | $return = ''; |
808 | 808 | // Shortcode has atts |
809 | 809 | |
810 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
810 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
811 | 811 | |
812 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
812 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
813 | 813 | |
814 | 814 | |
815 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
815 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
816 | 816 | |
817 | 817 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
818 | 818 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
819 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
819 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
820 | 820 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
821 | 821 | // Select |
822 | 822 | |
823 | - if ( isset( $attr_info['values'] ) ) { |
|
823 | + if (isset($attr_info['values'])) { |
|
824 | 824 | |
825 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
825 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
826 | 826 | |
827 | - $i=0; |
|
827 | + $i = 0; |
|
828 | 828 | |
829 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
829 | + foreach ($attr_info['values'] as $attr_value) { |
|
830 | 830 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
831 | 831 | |
832 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
832 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
833 | 833 | |
834 | 834 | $i++; |
835 | 835 | } |
@@ -838,24 +838,24 @@ discard block |
||
838 | 838 | |
839 | 839 | } else { |
840 | 840 | |
841 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
841 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
842 | 842 | |
843 | 843 | // image upload |
844 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
844 | + if ('media_upload' == $attr_info['type']) { |
|
845 | 845 | |
846 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
846 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
847 | 847 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
848 | 848 | |
849 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
849 | + } elseif ('color' == $attr_info['type']) { |
|
850 | 850 | |
851 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
851 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
852 | 852 | |
853 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
853 | + } elseif ('text_area' == $attr_info['type']) { |
|
854 | 854 | |
855 | - $return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
855 | + $return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
856 | 856 | |
857 | 857 | } else { |
858 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
858 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
859 | 859 | } |
860 | 860 | } |
861 | 861 | $return .= '</p>'; |
@@ -866,9 +866,9 @@ discard block |
||
866 | 866 | /////////////////////////// |
867 | 867 | // START GALLERY AND MAP FRONT END STUFFS |
868 | 868 | /////////////////////////// |
869 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
869 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
870 | 870 | |
871 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
871 | + if ('gallery' == $shortcode['front_type']) { |
|
872 | 872 | |
873 | 873 | $return .= lasso_gallery_editor_module(); |
874 | 874 | |
@@ -879,13 +879,13 @@ discard block |
||
879 | 879 | /////////////////////////// |
880 | 880 | |
881 | 881 | // Single shortcode (not closed) |
882 | - if ( 'single' == $shortcode['type'] ) { |
|
882 | + if ('single' == $shortcode['type']) { |
|
883 | 883 | |
884 | 884 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
885 | 885 | |
886 | 886 | } else { |
887 | 887 | |
888 | - $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>'; |
|
888 | + $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>'; |
|
889 | 889 | } |
890 | 890 | |
891 | 891 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>'; |
@@ -921,14 +921,14 @@ discard block |
||
921 | 921 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
922 | 922 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
923 | 923 | <i class="lasso-icon lasso-icon-move"></i> |
924 | - <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> |
|
924 | + <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> |
|
925 | 925 | <div class="lasso--slider_wrap"> |
926 | 926 | <div id="lasso--slider"></div> |
927 | 927 | </div> |
928 | 928 | <ul id="lasso--revision-list"></ul> |
929 | 929 | <div class="lasso--btn-group lasso--btn-group-small"> |
930 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
931 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
930 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
931 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
932 | 932 | </div> |
933 | 933 | </div> |
934 | 934 | |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | // Normalize into a six character long hex string |
952 | 952 | $hex = str_replace('#', '', $hex); |
953 | 953 | if (strlen($hex) == 3) { |
954 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
954 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | // Split into three parts: R, G and B |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | |
961 | 961 | foreach ($color_parts as $color) { |
962 | 962 | $color = hexdec($color); // Convert to decimal |
963 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
963 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
964 | 964 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
965 | 965 | } |
966 | 966 |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | |
100 | 100 | foreach ( $pages as $page ) { |
101 | 101 | wp_enqueue_media(); |
102 | - wp_enqueue_style( 'wp-color-picker'); |
|
103 | - wp_enqueue_script( 'wp-color-picker'); |
|
102 | + wp_enqueue_style( 'wp-color-picker'); |
|
103 | + wp_enqueue_script( 'wp-color-picker'); |
|
104 | 104 | |
105 | 105 | wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true ); |
106 | 106 | wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION ); |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * Adds an admin notice reminding the user if their license key has not been saved |
|
135 | - * |
|
136 | - * @since 0.9.7 |
|
137 | - * @todo make dismissible |
|
138 | - */ |
|
134 | + * Adds an admin notice reminding the user if their license key has not been saved |
|
135 | + * |
|
136 | + * @since 0.9.7 |
|
137 | + * @todo make dismissible |
|
138 | + */ |
|
139 | 139 | public function license_nag(){ |
140 | 140 | |
141 | 141 | $screen = get_current_screen(); |
@@ -156,26 +156,26 @@ discard block |
||
156 | 156 | |
157 | 157 | if ( empty( $license ) ) { |
158 | 158 | |
159 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
159 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
160 | 160 | |
161 | - } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
161 | + } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
162 | 162 | |
163 | 163 | printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link ); |
164 | 164 | |
165 | - } else if ( empty( $status ) ){ // license key saved but not activated |
|
165 | + } else if ( empty( $status ) ){ // license key saved but not activated |
|
166 | 166 | |
167 | 167 | printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link ); |
168 | 168 | |
169 | - } |
|
169 | + } |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
175 | - * Process hiding the dimiss |
|
176 | - * |
|
177 | - * @since 0.9.7 |
|
178 | - */ |
|
175 | + * Process hiding the dimiss |
|
176 | + * |
|
177 | + * @since 0.9.7 |
|
178 | + */ |
|
179 | 179 | public function dismiss_nag() { |
180 | 180 | |
181 | 181 | if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) { |
@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | $plugin = lasso::get_instance(); |
44 | 44 | $this->plugin_slug = $plugin->get_plugin_slug(); |
45 | 45 | |
46 | - add_action( 'admin_head', array( $this, 'admin_assets' ) ); |
|
47 | - add_action( 'admin_notices', array( $this, 'license_nag' ) ); |
|
48 | - add_action( 'admin_head', array( $this, 'dismiss_nag' ) ); |
|
49 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), 10, 2 ); |
|
46 | + add_action('admin_head', array($this, 'admin_assets')); |
|
47 | + add_action('admin_notices', array($this, 'license_nag')); |
|
48 | + add_action('admin_head', array($this, 'dismiss_nag')); |
|
49 | + add_filter('plugin_row_meta', array($this, 'plugin_meta'), 10, 2); |
|
50 | 50 | |
51 | - if ( !class_exists( 'EDD_SL_Plugin_Updater' ) ) { |
|
51 | + if (!class_exists('EDD_SL_Plugin_Updater')) { |
|
52 | 52 | include LASSO_DIR.'admin/includes/EDD_SL_Plugin_Updater.php'; |
53 | 53 | } |
54 | 54 | |
55 | - if ( !class_exists( 'TGM_Plugin_Activation' ) ) { |
|
55 | + if (!class_exists('TGM_Plugin_Activation')) { |
|
56 | 56 | include LASSO_DIR.'admin/includes/class-tgm-plugin-activation.php'; |
57 | 57 | } |
58 | 58 | |
59 | 59 | new menus\welcome(); |
60 | 60 | new menus\settings(); |
61 | 61 | |
62 | - if ( !defined( 'LASSO_AGENCY_MODE' ) ) { |
|
62 | + if (!defined('LASSO_AGENCY_MODE')) { |
|
63 | 63 | new menus\license(); |
64 | 64 | } |
65 | 65 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public static function get_instance() { |
76 | 76 | |
77 | 77 | // If the single instance hasn't been set, set it now. |
78 | - if ( null == self::$instance ) { |
|
78 | + if (null == self::$instance) { |
|
79 | 79 | self::$instance = new self; |
80 | 80 | } |
81 | 81 | |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | 'dashboard_page_lasso-welcome-screen' |
98 | 98 | ); |
99 | 99 | |
100 | - foreach ( $pages as $page ) { |
|
100 | + foreach ($pages as $page) { |
|
101 | 101 | wp_enqueue_media(); |
102 | - wp_enqueue_style( 'wp-color-picker'); |
|
103 | - wp_enqueue_script( 'wp-color-picker'); |
|
102 | + wp_enqueue_style('wp-color-picker'); |
|
103 | + wp_enqueue_script('wp-color-picker'); |
|
104 | 104 | |
105 | - wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true ); |
|
106 | - wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION ); |
|
105 | + wp_enqueue_script('lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array('jquery', 'wp-color-picker'), LASSO_VERSION, true); |
|
106 | + wp_enqueue_style('lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return array new array of links for our plugin listing on plugins.php |
118 | 118 | */ |
119 | - public function plugin_meta( $links, $file ) { |
|
119 | + public function plugin_meta($links, $file) { |
|
120 | 120 | |
121 | - if ( strpos( $file, 'lasso.php' ) !== false && !defined( 'LASSO_AGENCY_MODE' ) ) { |
|
121 | + if (strpos($file, 'lasso.php') !== false && !defined('LASSO_AGENCY_MODE')) { |
|
122 | 122 | |
123 | 123 | $new_links = array( |
124 | 124 | '<a href="http://edituswp.com/help" target="_blank">Help</a>' |
125 | 125 | ); |
126 | 126 | |
127 | - $links = array_merge( $links, $new_links ); |
|
127 | + $links = array_merge($links, $new_links); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return $links; |
@@ -136,35 +136,35 @@ discard block |
||
136 | 136 | * @since 0.9.7 |
137 | 137 | * @todo make dismissible |
138 | 138 | */ |
139 | - public function license_nag(){ |
|
139 | + public function license_nag() { |
|
140 | 140 | |
141 | - $screen = get_current_screen(); |
|
142 | - $welcome = 'toplevel_page_lasso-editor' == $screen->id; |
|
143 | - $license = get_option( 'lasso_license_key' ); |
|
144 | - $status = get_option( 'lasso_license_status' ); |
|
141 | + $screen = get_current_screen(); |
|
142 | + $welcome = 'toplevel_page_lasso-editor' == $screen->id; |
|
143 | + $license = get_option('lasso_license_key'); |
|
144 | + $status = get_option('lasso_license_status'); |
|
145 | 145 | |
146 | - $message_empty = apply_filters('lasso_empty_license_message','Your license key for support and automatic updates for Editus is missing!'); |
|
147 | - $message_invalid = apply_filters('lasso_invalid_license_message','Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.'); |
|
148 | - $message_inactive = apply_filters('lasso_inactive_license_message','It looks like your license key has not yet been activated.'); |
|
146 | + $message_empty = apply_filters('lasso_empty_license_message', 'Your license key for support and automatic updates for Editus is missing!'); |
|
147 | + $message_invalid = apply_filters('lasso_invalid_license_message', 'Oh snap! It looks like your Editus license key is invalid. Might check here to see if its been added correctly.'); |
|
148 | + $message_inactive = apply_filters('lasso_inactive_license_message', 'It looks like your license key has not yet been activated.'); |
|
149 | 149 | |
150 | - $license_link = sprintf('<a href="%s">Update License</a>', esc_url( add_query_arg( array( 'page' => 'lasso-license' ), admin_url('admin.php') ) ) ); |
|
151 | - $dismiss_link = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url( add_query_arg( 'lasso-notice', 'dismiss' ) ), __('Dismiss this notice.','lasso') ); |
|
150 | + $license_link = sprintf('<a href="%s">Update License</a>', esc_url(add_query_arg(array('page' => 'lasso-license'), admin_url('admin.php')))); |
|
151 | + $dismiss_link = sprintf('<a style="text-decoration:none;" href="%s" id="lasso-dismiss-notice" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>', esc_url(add_query_arg('lasso-notice', 'dismiss')), __('Dismiss this notice.', 'lasso')); |
|
152 | 152 | |
153 | - $not_hidden = get_user_meta( get_current_user_ID(), 'lasso_license_nag_dismissed', true ); |
|
153 | + $not_hidden = get_user_meta(get_current_user_ID(), 'lasso_license_nag_dismissed', true); |
|
154 | 154 | |
155 | - if ( current_user_can('manage_options') && !$welcome && !defined( 'LASSO_AGENCY_MODE') && !$not_hidden ) { |
|
155 | + if (current_user_can('manage_options') && !$welcome && !defined('LASSO_AGENCY_MODE') && !$not_hidden) { |
|
156 | 156 | |
157 | - if ( empty( $license ) ) { |
|
157 | + if (empty($license)) { |
|
158 | 158 | |
159 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
159 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link); |
|
160 | 160 | |
161 | - } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
161 | + } else if ('invalid' == $status) { // license key entered wrong or something |
|
162 | 162 | |
163 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link ); |
|
163 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link, $dismiss_link); |
|
164 | 164 | |
165 | - } else if ( empty( $status ) ){ // license key saved but not activated |
|
165 | + } else if (empty($status)) { // license key saved but not activated |
|
166 | 166 | |
167 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link ); |
|
167 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link); |
|
168 | 168 | |
169 | 169 | } |
170 | 170 | } |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function dismiss_nag() { |
180 | 180 | |
181 | - if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) { |
|
182 | - update_user_meta( get_current_user_id(), 'lasso_license_nag_dismissed', 1 ); |
|
181 | + if (isset($_GET['lasso-notice']) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options')) { |
|
182 | + update_user_meta(get_current_user_id(), 'lasso_license_nag_dismissed', 1); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
44 | - if ( ! empty( $allowed_fields ) ) { |
|
45 | - foreach( $allowed_fields as $field ) { |
|
46 | - if ( isset( $data[ $field ] ) ) { |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | + if (!empty($allowed_fields)) { |
|
45 | + foreach ($allowed_fields as $field) { |
|
46 | + if (isset($data[$field])) { |
|
47 | 47 | //this original line changed dash to underscore |
48 | 48 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
49 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
49 | + update_post_meta($post_id, $field, $data[$field]); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array Array of keys to pull from $data per action and their sanitization callback |
66 | 66 | */ |
67 | - public static function params(){ |
|
68 | - $params[ 'process_meta_update' ] = array( |
|
67 | + public static function params() { |
|
68 | + $params['process_meta_update'] = array( |
|
69 | 69 | 'post_id' => 'absint', |
70 | 70 | 'tab_name' => 'trim' |
71 | 71 | ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return array Array of additional functions to use to authorize action. |
83 | 83 | */ |
84 | 84 | public static function auth_callbacks() { |
85 | - $params[ 'process_meta_update' ] = array( |
|
85 | + $params['process_meta_update'] = array( |
|
86 | 86 | 'lasso_user_can' |
87 | 87 | ); |
88 | 88 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @since 0.0.1 |
79 | 79 | * |
80 | - * @return Plugin slug variable. |
|
80 | + * @return string slug variable. |
|
81 | 81 | */ |
82 | 82 | public function get_plugin_slug() { |
83 | 83 | return $this->plugin_slug; |
@@ -335,6 +335,9 @@ discard block |
||
335 | 335 | exit; |
336 | 336 | } |
337 | 337 | |
338 | + /** |
|
339 | + * @param string $type |
|
340 | + */ |
|
338 | 341 | public static function enable_metasave($type) |
339 | 342 | { |
340 | 343 | register_rest_field( $type, 'metadata', array( |
@@ -451,6 +454,9 @@ discard block |
||
451 | 454 | exit; |
452 | 455 | } |
453 | 456 | |
457 | + /** |
|
458 | + * @param string $taxonomy |
|
459 | + */ |
|
454 | 460 | public function set_post_terms( $postid, $value, $taxonomy ) { |
455 | 461 | if( $value ) { |
456 | 462 | $value = explode( ',', $value ); |
@@ -391,44 +391,34 @@ discard block |
||
391 | 391 | if ($code == "aesop_video") { |
392 | 392 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
393 | 393 | echo aesop_video_shortcode($atts); |
394 | - } |
|
395 | - else if ($code == "aesop_image") { |
|
394 | + } else if ($code == "aesop_image") { |
|
396 | 395 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
397 | 396 | echo aesop_image_shortcode($atts); |
398 | - } |
|
399 | - else if ($code == "aesop_quote") { |
|
397 | + } else if ($code == "aesop_quote") { |
|
400 | 398 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
401 | 399 | echo aesop_quote_shortcode($atts); |
402 | - } |
|
403 | - else if ($code == "aesop_parallax") { |
|
400 | + } else if ($code == "aesop_parallax") { |
|
404 | 401 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
405 | 402 | echo aesop_parallax_shortcode($atts); |
406 | - } |
|
407 | - else if ($code == "aesop_character") { |
|
403 | + } else if ($code == "aesop_character") { |
|
408 | 404 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
409 | 405 | echo aesop_character_shortcode($atts); |
410 | - } |
|
411 | - else if ($code == "aesop_collection") { |
|
406 | + } else if ($code == "aesop_collection") { |
|
412 | 407 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
413 | 408 | echo aesop_collection_shortcode($atts); |
414 | - } |
|
415 | - else if ($code == "aesop_chapter") { |
|
409 | + } else if ($code == "aesop_chapter") { |
|
416 | 410 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
417 | 411 | echo aesop_chapter_shortcode($atts); |
418 | - } |
|
419 | - else if ($code == "aesop_content") { |
|
412 | + } else if ($code == "aesop_content") { |
|
420 | 413 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
421 | 414 | echo aesop_content_shortcode($atts, $atts['content_data']); |
422 | - } |
|
423 | - else if ($code == "aesop_gallery") { |
|
415 | + } else if ($code == "aesop_gallery") { |
|
424 | 416 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
425 | 417 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
426 | - } |
|
427 | - else if ($code == "aesop_audio") { |
|
418 | + } else if ($code == "aesop_audio") { |
|
428 | 419 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
429 | 420 | echo aesop_audio_shortcode($atts); |
430 | - } |
|
431 | - else { |
|
421 | + } else { |
|
432 | 422 | $code = '['.$code.' '; |
433 | 423 | foreach ($atts as $key => $value) { |
434 | 424 | $code = ''.$key.'="'.$value.'" '; |
@@ -471,15 +461,14 @@ discard block |
||
471 | 461 | } |
472 | 462 | |
473 | 463 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
474 | - } |
|
475 | - else { |
|
464 | + } else { |
|
476 | 465 | //remove all terms from post |
477 | 466 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
478 | 467 | } |
479 | 468 | |
480 | 469 | if ( ! is_wp_error( $result ) ) { |
481 | 470 | return true; |
482 | - }else{ |
|
471 | + } else{ |
|
483 | 472 | return false; |
484 | 473 | } |
485 | 474 | } |
@@ -490,13 +479,15 @@ discard block |
||
490 | 479 | |
491 | 480 | $month_numbers = range(1,12); |
492 | 481 | |
493 | - foreach($month_numbers as $month) |
|
494 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
482 | + foreach($month_numbers as $month) { |
|
483 | + $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
484 | + } |
|
495 | 485 | |
496 | 486 | setlocale(LC_ALL, get_locale()); |
497 | 487 | |
498 | - foreach($month_numbers as $month) |
|
499 | - $foreign_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
488 | + foreach($month_numbers as $month) { |
|
489 | + $foreign_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
490 | + } |
|
500 | 491 | |
501 | 492 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
502 | 493 | } |
@@ -262,14 +262,14 @@ discard block |
||
262 | 262 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
263 | 263 | } |
264 | 264 | |
265 | - // new ajax function to lock post for editing |
|
265 | + // new ajax function to lock post for editing |
|
266 | 266 | public function editus_lock_post() |
267 | 267 | { |
268 | 268 | $post_id= $_POST["postid"]; |
269 | 269 | $locked = wp_check_post_lock($post_id); |
270 | 270 | |
271 | 271 | if (!$locked) { |
272 | - wp_set_post_lock($post_id); |
|
272 | + wp_set_post_lock($post_id); |
|
273 | 273 | echo "true"; |
274 | 274 | } else { |
275 | 275 | $user_info = get_userdata($locked); |
@@ -384,59 +384,59 @@ discard block |
||
384 | 384 | ); |
385 | 385 | foreach ($_POST as $key => $value) { |
386 | 386 | if ($key !="code" && $key !="action") { |
387 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
387 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
388 | 388 | $atts[$key] = $value; |
389 | 389 | } |
390 | 390 | } |
391 | 391 | if ($code == "aesop_video") { |
392 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
393 | - echo aesop_video_shortcode($atts); |
|
392 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
393 | + echo aesop_video_shortcode($atts); |
|
394 | 394 | } |
395 | 395 | else if ($code == "aesop_image") { |
396 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
397 | - echo aesop_image_shortcode($atts); |
|
396 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
397 | + echo aesop_image_shortcode($atts); |
|
398 | 398 | } |
399 | 399 | else if ($code == "aesop_quote") { |
400 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
401 | - echo aesop_quote_shortcode($atts); |
|
400 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
401 | + echo aesop_quote_shortcode($atts); |
|
402 | 402 | } |
403 | 403 | else if ($code == "aesop_parallax") { |
404 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
405 | - echo aesop_parallax_shortcode($atts); |
|
404 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
405 | + echo aesop_parallax_shortcode($atts); |
|
406 | 406 | } |
407 | 407 | else if ($code == "aesop_character") { |
408 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
409 | - echo aesop_character_shortcode($atts); |
|
408 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
409 | + echo aesop_character_shortcode($atts); |
|
410 | 410 | } |
411 | 411 | else if ($code == "aesop_collection") { |
412 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
413 | - echo aesop_collection_shortcode($atts); |
|
412 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
413 | + echo aesop_collection_shortcode($atts); |
|
414 | 414 | } |
415 | 415 | else if ($code == "aesop_chapter") { |
416 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
417 | - echo aesop_chapter_shortcode($atts); |
|
416 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
417 | + echo aesop_chapter_shortcode($atts); |
|
418 | 418 | } |
419 | 419 | else if ($code == "aesop_content") { |
420 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
421 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
420 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
421 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
422 | 422 | } |
423 | 423 | else if ($code == "aesop_gallery") { |
424 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
425 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
424 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
425 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
426 | 426 | } |
427 | 427 | else if ($code == "aesop_audio") { |
428 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
429 | - echo aesop_audio_shortcode($atts); |
|
428 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
429 | + echo aesop_audio_shortcode($atts); |
|
430 | 430 | } |
431 | 431 | else { |
432 | 432 | $code = '['.$code.' '; |
433 | 433 | foreach ($atts as $key => $value) { |
434 | - $code = ''.$key.'="'.$value.'" '; |
|
434 | + $code = ''.$key.'="'.$value.'" '; |
|
435 | 435 | } |
436 | 436 | $code = $code.']'; |
437 | 437 | echo do_shortcode($code); |
438 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
439 | - //echo aesop_audio_shortcode($atts); |
|
438 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
439 | + //echo aesop_audio_shortcode($atts); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | exit; |
@@ -457,14 +457,14 @@ discard block |
||
457 | 457 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
458 | 458 | |
459 | 459 | if ($taxonomy =='category') { |
460 | - // convert from names to category ids |
|
460 | + // convert from names to category ids |
|
461 | 461 | $cats = array(); |
462 | 462 | foreach ($value as $cat) { |
463 | 463 | $cat_id = get_cat_ID($cat); |
464 | 464 | if ($cat_id !=0) { |
465 | 465 | $cats [] = $cat_id; |
466 | 466 | } else if ($allow_new_category) { |
467 | - $cats [] = wp_create_category($cat); |
|
467 | + $cats [] = wp_create_category($cat); |
|
468 | 468 | } |
469 | 469 | } |
470 | 470 | $value = $cats; |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | public function set_date( $postid, $value) { |
507 | 507 | if( $value ) { |
508 | 508 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
509 | - wp_update_post( |
|
509 | + wp_update_post( |
|
510 | 510 | array ( |
511 | 511 | 'ID' => $postid, // ID of the post to update |
512 | 512 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
63 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
64 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
65 | - add_action( 'wp_ajax_editus_get_ase_options', array( $this, 'get_ase_options' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
63 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
64 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
65 | + add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options')); |
|
66 | 66 | |
67 | 67 | // enable saving custom fields through REST API |
68 | 68 | self::enable_metasave('post'); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public static function get_instance() { |
94 | 94 | |
95 | 95 | // If the single instance hasn't been set, set it now. |
96 | - if ( null == self::$instance ) { |
|
96 | + if (null == self::$instance) { |
|
97 | 97 | self::$instance = new self; |
98 | 98 | } |
99 | 99 | |
@@ -110,18 +110,18 @@ discard block |
||
110 | 110 | * WPMU is disabled or plugin is |
111 | 111 | * activated on an individual blog. |
112 | 112 | */ |
113 | - public static function activate( $network_wide ) { |
|
113 | + public static function activate($network_wide) { |
|
114 | 114 | |
115 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
115 | + if (function_exists('is_multisite') && is_multisite()) { |
|
116 | 116 | |
117 | - if ( $network_wide ) { |
|
117 | + if ($network_wide) { |
|
118 | 118 | |
119 | 119 | // Get all blog ids |
120 | 120 | $blog_ids = self::get_blog_ids(); |
121 | 121 | |
122 | - foreach ( $blog_ids as $blog_id ) { |
|
122 | + foreach ($blog_ids as $blog_id) { |
|
123 | 123 | |
124 | - switch_to_blog( $blog_id ); |
|
124 | + switch_to_blog($blog_id); |
|
125 | 125 | self::single_activate(); |
126 | 126 | } |
127 | 127 | |
@@ -147,18 +147,18 @@ discard block |
||
147 | 147 | * WPMU is disabled or plugin is |
148 | 148 | * deactivated on an individual blog. |
149 | 149 | */ |
150 | - public static function deactivate( $network_wide ) { |
|
150 | + public static function deactivate($network_wide) { |
|
151 | 151 | |
152 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
152 | + if (function_exists('is_multisite') && is_multisite()) { |
|
153 | 153 | |
154 | - if ( $network_wide ) { |
|
154 | + if ($network_wide) { |
|
155 | 155 | |
156 | 156 | // Get all blog ids |
157 | 157 | $blog_ids = self::get_blog_ids(); |
158 | 158 | |
159 | - foreach ( $blog_ids as $blog_id ) { |
|
159 | + foreach ($blog_ids as $blog_id) { |
|
160 | 160 | |
161 | - switch_to_blog( $blog_id ); |
|
161 | + switch_to_blog($blog_id); |
|
162 | 162 | self::single_deactivate(); |
163 | 163 | |
164 | 164 | } |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | * |
183 | 183 | * @param int $blog_id ID of the new blog. |
184 | 184 | */ |
185 | - public function activate_new_site( $blog_id ) { |
|
185 | + public function activate_new_site($blog_id) { |
|
186 | 186 | |
187 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
187 | + if (1 !== did_action('wpmu_new_blog')) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | - switch_to_blog( $blog_id ); |
|
191 | + switch_to_blog($blog_id); |
|
192 | 192 | self::single_activate(); |
193 | 193 | restore_current_blog(); |
194 | 194 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | WHERE archived = '0' AND spam = '0' |
214 | 214 | AND deleted = '0'"; |
215 | 215 | |
216 | - return $wpdb->get_col( $sql ); |
|
216 | + return $wpdb->get_col($sql); |
|
217 | 217 | |
218 | 218 | } |
219 | 219 | |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | */ |
225 | 225 | private static function single_activate() { |
226 | 226 | |
227 | - $curr_version = get_option( 'lasso_version' ); |
|
227 | + $curr_version = get_option('lasso_version'); |
|
228 | 228 | |
229 | 229 | // update upgraded from |
230 | - if ( $curr_version ) { |
|
231 | - update_option( 'lasso_updated_from', $curr_version ); |
|
230 | + if ($curr_version) { |
|
231 | + update_option('lasso_updated_from', $curr_version); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | // update lasso version option |
235 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
235 | + update_option('lasso_version', LASSO_VERSION); |
|
236 | 236 | |
237 | 237 | // set transietn for activation welcome |
238 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
238 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
239 | 239 | |
240 | 240 | |
241 | 241 | } |
@@ -257,15 +257,15 @@ discard block |
||
257 | 257 | public function load_plugin_textdomain() { |
258 | 258 | |
259 | 259 | $domain = $this->plugin_slug; |
260 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
260 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
261 | 261 | |
262 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
262 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | // new ajax function to lock post for editing |
266 | 266 | public function editus_lock_post() |
267 | 267 | { |
268 | - $post_id= $_POST["postid"]; |
|
268 | + $post_id = $_POST["postid"]; |
|
269 | 269 | $locked = wp_check_post_lock($post_id); |
270 | 270 | |
271 | 271 | if (!$locked) { |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | echo "true"; |
274 | 274 | } else { |
275 | 275 | $user_info = get_userdata($locked); |
276 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
276 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
277 | 277 | } |
278 | 278 | exit; |
279 | 279 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | { |
284 | 284 | $user_id = get_current_user_ID(); |
285 | 285 | |
286 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
286 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
287 | 287 | exit; |
288 | 288 | } |
289 | 289 | |
@@ -294,14 +294,14 @@ discard block |
||
294 | 294 | $data = array(); |
295 | 295 | parse_str($_POST['data'], $data); |
296 | 296 | |
297 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
297 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
298 | 298 | wp_send_json_error(); |
299 | 299 | exit; |
300 | 300 | } |
301 | 301 | |
302 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
303 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
304 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
302 | + $status = isset($data['status']) ? $data['status'] : false; |
|
303 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
304 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
305 | 305 | |
306 | 306 | |
307 | 307 | $args = array( |
@@ -312,24 +312,24 @@ discard block |
||
312 | 312 | |
313 | 313 | |
314 | 314 | |
315 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
315 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
316 | 316 | |
317 | 317 | // update categories |
318 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
318 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
319 | 319 | |
320 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
320 | + self::set_post_terms($postid, $cats, 'category'); |
|
321 | 321 | |
322 | 322 | // update tags |
323 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
324 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
323 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
324 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
325 | 325 | |
326 | 326 | //update date |
327 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
328 | - self::set_date( $postid, $date ); |
|
327 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
328 | + self::set_date($postid, $date); |
|
329 | 329 | |
330 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
331 | - $response= array( |
|
332 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
330 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
331 | + $response = array( |
|
332 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
333 | 333 | ); |
334 | 334 | wp_send_json_success($response); |
335 | 335 | exit; |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | |
338 | 338 | public static function enable_metasave($type) |
339 | 339 | { |
340 | - register_rest_field( $type, 'metadata', array( |
|
341 | - 'get_callback' => function ( $data ) { |
|
342 | - return get_post_meta( $data['id']);//, '', '' ); |
|
340 | + register_rest_field($type, 'metadata', array( |
|
341 | + 'get_callback' => function($data) { |
|
342 | + return get_post_meta($data['id']); //, '', '' ); |
|
343 | 343 | }, |
344 | - 'update_callback' => function( $data, $post ) { |
|
344 | + 'update_callback' => function($data, $post) { |
|
345 | 345 | foreach ($data as $key => $value) { |
346 | 346 | update_post_meta($post->ID, $key, $value); |
347 | 347 | } |
@@ -353,13 +353,13 @@ discard block |
||
353 | 353 | public function editus_do_shortcode() |
354 | 354 | { |
355 | 355 | |
356 | - $code= $_POST["code"]; |
|
356 | + $code = $_POST["code"]; |
|
357 | 357 | $code = str_replace('\"', '"', $code); |
358 | 358 | |
359 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
360 | - $out = do_shortcode($code); |
|
359 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
360 | + $out = do_shortcode($code); |
|
361 | 361 | if ($out != '') { |
362 | - $out = do_shortcode($code_wrapped); |
|
362 | + $out = do_shortcode($code_wrapped); |
|
363 | 363 | echo $out; |
364 | 364 | exit; |
365 | 365 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | /** @var \WP_Embed $wp_embed */ |
370 | 370 | global $wp_embed; |
371 | 371 | $wp_embed->post_ID = $_POST["ID"]; |
372 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
372 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
373 | 373 | |
374 | 374 | echo $out; |
375 | 375 | exit; |
@@ -379,53 +379,53 @@ discard block |
||
379 | 379 | { |
380 | 380 | |
381 | 381 | |
382 | - $code= $_POST["code"]; |
|
382 | + $code = $_POST["code"]; |
|
383 | 383 | $atts = array( |
384 | 384 | ); |
385 | 385 | foreach ($_POST as $key => $value) { |
386 | - if ($key !="code" && $key !="action") { |
|
386 | + if ($key != "code" && $key != "action") { |
|
387 | 387 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
388 | 388 | $atts[$key] = $value; |
389 | 389 | } |
390 | 390 | } |
391 | 391 | if ($code == "aesop_video") { |
392 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
392 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
393 | 393 | echo aesop_video_shortcode($atts); |
394 | 394 | } |
395 | 395 | else if ($code == "aesop_image") { |
396 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
396 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
397 | 397 | echo aesop_image_shortcode($atts); |
398 | 398 | } |
399 | 399 | else if ($code == "aesop_quote") { |
400 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
400 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
401 | 401 | echo aesop_quote_shortcode($atts); |
402 | 402 | } |
403 | 403 | else if ($code == "aesop_parallax") { |
404 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
404 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
405 | 405 | echo aesop_parallax_shortcode($atts); |
406 | 406 | } |
407 | 407 | else if ($code == "aesop_character") { |
408 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
408 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
409 | 409 | echo aesop_character_shortcode($atts); |
410 | 410 | } |
411 | 411 | else if ($code == "aesop_collection") { |
412 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
412 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
413 | 413 | echo aesop_collection_shortcode($atts); |
414 | 414 | } |
415 | 415 | else if ($code == "aesop_chapter") { |
416 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
416 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
417 | 417 | echo aesop_chapter_shortcode($atts); |
418 | 418 | } |
419 | 419 | else if ($code == "aesop_content") { |
420 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
420 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
421 | 421 | echo aesop_content_shortcode($atts, $atts['content_data']); |
422 | 422 | } |
423 | 423 | else if ($code == "aesop_gallery") { |
424 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
425 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
424 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
425 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
426 | 426 | } |
427 | 427 | else if ($code == "aesop_audio") { |
428 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
428 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
429 | 429 | echo aesop_audio_shortcode($atts); |
430 | 430 | } |
431 | 431 | else { |
@@ -446,22 +446,22 @@ discard block |
||
446 | 446 | public function get_ase_options() |
447 | 447 | { |
448 | 448 | $blob = lasso_editor_options_blob(); |
449 | - $code= $_POST["component"]; |
|
449 | + $code = $_POST["component"]; |
|
450 | 450 | echo $blob[$code]; |
451 | 451 | exit; |
452 | 452 | } |
453 | 453 | |
454 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
455 | - if( $value ) { |
|
456 | - $value = explode( ',', $value ); |
|
457 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
454 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
455 | + if ($value) { |
|
456 | + $value = explode(',', $value); |
|
457 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
458 | 458 | |
459 | - if ($taxonomy =='category') { |
|
459 | + if ($taxonomy == 'category') { |
|
460 | 460 | // convert from names to category ids |
461 | 461 | $cats = array(); |
462 | 462 | foreach ($value as $cat) { |
463 | 463 | $cat_id = get_cat_ID($cat); |
464 | - if ($cat_id !=0) { |
|
464 | + if ($cat_id != 0) { |
|
465 | 465 | $cats [] = $cat_id; |
466 | 466 | } else if ($allow_new_category) { |
467 | 467 | $cats [] = wp_create_category($cat); |
@@ -470,47 +470,47 @@ discard block |
||
470 | 470 | $value = $cats; |
471 | 471 | } |
472 | 472 | |
473 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
473 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
474 | 474 | } |
475 | - else { |
|
475 | + else { |
|
476 | 476 | //remove all terms from post |
477 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
477 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
478 | 478 | } |
479 | 479 | |
480 | - if ( ! is_wp_error( $result ) ) { |
|
480 | + if (!is_wp_error($result)) { |
|
481 | 481 | return true; |
482 | - }else{ |
|
482 | + } else { |
|
483 | 483 | return false; |
484 | 484 | } |
485 | 485 | } |
486 | 486 | |
487 | - function getEnglishMonthName($foreignMonthName){ |
|
487 | + function getEnglishMonthName($foreignMonthName) { |
|
488 | 488 | |
489 | 489 | setlocale(LC_ALL, 'en_US'); |
490 | 490 | |
491 | - $month_numbers = range(1,12); |
|
491 | + $month_numbers = range(1, 12); |
|
492 | 492 | |
493 | - foreach($month_numbers as $month) |
|
494 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
493 | + foreach ($month_numbers as $month) |
|
494 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
495 | 495 | |
496 | 496 | setlocale(LC_ALL, get_locale()); |
497 | 497 | |
498 | - foreach($month_numbers as $month) |
|
499 | - $foreign_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
498 | + foreach ($month_numbers as $month) |
|
499 | + $foreign_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
500 | 500 | |
501 | 501 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
502 | 502 | } |
503 | 503 | |
504 | 504 | |
505 | 505 | |
506 | - public function set_date( $postid, $value) { |
|
507 | - if( $value ) { |
|
508 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
506 | + public function set_date($postid, $value) { |
|
507 | + if ($value) { |
|
508 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
509 | 509 | wp_update_post( |
510 | - array ( |
|
510 | + array( |
|
511 | 511 | 'ID' => $postid, // ID of the post to update |
512 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
513 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
512 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
513 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
514 | 514 | ) |
515 | 515 | ); |
516 | 516 | } |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | |
21 | 21 | global $post; |
22 | 22 | if ( lasso_user_can('edit_posts') && |
23 | - !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc |
|
23 | + !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc |
|
24 | 24 | |
25 | 25 | /** Returns the time offset from UTC |
26 | - */ |
|
26 | + */ |
|
27 | 27 | function get_UTC_offset() { |
28 | 28 | $timezone_string = get_option( 'timezone_string' ); |
29 | 29 | if (empty( $timezone_string ) ) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
40 | 40 | |
41 | - //don't load autocomplete if it's a stockholm theme |
|
41 | + //don't load autocomplete if it's a stockholm theme |
|
42 | 42 | $themename = wp_get_theme()->get('Name'); |
43 | 43 | if ($themename !='Stockholm' ) { |
44 | 44 | wp_enqueue_script('jquery-ui-autocomplete'); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $tz_offset = get_UTC_offset(); |
114 | 114 | $post_date = get_the_time('U', $postid); |
115 | 115 | $time = (time()+$tz_offset); |
116 | - $delta = $time - $post_date; |
|
116 | + $delta = $time - $post_date; |
|
117 | 117 | |
118 | 118 | $strings = array( |
119 | 119 | 'save' => __('Save','lasso'), |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
166 | 166 | |
167 | 167 | |
168 | - if ($allow_change_date) { |
|
169 | - $permalink = get_site_url().'/?p='.$postid; |
|
170 | - } else { |
|
171 | - $permalink = get_permalink($postid); |
|
172 | - } |
|
168 | + if ($allow_change_date) { |
|
169 | + $permalink = get_site_url().'/?p='.$postid; |
|
170 | + } else { |
|
171 | + $permalink = get_permalink($postid); |
|
172 | + } |
|
173 | 173 | |
174 | 174 | // rest api |
175 | 175 | $rest_nonce = ''; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | 'customFields' => $custom_fields, |
264 | 264 | 'clickToInsert' => ($insert_comp_ui =='click'), |
265 | 265 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
266 | - 'rtl' => is_rtl(), |
|
266 | + 'rtl' => is_rtl(), |
|
267 | 267 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
268 | 268 | 'linksEditable' => $links_editable, |
269 | 269 | 'supportPendingStatus' => !$no_pending_status |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | |
276 | 276 | if (!$using_restapiv2) { |
277 | - // enqueue REST API V1 |
|
277 | + // enqueue REST API V1 |
|
278 | 278 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
279 | 279 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
280 | 280 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | if ($show_color) { |
291 | 291 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
292 | 292 | } else { |
293 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
293 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
294 | 294 | } |
295 | 295 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
296 | 296 |
@@ -10,24 +10,24 @@ 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 | 21 | global $post; |
22 | - if ( lasso_user_can('edit_posts') && |
|
23 | - !( function_exists( 'is_gutenberg_page' ) && has_blocks( $post->post_content) )) {// bail if the post has Gutenberg bloc |
|
22 | + if (lasso_user_can('edit_posts') && |
|
23 | + !(function_exists('is_gutenberg_page') && has_blocks($post->post_content))) {// bail if the post has Gutenberg bloc |
|
24 | 24 | |
25 | 25 | /** Returns the time offset from UTC |
26 | 26 | */ |
27 | 27 | function get_UTC_offset() { |
28 | - $timezone_string = get_option( 'timezone_string' ); |
|
29 | - if (empty( $timezone_string ) ) { |
|
30 | - return get_option('gmt_offset')*3600; |
|
28 | + $timezone_string = get_option('timezone_string'); |
|
29 | + if (empty($timezone_string)) { |
|
30 | + return get_option('gmt_offset') * 3600; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $origin_dtz = new \DateTimeZone($timezone_string); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
40 | 40 | |
41 | 41 | //don't load autocomplete if it's a stockholm theme |
42 | - $themename = wp_get_theme()->get('Name'); |
|
43 | - if ($themename !='Stockholm' ) { |
|
42 | + $themename = wp_get_theme()->get('Name'); |
|
43 | + if ($themename != 'Stockholm') { |
|
44 | 44 | wp_enqueue_script('jquery-ui-autocomplete'); |
45 | 45 | } |
46 | 46 | wp_enqueue_script('jquery-ui-draggable'); |
@@ -53,28 +53,28 @@ discard block |
||
53 | 53 | // url for json api |
54 | 54 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
55 | 55 | |
56 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
56 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
57 | 57 | |
58 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
58 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
59 | 59 | |
60 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
61 | - if (empty( $featImgClass )) { |
|
60 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
61 | + if (empty($featImgClass)) { |
|
62 | 62 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
63 | 63 | } |
64 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
65 | - if (empty( $titleClass )) { |
|
64 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
65 | + if (empty($titleClass)) { |
|
66 | 66 | $titleClass = lasso_get_supported_theme_title_class(); |
67 | 67 | } |
68 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
69 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
68 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
69 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
70 | 70 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
71 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
71 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
72 | 72 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
73 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
74 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
73 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
74 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
75 | 75 | |
76 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
77 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
76 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
77 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
78 | 78 | |
79 | 79 | |
80 | 80 | //text alignement |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | |
92 | 92 | if ($show_color) { |
93 | 93 | //color picker |
94 | - wp_enqueue_style( 'wp-color-picker' ); |
|
95 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
94 | + wp_enqueue_style('wp-color-picker'); |
|
95 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | // click to insert components, not drag and drop |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | // custom fields |
106 | 106 | |
107 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
107 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
108 | 108 | |
109 | 109 | |
110 | 110 | |
@@ -112,57 +112,57 @@ discard block |
||
112 | 112 | $postid = get_the_ID(); |
113 | 113 | $tz_offset = get_UTC_offset(); |
114 | 114 | $post_date = get_the_time('U', $postid); |
115 | - $time = (time()+$tz_offset); |
|
115 | + $time = (time() + $tz_offset); |
|
116 | 116 | $delta = $time - $post_date; |
117 | 117 | |
118 | 118 | $strings = array( |
119 | - 'save' => __('Save','lasso'), |
|
120 | - 'selectText' => __('Please Select Text First.','lasso'), |
|
121 | - 'cancel' => __('Cancel','lasso'), |
|
122 | - 'exiteditor' => __('Exit Editor','lasso'), |
|
123 | - 'saving' => __('Saving...','lasso'), |
|
124 | - 'saved' => __('Saved!','lasso'), |
|
125 | - 'adding' => __('Adding...','lasso'), |
|
126 | - 'added' => __('Added!','lasso'), |
|
127 | - 'loading' => __('Loading...','lasso'), |
|
128 | - 'loadMore' => __('Load More','lasso'), |
|
129 | - 'close' => __('Close','lasso'), |
|
130 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
131 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
132 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
133 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
134 | - 'justWrite' => __('Just write...','lasso'), |
|
135 | - 'chooseImage' => __('Choose an image','lasso'), |
|
136 | - 'updateImage' => __('Update Image','lasso'), |
|
137 | - 'insertImage' => __('Insert Image','lasso'), |
|
138 | - 'selectImage' => __('Select Image','lasso'), |
|
139 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
140 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
141 | - 'chooseImages' => __('Choose images','lasso'), |
|
142 | - 'editImage' => __('Edit Image','lasso'), |
|
143 | - 'addImages' => __('Add Images','lasso'), |
|
144 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
145 | - 'selectGallery' => __('Select Editus Gallery Image','lasso'), |
|
146 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
147 | - 'publishPost' => __('Publish Post?','lasso'), |
|
148 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
149 | - 'deletePost' => __('Trash Post?','lasso'), |
|
150 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
151 | - 'warning' => __('Oh snap!','laso'), |
|
152 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
153 | - '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'), |
|
119 | + 'save' => __('Save', 'lasso'), |
|
120 | + 'selectText' => __('Please Select Text First.', 'lasso'), |
|
121 | + 'cancel' => __('Cancel', 'lasso'), |
|
122 | + 'exiteditor' => __('Exit Editor', 'lasso'), |
|
123 | + 'saving' => __('Saving...', 'lasso'), |
|
124 | + 'saved' => __('Saved!', 'lasso'), |
|
125 | + 'adding' => __('Adding...', 'lasso'), |
|
126 | + 'added' => __('Added!', 'lasso'), |
|
127 | + 'loading' => __('Loading...', 'lasso'), |
|
128 | + 'loadMore' => __('Load More', 'lasso'), |
|
129 | + 'close' => __('Close', 'lasso'), |
|
130 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
131 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
132 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
133 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
134 | + 'justWrite' => __('Just write...', 'lasso'), |
|
135 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
136 | + 'updateImage' => __('Update Image', 'lasso'), |
|
137 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
138 | + 'selectImage' => __('Select Image', 'lasso'), |
|
139 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
140 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
141 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
142 | + 'editImage' => __('Edit Image', 'lasso'), |
|
143 | + 'addImages' => __('Add Images', 'lasso'), |
|
144 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
145 | + 'selectGallery' => __('Select Editus Gallery Image', 'lasso'), |
|
146 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
147 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
148 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
149 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
150 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
151 | + 'warning' => __('Oh snap!', 'laso'), |
|
152 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
153 | + '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'), |
|
154 | 154 | 'missingConfirm' => __('Update Settings', 'lasso'), |
155 | - 'helperText' => __('one more letter','lasso'), |
|
155 | + 'helperText' => __('one more letter', 'lasso'), |
|
156 | 156 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
157 | 157 | |
158 | 158 | |
159 | 159 | ); |
160 | 160 | |
161 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
161 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
162 | 162 | |
163 | 163 | $gallery_class = new gallery(); |
164 | 164 | $gallery_nonce_action = $gallery_class->nonce_action; |
165 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
165 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
166 | 166 | |
167 | 167 | |
168 | 168 | if ($allow_change_date) { |
@@ -177,13 +177,13 @@ discard block |
||
177 | 177 | |
178 | 178 | if (function_exists('rest_url')) { |
179 | 179 | //$rest_root = esc_url_raw( rest_url()); |
180 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
181 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
182 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
183 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
184 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
180 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
181 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
182 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
183 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
184 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
185 | 185 | |
186 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
186 | + if (class_exists('WP_REST_Controller')) { |
|
187 | 187 | // we are using REST API V2 |
188 | 188 | $using_restapiv2 = true; |
189 | 189 | } |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | |
192 | 192 | // localized objects |
193 | 193 | $objects = array( |
194 | - 'ajaxurl' => esc_url( $api_url ), |
|
195 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
194 | + 'ajaxurl' => esc_url($api_url), |
|
195 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
196 | 196 | 'siteUrl' => site_url(), |
197 | 197 | 'rest_root' => $rest_root, |
198 | 198 | 'rest_nonce' => $rest_nonce, |
@@ -201,13 +201,13 @@ discard block |
||
201 | 201 | 'featImgClass' => $featImgClass, |
202 | 202 | 'titleClass' => $titleClass, |
203 | 203 | 'strings' => $strings, |
204 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
205 | - 'post_status' => get_post_status( $postid ), |
|
204 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
205 | + 'post_status' => get_post_status($postid), |
|
206 | 206 | 'postid' => $postid, |
207 | 207 | 'permalink' => $permalink, |
208 | 208 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
209 | 209 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
210 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
210 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
211 | 211 | 'can_publish' => is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'), |
212 | 212 | //'can_publish_posts' => current_user_can('publish_posts'), |
213 | 213 | //'can_publish_pages' => current_user_can('publish_pages'), |
@@ -243,28 +243,28 @@ discard block |
||
243 | 243 | 'postTags' => lasso_get_objects('tag'), |
244 | 244 | 'noResultsDiv' => lasso_editor_empty_results(), |
245 | 245 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
246 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
247 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
248 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
249 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
246 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
247 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
248 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
249 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
250 | 250 | 'revisionModal' => lasso_editor_revision_modal(), |
251 | 251 | 'isMobile' => wp_is_mobile(), |
252 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
252 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
253 | 253 | 'showColor' => $show_color, |
254 | 254 | 'showAlignment' => $show_align, |
255 | 255 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
256 | 256 | 'restapi2' => $using_restapiv2, |
257 | 257 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
258 | - 'newObjectContent' => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>', |
|
258 | + 'newObjectContent' => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>', |
|
259 | 259 | 'disableSavePost' => $save_to_post_disabled, |
260 | 260 | 'disableEditPost' => $edit_post_disabled, |
261 | 261 | 'boldTag' => $bold_tag, |
262 | 262 | 'iTag' => $i_tag, |
263 | 263 | 'customFields' => $custom_fields, |
264 | - 'clickToInsert' => ($insert_comp_ui =='click'), |
|
265 | - 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
|
264 | + 'clickToInsert' => ($insert_comp_ui == 'click'), |
|
265 | + 'buttonOnEmptyP' => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph |
|
266 | 266 | 'rtl' => is_rtl(), |
267 | - 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
|
267 | + 'skipToEdit' =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode |
|
268 | 268 | 'linksEditable' => $links_editable, |
269 | 269 | 'supportPendingStatus' => !$no_pending_status |
270 | 270 | ); |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | |
276 | 276 | if (!$using_restapiv2) { |
277 | 277 | // enqueue REST API V1 |
278 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
279 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
280 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
278 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
279 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
280 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | if ($allow_change_date) { |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | wp_enqueue_style('jquery-ui'); |
287 | 287 | } |
288 | 288 | |
289 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
289 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
290 | 290 | if ($show_color) { |
291 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
291 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
292 | 292 | } else { |
293 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
293 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
294 | 294 | } |
295 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
295 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
296 | 296 | |
297 | 297 | |
298 | 298 | } |