@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( !function_exists( 'lasso_backbone_templates' ) ): |
|
3 | +if (!function_exists('lasso_backbone_templates')): |
|
4 | 4 | |
5 | 5 | add_action('wp_footer', 'lasso_backbone_templates'); |
6 | - function lasso_backbone_templates(){ |
|
6 | + function lasso_backbone_templates() { |
|
7 | 7 | |
8 | 8 | $can_delete = lasso_user_can('delete_posts'); |
9 | 9 | $can_delete_class = $can_delete ? false : 'no-delete'; |
10 | 10 | |
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | - if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
|
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
13 | + if (is_user_logged_in() && lasso_user_can('edit_posts')) { |
|
14 | + if (!class_exists('WP_REST_Controller')) { |
|
15 | 15 | // using rest api v1 |
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
19 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
19 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
20 | 20 | <%= post.title %> |
21 | 21 | |
22 | 22 | <div class="lasso--post-list__controls"> |
23 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
24 | - <?php if( $can_delete ): ?> |
|
25 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
23 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
24 | + <?php if ($can_delete): ?> |
|
25 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
26 | 26 | <?php endif; ?> |
27 | 27 | </div> |
28 | 28 | </a> |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | ?> |
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
37 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
38 | 38 | <%= post.title.rendered %> |
39 | 39 | |
40 | 40 | <div class="lasso--post-list__controls"> |
41 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
42 | - <?php if( $can_delete ): ?> |
|
43 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
41 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
42 | + <?php if ($can_delete): ?> |
|
43 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
44 | 44 | <?php endif; ?> |
45 | 45 | </div> |
46 | 46 | </a> |
@@ -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 | } |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | -if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) { |
|
10 | - add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 ); |
|
9 | +if (lasso_user_can('edit_posts') && !is_admin()) { |
|
10 | + add_filter('the_content', 'lasso_wrap_shortcodes', 9); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -20,33 +20,33 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return string |
22 | 22 | */ |
23 | -function lasso_wrap_shortcodes( $content ) { |
|
23 | +function lasso_wrap_shortcodes($content) { |
|
24 | 24 | global $shortcode_tags; |
25 | 25 | |
26 | - if ( false === strpos( $content, '[' ) ) { |
|
26 | + if (false === strpos($content, '[')) { |
|
27 | 27 | return $content; |
28 | 28 | } |
29 | 29 | |
30 | - if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) { |
|
30 | + if (empty($shortcode_tags) || !is_array($shortcode_tags)) { |
|
31 | 31 | return $content; |
32 | 32 | } |
33 | 33 | |
34 | - $tagnames = array_keys( $shortcode_tags ); |
|
35 | - $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); |
|
34 | + $tagnames = array_keys($shortcode_tags); |
|
35 | + $tagregexp = join('|', array_map('preg_quote', $tagnames)); |
|
36 | 36 | $pattern = "/\\[($tagregexp)/s"; |
37 | 37 | |
38 | - if ( 0 === preg_match( $pattern, $content ) ) { |
|
38 | + if (0 === preg_match($pattern, $content)) { |
|
39 | 39 | // Avoids parsing HTML when there are no shortcodes or embeds anyway. |
40 | 40 | return $content; |
41 | 41 | } |
42 | 42 | |
43 | - $content = do_shortcodes_in_html_tags( $content, true ,$tagnames); |
|
43 | + $content = do_shortcodes_in_html_tags($content, true, $tagnames); |
|
44 | 44 | |
45 | 45 | $pattern = get_shortcode_regex(); |
46 | - $content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content ); |
|
46 | + $content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content); |
|
47 | 47 | |
48 | 48 | // Always restore square braces so we don't break things like <!--[if IE ]> |
49 | - $content = unescape_invalid_shortcodes( $content ); |
|
49 | + $content = unescape_invalid_shortcodes($content); |
|
50 | 50 | |
51 | 51 | return $content; |
52 | 52 | } |
@@ -60,33 +60,33 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return string |
62 | 62 | */ |
63 | -function lasso_wrap_shortcode_tag( $m ) { |
|
63 | +function lasso_wrap_shortcode_tag($m) { |
|
64 | 64 | // allow [[foo]] syntax for escaping a tag |
65 | - if ( $m[1] == '[' && $m[6] == ']' ) { |
|
66 | - return substr( $m[0], 1, - 1 ); |
|
65 | + if ($m[1] == '[' && $m[6] == ']') { |
|
66 | + return substr($m[0], 1, - 1); |
|
67 | 67 | } |
68 | - $exception_arr1 = array('aesop_gallery_pop','aesop_character_carousel'); |
|
69 | - $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler','av_textblock','av_toggle_container','av_toggle'); |
|
70 | - $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions',$exception_arr2); |
|
68 | + $exception_arr1 = array('aesop_gallery_pop', 'aesop_character_carousel'); |
|
69 | + $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler', 'av_textblock', 'av_toggle_container', 'av_toggle'); |
|
70 | + $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions', $exception_arr2); |
|
71 | 71 | |
72 | - if ( strpos( $m[2],'aesop_' ) === 0 ) { |
|
72 | + if (strpos($m[2], 'aesop_') === 0) { |
|
73 | 73 | // check against the exceptions |
74 | - if (strpos_arr($m[2],$exception_arr1)===false) { |
|
74 | + if (strpos_arr($m[2], $exception_arr1) === false) { |
|
75 | 75 | return $m[0]; |
76 | 76 | } |
77 | 77 | } |
78 | - if (strpos_arr($m[2],$exception_arr2)!==false) { |
|
78 | + if (strpos_arr($m[2], $exception_arr2) !== false) { |
|
79 | 79 | return $m[0]; |
80 | 80 | } |
81 | 81 | |
82 | - return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
82 | + return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /* a helper function */ |
86 | 86 | function strpos_arr($haystack, $needle) { |
87 | - if(!is_array($needle)) $needle = array($needle); |
|
88 | - foreach($needle as $what) { |
|
89 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
87 | + if (!is_array($needle)) $needle = array($needle); |
|
88 | + foreach ($needle as $what) { |
|
89 | + if (($pos = strpos($haystack, $what)) !== false) return $pos; |
|
90 | 90 | } |
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -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 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action('wp_footer', array($this, 'draw_tour')); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | - $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
|
26 | + $tour_hidden = get_user_meta(get_current_user_ID(), 'lasso_hide_tour', true); |
|
27 | 27 | |
28 | - if ( lasso_user_can() && !$tour_hidden ) { |
|
28 | + if (lasso_user_can() && !$tour_hidden) { |
|
29 | 29 | |
30 | 30 | global $post; |
31 | 31 | |
32 | - $nonce = wp_create_nonce( 'lasso-editor-tour' ); |
|
32 | + $nonce = wp_create_nonce('lasso-editor-tour'); |
|
33 | 33 | |
34 | 34 | // let users add custom css classes |
35 | - $custom_classes = apply_filters( 'lasso_modal_tour_classes', '' ); |
|
35 | + $custom_classes = apply_filters('lasso_modal_tour_classes', ''); |
|
36 | 36 | |
37 | 37 | ?> |
38 | - <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class( $custom_classes );?>"> |
|
38 | + <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class($custom_classes); ?>"> |
|
39 | 39 | <script> |
40 | 40 | (function( $ ) { |
41 | 41 | $(document).ready(function(){ |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | </script> |
57 | 57 | <div class="lasso--modal__inner"> |
58 | 58 | |
59 | - <?php echo self::tour_slides();?> |
|
59 | + <?php echo self::tour_slides(); ?> |
|
60 | 60 | |
61 | 61 | <div class="lasso--postsettings__footer"> |
62 | 62 | |
63 | 63 | <div class="lasso--postsettings__option"> |
64 | 64 | <label for="hide_tour" class="checkbox-control checkbox"> |
65 | - <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked( $tour_hidden, 1 ); ?>> |
|
65 | + <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked($tour_hidden, 1); ?>> |
|
66 | 66 | <span class="control-indicator"></span> |
67 | - <?php _e('Don\'t show this again','lasso');?> |
|
67 | + <?php _e('Don\'t show this again', 'lasso'); ?> |
|
68 | 68 | </label> |
69 | 69 | </div> |
70 | 70 | |
71 | - <input id ="editus_tour_submit" type="submit" value="<?php _e( 'Okay, got it!', 'lasso' );?>" data-nonce="<?php echo $nonce;?>" > |
|
71 | + <input id ="editus_tour_submit" type="submit" value="<?php _e('Okay, got it!', 'lasso'); ?>" data-nonce="<?php echo $nonce; ?>" > |
|
72 | 72 | </div> |
73 | 73 | |
74 | 74 | </div> |
@@ -92,20 +92,20 @@ discard block |
||
92 | 92 | <?php |
93 | 93 | |
94 | 94 | $out = '<ul><li>'; |
95 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg' ); |
|
96 | - $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.','lasso').'</p>'; |
|
95 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg'); |
|
96 | + $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.', 'lasso').'</p>'; |
|
97 | 97 | $out .= '</li><li>'; |
98 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg' ); |
|
99 | - $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.','lasso').'</p>'; |
|
98 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg'); |
|
99 | + $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.', 'lasso').'</p>'; |
|
100 | 100 | $out .= '</li><li>'; |
101 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg' ); |
|
102 | - $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.','lasso').'</p>'; |
|
101 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg'); |
|
102 | + $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.', 'lasso').'</p>'; |
|
103 | 103 | $out .= '</li><li>'; |
104 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg' ); |
|
105 | - $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.','lasso').'</p>'; |
|
104 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg'); |
|
105 | + $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.', 'lasso').'</p>'; |
|
106 | 106 | $out .= '</li></ul>'; |
107 | 107 | |
108 | - echo apply_filters( 'lasso_tour_slides', $out ); |
|
108 | + echo apply_filters('lasso_tour_slides', $out); |
|
109 | 109 | |
110 | 110 | ?></div><?php |
111 | 111 |
@@ -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 |
@@ -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 | } |
@@ -12,22 +12,22 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - if ( isset( $options[$option] ) ) { |
|
30 | + if (isset($options[$option])) { |
|
31 | 31 | return $options[$option]; |
32 | 32 | } |
33 | 33 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function lasso_editor_galleries_exist() { |
44 | 44 | |
45 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
45 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
46 | 46 | |
47 | - if ( $q->have_posts() ) |
|
47 | + if ($q->have_posts()) |
|
48 | 48 | return true; |
49 | 49 | else |
50 | 50 | return false; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | function lasso_get_supported_theme_class() { |
60 | 60 | |
61 | 61 | $name = wp_get_theme()->get('Name'); |
62 | - $slug = lasso_clean_string( $name ); |
|
62 | + $slug = lasso_clean_string($name); |
|
63 | 63 | |
64 | - switch ( $slug ) { |
|
64 | + switch ($slug) { |
|
65 | 65 | case 'aesop-story-theme': // aesop |
66 | 66 | $out = '.aesop-entry-content'; |
67 | 67 | break; |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | |
111 | 111 | } |
112 | 112 | |
113 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
113 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
114 | 114 | //return !empty( $out ) ? $out : false; |
115 | 115 | } |
116 | 116 | |
117 | 117 | function lasso_get_supported_theme_title_class() { |
118 | 118 | |
119 | 119 | $name = wp_get_theme()->get('Name'); |
120 | - $slug = lasso_clean_string( $name ); |
|
120 | + $slug = lasso_clean_string($name); |
|
121 | 121 | |
122 | - switch ( $slug ) { |
|
122 | + switch ($slug) { |
|
123 | 123 | |
124 | 124 | case 'aesop-story-theme': // aesop |
125 | 125 | $out = '.aesop-entry-title'; |
@@ -147,16 +147,16 @@ discard block |
||
147 | 147 | break; |
148 | 148 | } |
149 | 149 | |
150 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
150 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | //since 0.9.9.6 |
154 | 154 | function lasso_get_supported_theme_featured_image_class() { |
155 | 155 | |
156 | 156 | $name = wp_get_theme()->get('Name'); |
157 | - $slug = lasso_clean_string( $name ); |
|
157 | + $slug = lasso_clean_string($name); |
|
158 | 158 | |
159 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
159 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @since 0.8.7 |
168 | 168 | * @return string of comma separated classes |
169 | 169 | */ |
170 | -function lasso_supported_no_save(){ |
|
170 | +function lasso_supported_no_save() { |
|
171 | 171 | |
172 | 172 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel'); |
173 | 173 | } |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @return array|mixed|object|string|void |
183 | 183 | */ |
184 | -function lasso_sanitize_data( $data ) { |
|
185 | - return \lasso\sanatize::do_sanitize( $data ); |
|
184 | +function lasso_sanitize_data($data) { |
|
185 | + return \lasso\sanatize::do_sanitize($data); |
|
186 | 186 | |
187 | 187 | } |
188 | 188 | |
@@ -192,18 +192,18 @@ discard block |
||
192 | 192 | * @since 0.9.3 |
193 | 193 | * @return string of comma delimited category slugs |
194 | 194 | */ |
195 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
195 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
196 | 196 | |
197 | - if ( empty( $postid ) ) |
|
197 | + if (empty($postid)) |
|
198 | 198 | $postid = get_the_ID(); |
199 | 199 | |
200 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
200 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
201 | 201 | |
202 | - if ( empty( $objects) ) |
|
202 | + if (empty($objects)) |
|
203 | 203 | return; |
204 | 204 | |
205 | 205 | $out = ''; |
206 | - foreach( $objects as $object ) { |
|
206 | + foreach ($objects as $object) { |
|
207 | 207 | //$out .= $object->slug.', '; |
208 | 208 | $out .= $object->name.','; |
209 | 209 | } |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | * @since 0.9.3 |
219 | 219 | * @return array all categoiries |
220 | 220 | */ |
221 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
221 | +function lasso_get_objects($taxonomy = 'category') { |
|
222 | 222 | |
223 | 223 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 224 | |
225 | - if ( empty( $objects) ) |
|
225 | + if (empty($objects)) |
|
226 | 226 | return; |
227 | 227 | |
228 | 228 | $out = ""; |
229 | - foreach( $objects as $object ) { |
|
229 | + foreach ($objects as $object) { |
|
230 | 230 | $out .= $object->name.','; |
231 | 231 | } |
232 | 232 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | * @since 0.9.4 |
242 | 242 | */ |
243 | 243 | function lasso_post_types_names() { |
244 | - $post_types = get_post_types( array( |
|
244 | + $post_types = get_post_types(array( |
|
245 | 245 | 'public' => true, |
246 | - ), 'objects' ); |
|
247 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
248 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + ), 'objects'); |
|
247 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
248 | + unset($post_types['attachment']); |
|
249 | 249 | |
250 | 250 | /** |
251 | 251 | * Set which post types are allowed |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
256 | 256 | */ |
257 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
258 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
257 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
258 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
259 | 259 | if (!current_user_can('edit_pages')) { |
260 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
260 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
261 | 261 | } |
262 | - foreach( $post_types as $name => $label ) { |
|
263 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
264 | - unset( $post_types[ $name ] ); |
|
262 | + foreach ($post_types as $name => $label) { |
|
263 | + if (!in_array($name, $allowed_post_types)) { |
|
264 | + unset($post_types[$name]); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | return $post_types; |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | |
270 | 270 | |
271 | 271 | function lasso_post_types() { |
272 | - $post_types = get_post_types( array( |
|
272 | + $post_types = get_post_types(array( |
|
273 | 273 | 'public' => true, |
274 | - ), 'names' ); |
|
275 | - unset( $post_types[ 'attachment' ] ); |
|
274 | + ), 'names'); |
|
275 | + unset($post_types['attachment']); |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Set which post types are allowed |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
283 | 283 | */ |
284 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
285 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
286 | - foreach( $post_types as $name => $label ) { |
|
287 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
288 | - unset( $post_types[ $name ] ); |
|
284 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
285 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
286 | + foreach ($post_types as $name => $label) { |
|
287 | + if (!in_array($name, $allowed_post_types)) { |
|
288 | + unset($post_types[$name]); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | return $post_types; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | global $wp_post_types; |
296 | 296 | $post_types = lasso_post_types(); |
297 | 297 | $rest_base = array(); |
298 | - foreach ( $post_types as $post_type) { |
|
298 | + foreach ($post_types as $post_type) { |
|
299 | 299 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
300 | 300 | } |
301 | 301 | |
@@ -313,22 +313,22 @@ discard block |
||
313 | 313 | * @uses lasso_modal_addons() |
314 | 314 | * @since 0.9.4 |
315 | 315 | */ |
316 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
316 | +function lasso_modal_addons_content($tab = '', $type) { |
|
317 | 317 | |
318 | - $name = lasso_clean_string( $tab['name'] ); |
|
318 | + $name = lasso_clean_string($tab['name']); |
|
319 | 319 | |
320 | - if ( 'tab' == $type ) { |
|
320 | + if ('tab' == $type) { |
|
321 | 321 | |
322 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
322 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
323 | 323 | |
324 | - } else if ( 'content' == $type ){ |
|
324 | + } else if ('content' == $type) { |
|
325 | 325 | |
326 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
327 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
326 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
327 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
328 | 328 | |
329 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
329 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
330 | 330 | %s%s |
331 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
331 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
332 | 332 | |
333 | 333 | } |
334 | 334 | |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | * |
344 | 344 | * @return void|string |
345 | 345 | */ |
346 | -function lasso_clean_string( $string = '' ) { |
|
346 | +function lasso_clean_string($string = '') { |
|
347 | 347 | |
348 | - if ( empty( $string ) ) |
|
348 | + if (empty($string)) |
|
349 | 349 | return; |
350 | 350 | |
351 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
351 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | * |
362 | 362 | * @return void|string |
363 | 363 | */ |
364 | -function lasso_unclean_string( $string = '' ) { |
|
364 | +function lasso_unclean_string($string = '') { |
|
365 | 365 | |
366 | - if ( empty( $string ) ) { |
|
366 | + if (empty($string)) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
370 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
370 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -382,40 +382,40 @@ discard block |
||
382 | 382 | * @param unknown $postid int the id of the post object to check against |
383 | 383 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
384 | 384 | */ |
385 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
386 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
385 | +if (!function_exists('lasso_user_can')): |
|
386 | + function lasso_user_can($action = '', $postid = 0) { |
|
387 | 387 | $result = false; |
388 | - if ( empty( $action ) ) |
|
388 | + if (empty($action)) |
|
389 | 389 | $action = 'edit_posts'; |
390 | 390 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
391 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | 392 | $postid = get_the_ID(); |
393 | 393 | |
394 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
394 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
395 | 395 | // check against post types: |
396 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
396 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
397 | 397 | |
398 | 398 | if (!current_user_can('edit_pages')) { |
399 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
399 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | if (!empty($allowed_post_types) && !empty($postid)) { |
403 | - $type = get_post_type( $postid ); |
|
404 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | + $type = get_post_type($postid); |
|
404 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
405 | 405 | |
406 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
407 | - $result = true; |
|
406 | + if (in_array($type, $allowed_post_types)) { |
|
407 | + $result = true; |
|
408 | 408 | } |
409 | 409 | } else { |
410 | 410 | //we are not checking against a post, return true |
411 | - $result = true; |
|
411 | + $result = true; |
|
412 | 412 | } |
413 | 413 | } else { |
414 | 414 | $result = false; |
415 | 415 | } |
416 | 416 | //if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false; |
417 | 417 | |
418 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
418 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
419 | 419 | } |
420 | 420 | endif; |
421 | 421 | |
@@ -424,25 +424,25 @@ discard block |
||
424 | 424 | * |
425 | 425 | * @since 0.9.5 |
426 | 426 | */ |
427 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
427 | +if (!function_exists('lasso_editor_empty_results')): |
|
428 | 428 | |
429 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
429 | + function lasso_editor_empty_results($type = 'posts') { |
|
430 | 430 | |
431 | - if ( 'posts' == $type ) { |
|
431 | + if ('posts' == $type) { |
|
432 | 432 | |
433 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
433 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
434 | 434 | $icon = 'lasso-icon-file-text2'; |
435 | 435 | $button = false; |
436 | 436 | |
437 | - } elseif ( 'revision' == $type ) { |
|
437 | + } elseif ('revision' == $type) { |
|
438 | 438 | |
439 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
439 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
440 | 440 | $icon = 'lasso-icon-history'; |
441 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
441 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
442 | 442 | |
443 | 443 | } |
444 | 444 | |
445 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
445 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | endif; |
@@ -10,30 +10,30 @@ discard block |
||
10 | 10 | |
11 | 11 | function __construct() { |
12 | 12 | |
13 | - add_action( 'admin_init', array( $this, 'redirect' ) ); |
|
14 | - add_action( 'admin_menu', array( $this, 'lasso_welcome' ) ); |
|
15 | - add_action( 'network_admin_menu', array( $this, 'lasso_welcome' ) ); // CHANGED Added hook. |
|
13 | + add_action('admin_init', array($this, 'redirect')); |
|
14 | + add_action('admin_menu', array($this, 'lasso_welcome')); |
|
15 | + add_action('network_admin_menu', array($this, 'lasso_welcome')); // CHANGED Added hook. |
|
16 | 16 | |
17 | - add_action( 'tgmpa_register', array( $this,'required_plugins' )); |
|
17 | + add_action('tgmpa_register', array($this, 'required_plugins')); |
|
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | 21 | function redirect() { |
22 | 22 | |
23 | 23 | // Bail if no activation redirect |
24 | - if ( !get_transient( '_lasso_welcome_redirect' ) ) { |
|
24 | + if (!get_transient('_lasso_welcome_redirect')) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Delete the redirect transient |
29 | - delete_transient( '_lasso_welcome_redirect' ); |
|
29 | + delete_transient('_lasso_welcome_redirect'); |
|
30 | 30 | |
31 | 31 | // Bail if activating from network, or bulk |
32 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
32 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) ); |
|
36 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php')))); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | function lasso_welcome() { |
46 | 46 | |
47 | 47 | // CHANGED Removed condition. |
48 | - add_menu_page( __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png' ); |
|
49 | - add_submenu_page( 'lasso-editor', __( 'Welcome', 'lasso' ), __( 'Status', 'lasso' ), 'manage_options', 'lasso-editor', array( $this, 'welcome' ) ); |
|
48 | + add_menu_page(__('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png'); |
|
49 | + add_submenu_page('lasso-editor', __('Welcome', 'lasso'), __('Status', 'lasso'), 'manage_options', 'lasso-editor', array($this, 'welcome')); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | ?> |
61 | 61 | <div class="wrap lasso--welcome"> |
62 | 62 | |
63 | - <?php self::header();?> |
|
63 | + <?php self::header(); ?> |
|
64 | 64 | |
65 | 65 | <ul class="lasso--welcome__steps"> |
66 | 66 | |
67 | 67 | <?php // CHANGED Added the is_network_admin condition. ?> |
68 | - <?php if ( is_network_admin() ) : ?> |
|
68 | + <?php if (is_network_admin()) : ?> |
|
69 | 69 | |
70 | 70 | <li> |
71 | - <p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p> |
|
71 | + <p><?php _e('We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso'); ?></p> |
|
72 | 72 | </li> |
73 | 73 | |
74 | 74 | <?php else : |
75 | 75 | |
76 | 76 | $checks = self::lasso_preflight_check(); |
77 | 77 | |
78 | - if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
|
78 | + if ($checks && !defined('LASSO_AGENCY_MODE')): |
|
79 | 79 | |
80 | - foreach ( (array) $checks as $key => $check ) { |
|
80 | + foreach ((array) $checks as $key => $check) { |
|
81 | 81 | |
82 | 82 | echo $check; |
83 | 83 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | // pre-flight is go for flight |
88 | 88 | ?> |
89 | 89 | <li class="success"> |
90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
91 | - <?php if ( lasso_get_supported_theme_class() ) { ?> |
|
92 | - <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
|
90 | + <h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3> |
|
91 | + <?php if (lasso_get_supported_theme_class()) { ?> |
|
92 | + <p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p> |
|
93 | 93 | <?php } ?> |
94 | - <p><?php _e( 'Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso' );?></p> |
|
94 | + <p><?php _e('Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso'); ?></p> |
|
95 | 95 | </li> |
96 | 96 | <?php |
97 | 97 | endif; |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | |
114 | 114 | <div class="lasso--welcome__top"> |
115 | 115 | |
116 | - <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>"> |
|
117 | - <h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1> |
|
118 | - <p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p> |
|
116 | + <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>"> |
|
117 | + <h1><?php _e('Welcome to Editus', 'lasso'); ?></h1> |
|
118 | + <p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p> |
|
119 | 119 | |
120 | - <?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?> |
|
120 | + <?php if (!defined('LASSO_AGENCY_MODE')): ?> |
|
121 | 121 | |
122 | 122 | <ul class="lasso--welcome__social"> |
123 | - <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li> |
|
124 | - <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li> |
|
125 | - <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li> |
|
123 | + <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li> |
|
124 | + <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li> |
|
125 | + <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li> |
|
126 | 126 | </ul> |
127 | 127 | |
128 | 128 | <?php endif; ?> |
@@ -139,68 +139,68 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function lasso_preflight_check() { |
141 | 141 | |
142 | - $notices = array(); |
|
142 | + $notices = array(); |
|
143 | 143 | |
144 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
144 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
145 | 145 | |
146 | - $theme_name = wp_get_theme()->get('Name'); |
|
147 | - $theme_class = lasso_get_supported_theme_class(); |
|
146 | + $theme_name = wp_get_theme()->get('Name'); |
|
147 | + $theme_class = lasso_get_supported_theme_class(); |
|
148 | 148 | |
149 | - $license = get_option( 'lasso_license_key' ); |
|
150 | - $status = get_option( 'lasso_license_status' ); |
|
149 | + $license = get_option('lasso_license_key'); |
|
150 | + $status = get_option('lasso_license_status'); |
|
151 | 151 | |
152 | 152 | // Gutenberg Not Supported |
153 | - if( function_exists( 'is_gutenberg_page' )) { |
|
153 | + if (function_exists('is_gutenberg_page')) { |
|
154 | 154 | $notices[] = '<li class="info"><h3>Gutenberg Not Supported.</h3> |
155 | - <p>'.__( 'Currently Editus does not support Gutenberg. It will be disabled on Gutenberg enabled posts.', 'lasso' ).'</p> |
|
155 | + <p>'.__('Currently Editus does not support Gutenberg. It will be disabled on Gutenberg enabled posts.', 'lasso').'</p> |
|
156 | 156 | </li>'; |
157 | 157 | } |
158 | 158 | |
159 | 159 | // if the required CSS class has not been saved and we're not a supported theme |
160 | - if ( empty( $article_object ) && false == $theme_class ) { |
|
160 | + if (empty($article_object) && false == $theme_class) { |
|
161 | 161 | |
162 | 162 | // we dont automatically support this theme so show them otherwise |
163 | 163 | $notices[] = sprintf('<li class="error"> |
164 | - <h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3> |
|
165 | - <p>'.__( 'Before using Editus,', 'lasso' ).' <a href="%s">'.__( 'enter and save', 'lasso' ).'</a> '.__( 'the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso' ).' <a href="mailto:[email protected]">'.__( 'email us.', 'lasso' ).'</a> '.__( 'with a link to a public URL with the theme and we\'ll find it for you.', 'lasso' ).'</p> |
|
166 | - </li>', admin_url( 'admin.php?page=lasso-editor-settings' ) ); |
|
164 | + <h3>'.__('Article CSS Class Needed!', 'lasso').'</h3> |
|
165 | + <p>'.__('Before using Editus,', 'lasso').' <a href="%s">'.__('enter and save', 'lasso').'</a> '.__('the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso').' <a href="mailto:[email protected]">'.__('email us.', 'lasso').'</a> '.__('with a link to a public URL with the theme and we\'ll find it for you.', 'lasso').'</p> |
|
166 | + </li>', admin_url('admin.php?page=lasso-editor-settings')); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | // WP REST API not active |
170 | - if ( !function_exists( 'json_get_url_prefix' ) && !function_exists( 'rest_url' )) { |
|
170 | + if (!function_exists('json_get_url_prefix') && !function_exists('rest_url')) { |
|
171 | 171 | $notices[] = '<li class="info"><h3>WP REST API not Activated!</h3> |
172 | - <p>'.__( 'Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso' ).'</p> |
|
172 | + <p>'.__('Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso').'</p> |
|
173 | 173 | </li>'; |
174 | 174 | } |
175 | 175 | |
176 | 176 | // aesop story engine isnt active |
177 | - if ( !class_exists( 'Aesop_Core' ) ) { |
|
178 | - $notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
179 | - <p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank |
|
180 | - ">'.__( 'Aesop Story Engine', 'lasso' ).'</a> '.__( 'isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso' ).'</p> |
|
181 | - </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') ); |
|
177 | + if (!class_exists('Aesop_Core')) { |
|
178 | + $notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
179 | + <p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank |
|
180 | + ">'.__('Aesop Story Engine', 'lasso').'</a> '.__('isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso').'</p> |
|
181 | + </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine')); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | // we dont really get along with wp side comments because of the section ids that get applied dynamically. since we save our html, it'll get saved along with the post as HTML |
185 | - if ( class_exists( 'WP_Side_Comments' ) ) { |
|
186 | - $notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3> |
|
187 | - <p>'.__( 'Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso' ).'</p> |
|
185 | + if (class_exists('WP_Side_Comments')) { |
|
186 | + $notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3> |
|
187 | + <p>'.__('Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso').'</p> |
|
188 | 188 | </li>'; |
189 | 189 | } |
190 | 190 | |
191 | 191 | // if the license key isnt activated |
192 | - if ( empty( $license ) ) { |
|
193 | - $notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3> |
|
194 | - <p>'.__( 'Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso' ).'</p> |
|
192 | + if (empty($license)) { |
|
193 | + $notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3> |
|
194 | + <p>'.__('Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso').'</p> |
|
195 | 195 | </li>'; |
196 | 196 | } |
197 | - if ( !empty( $license ) && 'invalid' == $status ) { |
|
198 | - $notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3> |
|
199 | - <p>'.__( 'The license key that you entered is ', 'lasso' ).'<strong>'.__( 'invalid', 'lasso' ).'</strong>'.__( '. It may have been entered incorreclty, or may have expired.', 'lasso' ).'</p> |
|
197 | + if (!empty($license) && 'invalid' == $status) { |
|
198 | + $notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3> |
|
199 | + <p>'.__('The license key that you entered is ', 'lasso').'<strong>'.__('invalid', 'lasso').'</strong>'.__('. It may have been entered incorreclty, or may have expired.', 'lasso').'</p> |
|
200 | 200 | </li>'; |
201 | 201 | } |
202 | 202 | |
203 | - return apply_filters( 'lasso_preflight_notices', $notices ); |
|
203 | + return apply_filters('lasso_preflight_notices', $notices); |
|
204 | 204 | |
205 | 205 | } |
206 | 206 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $plugins = array( |
215 | 215 | |
216 | 216 | array( |
217 | - 'name' => __('Aesop Story Engine','lasso'), |
|
217 | + 'name' => __('Aesop Story Engine', 'lasso'), |
|
218 | 218 | 'slug' => 'aesop-story-engine', |
219 | 219 | 'required' => false, |
220 | 220 | ), |
@@ -222,38 +222,38 @@ discard block |
||
222 | 222 | ); |
223 | 223 | |
224 | 224 | $config = array( |
225 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
225 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
226 | 226 | 'menu' => 'lasso-install-plugins', // Menu slug. |
227 | - 'has_notices' => true, // Show admin notices or not. |
|
228 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
229 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
230 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
231 | - 'message' => '', // Message to output right before the plugins table. |
|
227 | + 'has_notices' => true, // Show admin notices or not. |
|
228 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
229 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
230 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
231 | + 'message' => '', // Message to output right before the plugins table. |
|
232 | 232 | 'strings' => array( |
233 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
234 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
235 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
236 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
237 | - 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
238 | - 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
239 | - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
240 | - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
241 | - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
242 | - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
243 | - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
244 | - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
245 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
246 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
247 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
248 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
249 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
233 | + 'page_title' => __('Install Required Plugins', 'lasso'), |
|
234 | + 'menu_title' => __('Install Plugins', 'lasso'), |
|
235 | + 'installing' => __('Installing Plugin: %s', 'lasso'), // %s = plugin name. |
|
236 | + 'oops' => __('Something went wrong with the plugin API.', 'lasso'), |
|
237 | + 'notice_can_install_required' => _n_noop('This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
238 | + 'notice_can_install_recommended' => _n_noop('This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
239 | + 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), // %1$s = plugin name(s). |
|
240 | + 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
241 | + 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
242 | + 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), // %1$s = plugin name(s). |
|
243 | + 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.'), // %1$s = plugin name(s). |
|
244 | + 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), // %1$s = plugin name(s). |
|
245 | + 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), |
|
246 | + 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins'), |
|
247 | + 'return' => __('Return to Required Plugins Installer', 'lasso'), |
|
248 | + 'plugin_activated' => __('Plugin activated successfully.', 'lasso'), |
|
249 | + 'complete' => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link. |
|
250 | 250 | 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
251 | 251 | ) |
252 | 252 | ); |
253 | 253 | |
254 | - $plugins = apply_filters( 'lasso_required_plugins', $plugins ); |
|
254 | + $plugins = apply_filters('lasso_required_plugins', $plugins); |
|
255 | 255 | |
256 | - tgmpa( $plugins, $config ); |
|
256 | + tgmpa($plugins, $config); |
|
257 | 257 | |
258 | 258 | } |
259 | 259 | } |