forked from Enclavely/tailor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailor.php
949 lines (819 loc) · 24 KB
/
tailor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
<?php
/**
* Plugin Name: Tailor
* Plugin URI: http://www.gettailor.com
* Description: Build beautiful page layouts quickly and easily using your favourite theme.
* Version: 1.5.7
* Author: Andrew Worsfold
* Author URI: http://www.andrewworsfold.com
* Text Domain: tailor
*
* @package Tailor
*/
defined( 'ABSPATH' ) or die();
if ( ! class_exists( 'Tailor' ) ) {
/**
* Tailor class.
*
* @since 1.0.0
*/
class Tailor {
/**
* Tailor instance.
*
* @since 1.0.0
*
* @access private
* @var Tailor
*/
private static $instance;
/**
* The plugin version number.
*
* @since 1.0.0
*
* @access private
* @var string
*/
private static $version;
/**
* The plugin basename.
*
* @since 1.0.0
*
* @access private
* @var string
*/
private static $plugin_basename;
/**
* The plugin name.
*
* @since 1.0.0
*
* @access private
* @var string
*/
private static $plugin_name;
/**
* The plugin directory.
*
* @since 1.0.0
*
* @access private
* @var string
*/
private static $plugin_dir;
/**
* The plugin URL.
*
* @since 1.0.0
*
* @access private
* @var string
*/
private static $plugin_url;
/**
* Returns the Tailor instance.
*
* @since 1.0.0
*
* @return Tailor
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct() {
$this->define_constants();
$this->add_actions();
}
/**
* Defines constants used by the plugin.
*
* @since 1.0.0
*/
protected function define_constants() {
$plugin_data = get_file_data( __FILE__, array( 'Plugin Name', 'Version' ), 'tailor' );
self::$plugin_basename = plugin_basename( __FILE__ );
self::$plugin_name = array_shift( $plugin_data );
self::$version = array_shift( $plugin_data );
self::$plugin_dir = trailingslashit( plugin_dir_path( __FILE__ ) );
self::$plugin_url = trailingslashit( plugin_dir_url( __FILE__ ) );
/**
* Filters the settings ID.
*
* @since 1.0.0
*
* @param string
*/
$setting_id = apply_filters( 'tailor_setting_id', 'tailor_settings' );
define( 'TAILOR_SETTING_ID', $setting_id );
}
/**
* Adds required action hooks.
*
* @since 1.0.0
* @access protected
*/
protected function add_actions() {
register_activation_hook( __FILE__, array( __CLASS__, 'activate' ) );
register_deactivation_hook( __FILE__, array( __CLASS__, 'deactivate' ) );
add_action( 'plugins_loaded', array( $this, 'init' ) );
add_action( 'admin_init', array( $this, 'admin_init' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_styles' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ), 99 );
add_action( 'wp_enqueue_scripts', array( $this, 'register_script_dependencies' ) );
add_action( 'tailor_enqueue_sidebar_scripts', array( $this, 'register_script_dependencies' ) );
add_action( 'wp_ajax_tailor_save', array( $this, 'save' ) );
add_filter( 'heartbeat_received', array( $this, 'lock_post' ), 10, 2 );
add_action( 'wp_ajax_tailor_unlock_post', array( $this, 'unlock_post' ) );
}
/**
* Adds the Tailor class name to the body.
*
* @since 1.0.0
*
* @param array $classes
* @return array $classes
*/
public function body_class( $classes ) {
$classes[] = 'tailor-ui';
return $classes;
}
/**
* Initializes the plugin.
*
* @since 1.0.0
*/
public function init() {
load_plugin_textdomain( 'tailor', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
add_filter( 'body_class', array( $this, 'body_class' ) );
$this->load_directory( 'shortcodes' );
$this->load_directory( 'helpers' );
$this->load_files( array(
'class-compatibility',
'class-custom-css',
'class-custom-js',
'class-icons',
'class-revisions',
'api/class-api',
) );
if ( is_admin() ) {
$this->load_files( array(
'admin/class-admin',
'admin/class-settings',
'admin/helpers/helpers-general',
) );
}
$this->load_directory( 'controls' );
$this->load_files( array(
'abstract-manager',
'class-panels',
'class-models',
'class-elements',
'class-templates',
'class-sidebar',
'class-canvas',
'class-tinymce',
'class-customizer',
) );
/**
* Fires after all files have been loaded.
*
* @since 1.0.0
*
* @param Tailor
*/
do_action( 'tailor_init', $this );
}
/**
* Records the editor styles registered by the theme for use in the front end.
*
* @since 1.0.0
*
* @global $editor_styles
*/
public function admin_init() {
$this->apply_editor_styles();
}
/**
* Applies custom Tailor styles to the editor.
*
* @since 1.4.0
* @access protected
*/
protected function apply_editor_styles() {
global $editor_styles;
if ( isset( $editor_styles ) ) {
update_option( '_tailor_editor_styles', $editor_styles );
}
/**
* Allow developers to prevent Tailor editor styles from being added.
*
* @since 1.4.0
*
* @param bool
*/
if ( apply_filters( 'tailor_enable_editor_styles', true ) ) {
$extension = SCRIPT_DEBUG ? '.css' : '.min.css';
$editor_styles[] = $this->plugin_url() . 'assets/css/frontend' . $extension;
$editor_styles[] = $this->plugin_url() . 'assets/css/tinymce' . $extension;
}
}
/**
* Registers script dependencies.
*
* @since 1.0.0
*/
public function register_script_dependencies() {
wp_register_script(
'modernizr',
$this->plugin_url() . 'assets/js/dist/vendor/modernizr.min.js',
array(),
$this->version(),
true
);
if ( 'registered' != wp_script_is( 'imagesloaded' ) ) {
wp_register_script(
'imagesloaded',
$this->plugin_url() . 'assets/js/dist/vendor/imagesloaded.min.js',
array(),
$this->version(),
true
);
}
wp_register_script(
'sortable',
$this->plugin_url() . 'assets/js/dist/vendor/sortable.min.js',
array(),
$this->version(),
true
);
wp_register_script(
'slick-slider',
$this->plugin_url() . 'assets/js/dist/vendor/slick.min.js',
array( 'jquery' ),
$this->version(),
true
);
wp_register_script(
'shuffle',
$this->plugin_url() . 'assets/js/dist/vendor/shuffle.min.js',
array( 'jquery', 'modernizr', 'imagesloaded' ),
$this->version(),
true
);
wp_register_script(
'magnific-popup',
$this->plugin_url() . 'assets/js/dist/vendor/magnific-popup.min.js',
array( 'jquery' ),
$this->version(),
true
);
wp_register_script(
'backbone-marionette',
$this->plugin_url() . 'assets/js/dist/vendor/backbone.marionette' . ( SCRIPT_DEBUG ? '.js' : '.min.js' ),
array( 'backbone', 'jquery' ),
$this->version(),
true
);
// Google Maps script
$google_maps_api_key = trim( tailor_get_setting( 'google_maps_api_key', '' ) );
if ( ! empty( $google_maps_api_key ) ) {
wp_register_script(
'google-maps-api',
"https://maps.googleapis.com/maps/api/js?key={$google_maps_api_key}",
array()
);
}
}
/**
* Enqueues frontend styles.
*
* @since 1.0.0
*/
public function enqueue_frontend_styles() {
/**
* Allow developers to prevent Tailor frontend styles from being enqueued.
*
* @since 1.4.0
*
* @param bool
*/
if ( is_singular() && apply_filters( 'tailor_enable_frontend_styles', true ) ) {
wp_enqueue_style(
'tailor-styles',
$this->plugin_url() . 'assets/css/frontend' . ( SCRIPT_DEBUG ? '.css' : '.min.css' ),
array(),
$this->version()
);
}
}
/**
* Enqueues frontend scripts.
*
* @since 1.0.0
*/
public function enqueue_frontend_scripts() {
/**
* Allow developers to prevent Tailor frontend scripts from being enqueued.
*
* @since 1.4.0
*
* @param bool
*/
if ( apply_filters( 'tailor_enable_frontend_scripts', true ) ) {
// Enqueue script dependencies
wp_enqueue_script( 'slick-slider' );
wp_enqueue_script( 'shuffle' );
wp_enqueue_script( 'magnific-popup' );
wp_enqueue_script( 'google-maps-api' );
if ( $this->is_canvas() ) {
return;
}
wp_enqueue_script(
'tailor-frontend',
$this->plugin_url() . 'assets/js/dist/frontend' . ( SCRIPT_DEBUG ? '.js' : '.min.js' ),
array( 'jquery', 'underscore', 'imagesloaded' ),
$this->version()
);
}
}
/**
* Locks the post when Tailoring using the Heartbeat API.
*
* @since 1.0.0
*
* @param array $response
* @param array $data
* @return array $response
*/
public function lock_post( $response, $data ) {
if ( isset( $data['tailor_post_id'] ) && $post = get_post( $data['tailor_post_id'] ) ) {
$response['current_lock'] = wp_set_post_lock( $post->ID );
}
return $response;
}
/**
* Unlocks the post when no longer Tailoring.
*
* @since 1.0.0
*/
public function unlock_post() {
check_ajax_referer( 'tailor-unlock-post', 'nonce' );
$post_id = (int) $_POST['post_id'];
if ( ! $post = get_post( $post_id ) ) {
wp_send_json_error();
}
if ( ! current_user_can( 'edit_post', $post->ID ) ) {
wp_send_json_error();
}
if ( ! $lock = get_post_meta( $post->ID, '_edit_lock', true ) ) {
wp_send_json_error();
}
$active_lock = get_post_meta( $post->ID, '_edit_lock', true );
$active_lock = array_map( 'absint', explode( ':', $active_lock ) );
if ( $active_lock[1] != get_current_user_id() ) {
wp_send_json_error();
}
/**
* Filter the post lock window duration.
*
* @since 1.0.0
*
* @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 150.
*/
$new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 150 ) + 5 ) . ':' . $active_lock[1];
$response = update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
wp_send_json_success( $response );
}
/**
* Saves the session data.
*
* @since 1.0.0
*/
public function save() {
check_ajax_referer( 'tailor-save', 'nonce' );
if ( ! $post = get_post( $_POST['post_id'] ) ) {
wp_send_json_error();
}
/**
* Saves the session data.
*
* @since 1.0.0
*
* @param string $post_id
* @param Tailor $this
*/
do_action( 'tailor_save', $post->ID, $this );
/**
* Fires after the session data has been saved.
*
* @since 1.0.0
*
* @param string $post_id
* @param Tailor $this
*/
do_action( 'tailor_save_after', $post->ID, $this );
/**
* Filters the response data for a successful tailor_save AJAX request.
*
* This filter does not apply if there was a nonce or authentication failure.
*
* @since 1.0.0
*
* @param array $data
* @param string $post_id
* @param Tailor $this
*/
$response = apply_filters( 'tailor_save_response', array(), $post->ID, $this );
wp_send_json_success( $response );
}
/**
* Activates the plugin.
*
* @since 1.0.0
* @static
*/
static function activate() {
/**
* Fires when the plugin is activated.
*
* @since 1.0.0
*/
do_action( 'tailor_activated' );
$previous_version = get_option( 'tailor_version', self::$version );
if ( ! $previous_version ) {
update_option( 'tailor_version', self::$version );
}
else {
if ( version_compare( $previous_version, self::$version, '<' ) ) {
/**
* Fires after the plugin has been updated.
*
* @since 1.0.0
*
* @param string $previous_version
*/
do_action( 'tailor_updated', $previous_version );
update_option( 'tailor_previous_version', $previous_version );
}
}
}
/**
* Deactivates the plugin.
*
* @since 1.0.0
* @static
*/
static function deactivate() {
/**
* Fires when the plugin is deactivated.
*
* @since 1.0.0
*/
do_action( 'tailor_deactivated' );
// Remove the stored editor styles
delete_option( '_tailor_editor_styles' );
}
/**
* Returns the version number of the plugin.
*
* @since 1.0.0
*
* @return string
*/
public function version() {
return self::$version;
}
/**
* Returns the plugin basename.
*
* @since 1.0.0
*
* @return string
*/
public function plugin_basename() {
return self::$plugin_basename;
}
/**
* Returns the plugin name.
*
* @since 1.0.0
*
* @return string
*/
public function plugin_name() {
return self::$plugin_name;
}
/**
* Returns the plugin directory.
*
* @since 1.0.0
*
* @return string
*/
public function plugin_dir() {
/**
* Filter the plugin directory.
*
* @since 1.0.0
*
* @param string $plugin_dir
*/
$plugin_dir = apply_filters( 'tailor_plugin_dir', self::$plugin_dir );
return $plugin_dir;
}
/**
* Returns the plugin URL.
*
* @since 1.0.0
*
* @return string
*/
public function plugin_url() {
/**
* Filter the plugin URL.
*
* @since 1.0.0
*
* @param string $plugin_url
*/
$plugin_url = apply_filters( 'tailor_plugin_url', self::$plugin_url );
return $plugin_url;
}
/**
* Returns true if the current user has one of the roles required to use the plugin.
*
* @since 1.0.0
*
* @return bool
*/
public function check_user_role() {
if ( ! is_user_logged_in() ) {
auth_redirect();
}
// Check that the user can manage option and/or edit the post type
$user = wp_get_current_user();
$post_id = get_the_ID();
$post_type_object = get_post_type_object( get_post_type( $post_id ) );
if ( empty( $post_type_object ) ) {
return false;
}
$edit_post = $post_type_object->cap->edit_post;
if ( ! isset( $edit_post ) ) {
return false;
}
$allowable = current_user_can( 'manage_options' ) || current_user_can( $edit_post, $post_id );
// Check that the user doesn't have a restricted role type
$restricted_roles = array_keys( tailor_get_setting( 'restricted_roles', array() ) );
$allowable = $allowable && ( count( array_intersect( $restricted_roles, (array) $user->roles ) ) == 0 );
/**
* Filter the result of the user role check.
*
* @since 1.3.1
*
* @param bool $allowable
*/
return apply_filters( 'tailor_check_user', $allowable );
}
/**
* Returns true if the current post type is supported by the plugin.
*
* @since 1.0.0
*
* @param string $post_id
* @return bool
*/
public function check_post( $post_id = '' ) {
if ( isset( $post_id->ID ) ) {
$post = $post_id;
}
else {
$post = $this->get_post( $post_id );
}
if ( ! $post ) {
return false;
}
if ( 'trash' == get_post_status( $post_id ) ) {
return false;
}
$allowable = true;
// Check if the post is configured to be the page for posts
if ( $post->ID == get_option( 'page_for_posts' ) ) {
$allowable = false;
}
// Check if the post is of an allowable type
$allowable_post_types = tailor_get_setting( 'post_types', array() );
if ( ! array_key_exists( $post->post_type, $allowable_post_types ) ) {
$allowable = false;
}
// Check if the post is locked
if ( $this->check_post_lock( $post->ID ) ) {
$allowable = false;
}
/**
* Filter the result of the post check.
*
* @since 1.3.0
*
* @param $allowable
* @param $post
*/
$allowable = apply_filters( 'tailor_check_post', $allowable, $post );
return $allowable;
}
/**
* Check to see if the post is currently being edited by another user.
*
* @since 1.0.0
*
* @param int $post_id ID of the post to check for editing
* @return integer False: not locked or locked by current user. Int: user ID of user with lock.
*/
public function check_post_lock( $post_id ) {
if ( ! $post = get_post( $post_id ) ) {
return false;
}
if ( ! $lock = get_post_meta( $post->ID, '_edit_lock', true ) ) {
return false;
}
$lock = explode( ':', $lock );
$time = $lock[0];
$user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
$time_window = apply_filters( 'wp_check_post_lock_window', 150 );
if ( $time && $time > time() - $time_window && $user != get_current_user_id() ) {
return $user;
}
return false;
}
/**
* Returns the current post object, where possible.
*
* @since 1.0.0
* @access protected
*
* @param string $post_id
* @return array|bool|null|WP_Post
*/
protected function get_post( $post_id = '' ) {
if ( is_int( $post_id ) ) {
return get_post( $post_id );
}
if ( is_admin() && isset( $_GET['post'] ) ) {
return get_post( $_GET['post'] );
}
$post = get_queried_object();
if ( is_a( $post, 'WP_POST' ) ) {
return $post;
}
return false;
}
/**
* Returns the frontend edit URL.
*
* @since 1.0.0
*
* @param string $post_id
* @return array
*/
public function get_edit_url( $post_id ) {
$query_args = array( 'tailor' => 1 );
/**
* Filters the edit URL query arguments.
*
* @since 1.0.0
*
* @param array $query_args
*/
$query_args = apply_filters( 'tailor_edit_url_query_args', $query_args );
return add_query_arg( $query_args, get_permalink( $post_id ) );
}
/**
* Returns the frontend edit link.
*
* @since 1.0.0
*
* @param string $post_id
* @param string $post_type
* @return string
*/
public function get_edit_link( $post_id = '', $post_type = '' ) {
$edit_label = sprintf( __( 'Tailor this %s', 'tailor' ), ucfirst( $post_type ) );
return '<a href="' . $this->get_edit_url( $post_id ) . '">' . $edit_label . '</a>';
}
/**
* Returns true if this is a Tailor page load.
*
* @since 1.0.0
*
* @return bool
*/
public function is_tailoring() {
if ( $this->doing_AJAX() ) {
return ( isset( $_POST['tailor'] ) && 1 == $_POST['tailor'] );
}
return ( isset( $_GET['tailor'] ) && 1 == $_GET['tailor'] );
}
/**
* Returns true if the given post has a Tailor layout.
*
* @since 1.5.7
*
* @param int|null $post_id
* @return bool
*/
public function is_tailored( $post_id = null ) {
$post = get_post( $post_id );
return $post && false != get_post_meta( $post->ID, '_tailor_layout', true );
}
/**
* Returns true if this is a Tailor Canvas page load.
*
* @since 1.0.0
*
* @return bool
*/
public function is_canvas() {
if ( $this->doing_AJAX() ) {
return ( isset( $_POST['canvas'] ) && 1 == $_POST['canvas'] );
}
return ( isset( $_GET['canvas'] ) && 1 == $_GET['canvas'] );
}
/**
* Returns true if this is a template preview.
*
* @since 1.0.0
*
* @return bool
*/
public function is_template_preview() {
if ( $this->doing_AJAX() ) {
return ( isset( $_POST['template_preview'] ) && 1 == $_POST['template_preview'] );
}
return ( isset( $_GET['template_preview'] ) && 1 == $_GET['template_preview'] );
}
/**
* Returns true if this is an AJAX request.
*
* @since 1.0.0
* @access protected
*/
protected function doing_AJAX() {
return defined( 'DOING_AJAX' ) && DOING_AJAX;
}
/**
* Loads all PHP files in a given directory.
*
* @since 1.0.0
*
* @param string $directory_name
*/
public function load_directory( $directory_name ) {
$path = trailingslashit( $this->plugin_dir() . 'includes/' . $directory_name );
$file_names = glob( $path . '*.php' );
foreach ( $file_names as $filename ) {
if ( file_exists( $filename ) ) {
require_once $filename;
}
}
}
/**
* Loads specified PHP files from the plugin includes directory.
*
* @since 1.0.0
*
* @param array $file_names The names of the files to be loaded in the includes directory.
*/
public function load_files( $file_names = array() ) {
foreach ( $file_names as $file_name ) {
if ( file_exists( $path = $this->plugin_dir() . 'includes/' . $file_name . '.php' ) ) {
require_once $path;
}
}
}
}
}
/**
* Returns the Tailor application instance.
*
* @since 1.0.0
*
* @return Tailor
*/
function tailor() {
return Tailor::get_instance();
}
/**
* Initializes the Tailor application.
*
* @since 1.0.0
*/
tailor();