@@ -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 | } |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
63 | 63 | |
64 | 64 | // enable saving custom fields through REST API |
65 | 65 | self::enable_metasave('post'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public static function get_instance() { |
91 | 91 | |
92 | 92 | // If the single instance hasn't been set, set it now. |
93 | - if ( null == self::$instance ) { |
|
93 | + if (null == self::$instance) { |
|
94 | 94 | self::$instance = new self; |
95 | 95 | } |
96 | 96 | |
@@ -107,18 +107,18 @@ discard block |
||
107 | 107 | * WPMU is disabled or plugin is |
108 | 108 | * activated on an individual blog. |
109 | 109 | */ |
110 | - public static function activate( $network_wide ) { |
|
110 | + public static function activate($network_wide) { |
|
111 | 111 | |
112 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
112 | + if (function_exists('is_multisite') && is_multisite()) { |
|
113 | 113 | |
114 | - if ( $network_wide ) { |
|
114 | + if ($network_wide) { |
|
115 | 115 | |
116 | 116 | // Get all blog ids |
117 | 117 | $blog_ids = self::get_blog_ids(); |
118 | 118 | |
119 | - foreach ( $blog_ids as $blog_id ) { |
|
119 | + foreach ($blog_ids as $blog_id) { |
|
120 | 120 | |
121 | - switch_to_blog( $blog_id ); |
|
121 | + switch_to_blog($blog_id); |
|
122 | 122 | self::single_activate(); |
123 | 123 | } |
124 | 124 | |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | * WPMU is disabled or plugin is |
145 | 145 | * deactivated on an individual blog. |
146 | 146 | */ |
147 | - public static function deactivate( $network_wide ) { |
|
147 | + public static function deactivate($network_wide) { |
|
148 | 148 | |
149 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
149 | + if (function_exists('is_multisite') && is_multisite()) { |
|
150 | 150 | |
151 | - if ( $network_wide ) { |
|
151 | + if ($network_wide) { |
|
152 | 152 | |
153 | 153 | // Get all blog ids |
154 | 154 | $blog_ids = self::get_blog_ids(); |
155 | 155 | |
156 | - foreach ( $blog_ids as $blog_id ) { |
|
156 | + foreach ($blog_ids as $blog_id) { |
|
157 | 157 | |
158 | - switch_to_blog( $blog_id ); |
|
158 | + switch_to_blog($blog_id); |
|
159 | 159 | self::single_deactivate(); |
160 | 160 | |
161 | 161 | } |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @param int $blog_id ID of the new blog. |
181 | 181 | */ |
182 | - public function activate_new_site( $blog_id ) { |
|
182 | + public function activate_new_site($blog_id) { |
|
183 | 183 | |
184 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
184 | + if (1 !== did_action('wpmu_new_blog')) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - switch_to_blog( $blog_id ); |
|
188 | + switch_to_blog($blog_id); |
|
189 | 189 | self::single_activate(); |
190 | 190 | restore_current_blog(); |
191 | 191 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | WHERE archived = '0' AND spam = '0' |
211 | 211 | AND deleted = '0'"; |
212 | 212 | |
213 | - return $wpdb->get_col( $sql ); |
|
213 | + return $wpdb->get_col($sql); |
|
214 | 214 | |
215 | 215 | } |
216 | 216 | |
@@ -221,18 +221,18 @@ discard block |
||
221 | 221 | */ |
222 | 222 | private static function single_activate() { |
223 | 223 | |
224 | - $curr_version = get_option( 'lasso_version' ); |
|
224 | + $curr_version = get_option('lasso_version'); |
|
225 | 225 | |
226 | 226 | // update upgraded from |
227 | - if ( $curr_version ) { |
|
228 | - update_option( 'lasso_updated_from', $curr_version ); |
|
227 | + if ($curr_version) { |
|
228 | + update_option('lasso_updated_from', $curr_version); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // update lasso version option |
232 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
232 | + update_option('lasso_version', LASSO_VERSION); |
|
233 | 233 | |
234 | 234 | // set transietn for activation welcome |
235 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
235 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
236 | 236 | |
237 | 237 | |
238 | 238 | } |
@@ -254,15 +254,15 @@ discard block |
||
254 | 254 | public function load_plugin_textdomain() { |
255 | 255 | |
256 | 256 | $domain = $this->plugin_slug; |
257 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
257 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
258 | 258 | |
259 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
259 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | // new ajax function to lock post for editing |
263 | 263 | public function editus_lock_post() |
264 | 264 | { |
265 | - $post_id= $_POST["postid"]; |
|
265 | + $post_id = $_POST["postid"]; |
|
266 | 266 | $locked = wp_check_post_lock($post_id); |
267 | 267 | |
268 | 268 | if (!$locked) { |
@@ -270,18 +270,18 @@ discard block |
||
270 | 270 | echo "true"; |
271 | 271 | } else { |
272 | 272 | $user_info = get_userdata($locked); |
273 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
273 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
274 | 274 | } |
275 | 275 | exit; |
276 | 276 | } |
277 | 277 | |
278 | 278 | public static function enable_metasave($type) |
279 | 279 | { |
280 | - register_rest_field( $type, 'metadata', array( |
|
281 | - 'get_callback' => function ( $data ) { |
|
282 | - return get_post_meta( $data['id']);//, '', '' ); |
|
280 | + register_rest_field($type, 'metadata', array( |
|
281 | + 'get_callback' => function($data) { |
|
282 | + return get_post_meta($data['id']); //, '', '' ); |
|
283 | 283 | }, |
284 | - 'update_callback' => function( $data, $post ) { |
|
284 | + 'update_callback' => function($data, $post) { |
|
285 | 285 | foreach ($data as $key => $value) { |
286 | 286 | update_post_meta($post->ID, $key, $value); |
287 | 287 | } |
@@ -293,10 +293,10 @@ discard block |
||
293 | 293 | public function editus_do_shortcode() |
294 | 294 | { |
295 | 295 | |
296 | - $code= $_POST["code"]; |
|
296 | + $code = $_POST["code"]; |
|
297 | 297 | $code = str_replace('\"', '"', $code); |
298 | - $out = lasso_wrap_shortcodes( $code); |
|
299 | - $out = do_shortcode($out); |
|
298 | + $out = lasso_wrap_shortcodes($code); |
|
299 | + $out = do_shortcode($out); |
|
300 | 300 | echo $out; |
301 | 301 | exit; |
302 | 302 | } |
@@ -305,53 +305,53 @@ discard block |
||
305 | 305 | { |
306 | 306 | |
307 | 307 | |
308 | - $code= $_POST["code"]; |
|
308 | + $code = $_POST["code"]; |
|
309 | 309 | $atts = array( |
310 | 310 | ); |
311 | 311 | foreach ($_POST as $key => $value) { |
312 | - if ($key !="code" && $key !="action") { |
|
312 | + if ($key != "code" && $key != "action") { |
|
313 | 313 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
314 | 314 | $atts[$key] = $value; |
315 | 315 | } |
316 | 316 | } |
317 | 317 | if ($code == "aesop_video") { |
318 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
319 | 319 | echo aesop_video_shortcode($atts); |
320 | 320 | } |
321 | 321 | else if ($code == "aesop_image") { |
322 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
323 | 323 | echo aesop_image_shortcode($atts); |
324 | 324 | } |
325 | 325 | else if ($code == "aesop_quote") { |
326 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
327 | 327 | echo aesop_quote_shortcode($atts); |
328 | 328 | } |
329 | 329 | else if ($code == "aesop_parallax") { |
330 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
331 | 331 | echo aesop_parallax_shortcode($atts); |
332 | 332 | } |
333 | 333 | else if ($code == "aesop_character") { |
334 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
335 | 335 | echo aesop_character_shortcode($atts); |
336 | 336 | } |
337 | 337 | else if ($code == "aesop_collection") { |
338 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
339 | 339 | echo aesop_collection_shortcode($atts); |
340 | 340 | } |
341 | 341 | else if ($code == "aesop_chapter") { |
342 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
343 | 343 | echo aesop_chapter_shortcode($atts); |
344 | 344 | } |
345 | 345 | else if ($code == "aesop_content") { |
346 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
347 | 347 | echo aesop_content_shortcode($atts, $atts['content_data']); |
348 | 348 | } |
349 | 349 | else if ($code == "aesop_gallery") { |
350 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
351 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
350 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
351 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
352 | 352 | } |
353 | 353 | else if ($code == "aesop_audio") { |
354 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
355 | 355 | echo aesop_audio_shortcode($atts); |
356 | 356 | } |
357 | 357 | else { |
@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '0.9.16.0' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '0.9.16.0'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
49 | +function lasso_show_in_rest($args, $post_type) { |
|
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |