@@ -13,19 +13,19 @@ |
||
13 | 13 | 'class' => 'LSX_Activities', |
14 | 14 | 'menu_icon' => 'dashicons-universal-access', |
15 | 15 | 'labels' => array( |
16 | - 'name' => esc_html__( 'Activities', 'lsx-activities' ), |
|
17 | - 'singular_name' => esc_html__( 'Activity', 'lsx-activities' ), |
|
18 | - 'add_new' => esc_html__( 'Add New', 'lsx-activities' ), |
|
19 | - 'add_new_item' => esc_html__( 'Add New Activity', 'lsx-activities' ), |
|
20 | - 'edit_item' => esc_html__( 'Edit Activity', 'lsx-activities' ), |
|
21 | - 'new_item' => esc_html__( 'New Activities', 'lsx-activities' ), |
|
22 | - 'all_items' => esc_html__( 'Activities', 'lsx-activities' ), |
|
23 | - 'view_item' => esc_html__( 'View Activity', 'lsx-activities' ), |
|
24 | - 'search_items' => esc_html__( 'Search Activities', 'lsx-activities' ), |
|
25 | - 'not_found' => esc_html__( 'No activities found', 'lsx-activities' ), |
|
26 | - 'not_found_in_trash' => esc_html__( 'No activities found in Trash', 'lsx-activities' ), |
|
16 | + 'name' => esc_html__('Activities', 'lsx-activities'), |
|
17 | + 'singular_name' => esc_html__('Activity', 'lsx-activities'), |
|
18 | + 'add_new' => esc_html__('Add New', 'lsx-activities'), |
|
19 | + 'add_new_item' => esc_html__('Add New Activity', 'lsx-activities'), |
|
20 | + 'edit_item' => esc_html__('Edit Activity', 'lsx-activities'), |
|
21 | + 'new_item' => esc_html__('New Activities', 'lsx-activities'), |
|
22 | + 'all_items' => esc_html__('Activities', 'lsx-activities'), |
|
23 | + 'view_item' => esc_html__('View Activity', 'lsx-activities'), |
|
24 | + 'search_items' => esc_html__('Search Activities', 'lsx-activities'), |
|
25 | + 'not_found' => esc_html__('No activities found', 'lsx-activities'), |
|
26 | + 'not_found_in_trash' => esc_html__('No activities found in Trash', 'lsx-activities'), |
|
27 | 27 | 'parent_item_colon' => '', |
28 | - 'menu_name' => esc_html__( 'Activities', 'lsx-activities' ), |
|
28 | + 'menu_name' => esc_html__('Activities', 'lsx-activities'), |
|
29 | 29 | ), |
30 | 30 | 'public' => true, |
31 | 31 | 'publicly_queryable' => true, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @subpackage template-tags |
14 | 14 | * @category activity |
15 | 15 | */ |
16 | -if ( ! function_exists( 'lsx_to_activity_posts' ) ) { |
|
16 | +if ( ! function_exists('lsx_to_activity_posts')) { |
|
17 | 17 | function lsx_to_activity_posts() { |
18 | 18 | global $lsx_to_archive; |
19 | 19 | |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | 'from' => 'post', |
22 | 22 | 'to' => 'activity', |
23 | 23 | 'column' => '3', |
24 | - 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__( 'Featured Posts', 'lsx-activities' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', |
|
24 | + 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__('Featured Posts', 'lsx-activities') . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', |
|
25 | 25 | 'after' => '</div></div></section>', |
26 | 26 | ); |
27 | 27 | |
28 | - lsx_to_connected_panel_query( $args ); |
|
28 | + lsx_to_connected_panel_query($args); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @subpackage template-tag |
37 | 37 | * @category content |
38 | 38 | */ |
39 | -function lsx_to_activity_content( $slug, $name = null ) { |
|
40 | - do_action( 'lsx_to_activity_content', $slug, $name ); |
|
39 | +function lsx_to_activity_content($slug, $name = null) { |
|
40 | + do_action('lsx_to_activity_content', $slug, $name); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -47,21 +47,21 @@ discard block |
||
47 | 47 | * @subpackage template-tags |
48 | 48 | * @category activity |
49 | 49 | */ |
50 | -if ( ! function_exists( 'lsx_to_activity_tours' ) ) { |
|
50 | +if ( ! function_exists('lsx_to_activity_tours')) { |
|
51 | 51 | function lsx_to_activity_tours() { |
52 | 52 | global $wp_query; |
53 | 53 | |
54 | - if ( post_type_exists( 'tour' ) && is_singular( 'activity' ) ) { |
|
54 | + if (post_type_exists('tour') && is_singular('activity')) { |
|
55 | 55 | $args = array( |
56 | 56 | 'from' => 'tour', |
57 | 57 | 'to' => 'activity', |
58 | 58 | 'content_part' => 'tour', |
59 | 59 | 'column' => '3', |
60 | - 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'lsx-activities' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', |
|
60 | + 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __(lsx_to_get_post_type_section_title('tour', '', 'Featured Tours'), 'lsx-activities') . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', |
|
61 | 61 | 'after' => '</div></div></section>', |
62 | 62 | ); |
63 | 63 | |
64 | - lsx_to_connected_panel_query( $args ); |
|
64 | + lsx_to_connected_panel_query($args); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | * @subpackage template-tags |
73 | 73 | * @category activity |
74 | 74 | */ |
75 | -if ( ! function_exists( 'lsx_to_activity_accommodation' ) ) { |
|
75 | +if ( ! function_exists('lsx_to_activity_accommodation')) { |
|
76 | 76 | function lsx_to_activity_accommodation() { |
77 | 77 | global $wp_query; |
78 | 78 | |
79 | - if ( post_type_exists( 'accommodation' ) && is_singular( 'activity' ) ) { |
|
79 | + if (post_type_exists('accommodation') && is_singular('activity')) { |
|
80 | 80 | $args = array( |
81 | 81 | 'from' => 'accommodation', |
82 | 82 | 'to' => 'activity', |
83 | 83 | 'content_part' => 'accommodation', |
84 | 84 | 'column' => '3', |
85 | - 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'lsx-activities' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', |
|
85 | + 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __(lsx_to_get_post_type_section_title('accommodation', '', 'Featured Accommodations'), 'lsx-activities') . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', |
|
86 | 86 | 'after' => '</div></div></section>', |
87 | 87 | ); |
88 | 88 | |
89 | - lsx_to_connected_panel_query( $args ); |
|
89 | + lsx_to_connected_panel_query($args); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -103,6 +103,6 @@ discard block |
||
103 | 103 | * @subpackage template-tags |
104 | 104 | * @category connections |
105 | 105 | */ |
106 | -function lsx_to_connected_activities( $before = '', $after = '', $echo = true ) { |
|
107 | - lsx_to_connected_items_query( 'activity', get_post_type(), $before, $after, $echo ); |
|
106 | +function lsx_to_connected_activities($before = '', $after = '', $echo = true) { |
|
107 | + lsx_to_connected_items_query('activity', get_post_type(), $before, $after, $echo); |
|
108 | 108 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <div class="uix-field-wrapper"> |
2 | 2 | |
3 | 3 | <ul class="ui-tab-nav"> |
4 | - <li><a href="#ui-general" class="active"><?php esc_html_e('General','tour-operator'); ?></a></li> |
|
5 | - <?php if(class_exists('LSX_TO_Search')) { ?> |
|
6 | - <li><a href="#ui-search"><?php esc_html_e('Search','tour-operator'); ?></a></li> |
|
4 | + <li><a href="#ui-general" class="active"><?php esc_html_e('General', 'tour-operator'); ?></a></li> |
|
5 | + <?php if (class_exists('LSX_TO_Search')) { ?> |
|
6 | + <li><a href="#ui-search"><?php esc_html_e('Search', 'tour-operator'); ?></a></li> |
|
7 | 7 | <?php } ?> |
8 | - <li><a href="#ui-placeholders"><?php esc_html_e('Placeholders','tour-operator'); ?></a></li> |
|
9 | - <li><a href="#ui-archives"><?php esc_html_e('Archives','tour-operator'); ?></a></li> |
|
10 | - <li><a href="#ui-single"><?php esc_html_e('Single','tour-operator'); ?></a></li> |
|
8 | + <li><a href="#ui-placeholders"><?php esc_html_e('Placeholders', 'tour-operator'); ?></a></li> |
|
9 | + <li><a href="#ui-archives"><?php esc_html_e('Archives', 'tour-operator'); ?></a></li> |
|
10 | + <li><a href="#ui-single"><?php esc_html_e('Single', 'tour-operator'); ?></a></li> |
|
11 | 11 | </ul> |
12 | 12 | |
13 | 13 | <div id="ui-general" class="ui-tab active"> |
14 | 14 | <table class="form-table"> |
15 | 15 | <tbody> |
16 | - <?php do_action('lsx_to_framework_activity_tab_content','activity','general'); ?> |
|
16 | + <?php do_action('lsx_to_framework_activity_tab_content', 'activity', 'general'); ?> |
|
17 | 17 | </tbody> |
18 | 18 | </table> |
19 | 19 | </div> |
20 | 20 | |
21 | - <?php if(class_exists('LSX_TO_Search')) { ?> |
|
21 | + <?php if (class_exists('LSX_TO_Search')) { ?> |
|
22 | 22 | <div id="ui-search" class="ui-tab"> |
23 | 23 | <table class="form-table"> |
24 | 24 | <tbody> |
25 | - <?php do_action('lsx_to_framework_activity_tab_content','activity','search'); ?> |
|
25 | + <?php do_action('lsx_to_framework_activity_tab_content', 'activity', 'search'); ?> |
|
26 | 26 | </tbody> |
27 | 27 | </table> |
28 | 28 | </div> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <div id="ui-placeholders" class="ui-tab"> |
32 | 32 | <table class="form-table"> |
33 | 33 | <tbody> |
34 | - <?php do_action('lsx_to_framework_activity_tab_content','activity','placeholders'); ?> |
|
34 | + <?php do_action('lsx_to_framework_activity_tab_content', 'activity', 'placeholders'); ?> |
|
35 | 35 | </tbody> |
36 | 36 | </table> |
37 | 37 | </div> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <div id="ui-archives" class="ui-tab"> |
40 | 40 | <table class="form-table"> |
41 | 41 | <tbody> |
42 | - <?php do_action('lsx_to_framework_activity_tab_content','activity','archives'); ?> |
|
42 | + <?php do_action('lsx_to_framework_activity_tab_content', 'activity', 'archives'); ?> |
|
43 | 43 | </tbody> |
44 | 44 | </table> |
45 | 45 | </div> |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | <div id="ui-single" class="ui-tab"> |
48 | 48 | <table class="form-table"> |
49 | 49 | <tbody> |
50 | - <?php do_action('lsx_to_framework_activity_tab_content','activity','single'); ?> |
|
50 | + <?php do_action('lsx_to_framework_activity_tab_content', 'activity', 'single'); ?> |
|
51 | 51 | </tbody> |
52 | 52 | </table> |
53 | 53 | </div> |
54 | - <?php do_action('lsx_to_framework_activity_tab_bottom','activity'); ?> |
|
54 | + <?php do_action('lsx_to_framework_activity_tab_bottom', 'activity'); ?> |
|
55 | 55 | </div> |
56 | 56 | \ No newline at end of file |
@@ -10,27 +10,27 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | $metabox = array( |
13 | - 'title' => esc_html__( 'Tour Operator Plugin', 'lsx-activities' ), |
|
13 | + 'title' => esc_html__('Tour Operator Plugin', 'lsx-activities'), |
|
14 | 14 | 'pages' => 'activity', |
15 | 15 | 'fields' => array(), |
16 | 16 | ); |
17 | 17 | |
18 | 18 | $metabox['fields'][] = array( |
19 | 19 | 'id' => 'featured', |
20 | - 'name' => esc_html__( 'Featured', 'lsx-activities' ), |
|
20 | + 'name' => esc_html__('Featured', 'lsx-activities'), |
|
21 | 21 | 'type' => 'checkbox', |
22 | 22 | ); |
23 | 23 | |
24 | 24 | $metabox['fields'][] = array( |
25 | 25 | 'id' => 'disable_single', |
26 | - 'name' => esc_html__( 'Disable Single', 'to-reviews' ), |
|
26 | + 'name' => esc_html__('Disable Single', 'to-reviews'), |
|
27 | 27 | 'type' => 'checkbox', |
28 | 28 | ); |
29 | 29 | |
30 | -if ( ! class_exists( 'LSX_Banners' ) ) { |
|
30 | +if ( ! class_exists('LSX_Banners')) { |
|
31 | 31 | $metabox['fields'][] = array( |
32 | 32 | 'id' => 'tagline', |
33 | - 'name' => esc_html__( 'Tagline', 'lsx-activities' ), |
|
33 | + 'name' => esc_html__('Tagline', 'lsx-activities'), |
|
34 | 34 | 'type' => 'text', |
35 | 35 | ); |
36 | 36 | } |
@@ -41,22 +41,22 @@ discard block |
||
41 | 41 | 'type' => 'select', |
42 | 42 | 'multiple' => true, |
43 | 43 | 'options' => array( |
44 | - 'business' => esc_html__( 'Business', 'lsx-activities' ), |
|
45 | - 'children' => esc_html__( 'Children', 'lsx-activities' ), |
|
46 | - 'disability' => esc_html__( 'Disability', 'lsx-activities' ), |
|
47 | - 'leisure' => esc_html__( 'Leisure', 'lsx-activities' ), |
|
48 | - 'luxury' => esc_html__( 'Luxury', 'lsx-activities' ), |
|
49 | - 'pet' => esc_html__( 'Pet', 'lsx-activities' ), |
|
50 | - 'romance' => esc_html__( 'Romance', 'lsx-activities' ), |
|
51 | - 'vegetarian' => esc_html__( 'Vegetarian', 'lsx-activities' ), |
|
52 | - 'weddings' => esc_html__( 'Weddings', 'lsx-activities' ), |
|
44 | + 'business' => esc_html__('Business', 'lsx-activities'), |
|
45 | + 'children' => esc_html__('Children', 'lsx-activities'), |
|
46 | + 'disability' => esc_html__('Disability', 'lsx-activities'), |
|
47 | + 'leisure' => esc_html__('Leisure', 'lsx-activities'), |
|
48 | + 'luxury' => esc_html__('Luxury', 'lsx-activities'), |
|
49 | + 'pet' => esc_html__('Pet', 'lsx-activities'), |
|
50 | + 'romance' => esc_html__('Romance', 'lsx-activities'), |
|
51 | + 'vegetarian' => esc_html__('Vegetarian', 'lsx-activities'), |
|
52 | + 'weddings' => esc_html__('Weddings', 'lsx-activities'), |
|
53 | 53 | ), |
54 | 54 | ); |
55 | 55 | |
56 | -if ( class_exists( 'LSX_TO_Team' ) ) { |
|
56 | +if (class_exists('LSX_TO_Team')) { |
|
57 | 57 | $metabox['fields'][] = array( |
58 | 58 | 'id' => 'team_to_activity', |
59 | - 'name' => esc_html__( 'Team Member', 'lsx-activities' ), |
|
59 | + 'name' => esc_html__('Team Member', 'lsx-activities'), |
|
60 | 60 | 'type' => 'post_select', |
61 | 61 | 'use_ajax' => false, |
62 | 62 | 'allow_none' => true, |
@@ -72,46 +72,46 @@ discard block |
||
72 | 72 | |
73 | 73 | $metabox['fields'][] = array( |
74 | 74 | 'id' => 'price_title', |
75 | - 'name' => __( 'Price','lsx-activities' ), |
|
75 | + 'name' => __('Price', 'lsx-activities'), |
|
76 | 76 | 'type' => 'title', |
77 | 77 | ); |
78 | 78 | |
79 | 79 | $metabox['fields'][] = array( |
80 | 80 | 'id' => 'price', |
81 | - 'name' => __( 'Price','lsx-activities' ), |
|
81 | + 'name' => __('Price', 'lsx-activities'), |
|
82 | 82 | 'type' => 'text', |
83 | 83 | 'cols' => 6, |
84 | 84 | ); |
85 | 85 | |
86 | 86 | $metabox['fields'][] = array( |
87 | 87 | 'id' => 'price_type', |
88 | - 'name' => __( 'Price Type','lsx-activities' ), |
|
88 | + 'name' => __('Price Type', 'lsx-activities'), |
|
89 | 89 | 'type' => 'select', |
90 | 90 | 'cols' => 6, |
91 | 91 | 'options' => array( |
92 | 92 | 'none' => 'Select a type', |
93 | - 'per_person' => __( 'Per Person','lsx-activities' ), |
|
94 | - 'per_group' => __( 'Per Group','lsx-activities' ), |
|
93 | + 'per_person' => __('Per Person', 'lsx-activities'), |
|
94 | + 'per_group' => __('Per Group', 'lsx-activities'), |
|
95 | 95 | ), |
96 | 96 | ); |
97 | 97 | |
98 | -if ( class_exists( 'LSX_TO_Maps' ) ) { |
|
98 | +if (class_exists('LSX_TO_Maps')) { |
|
99 | 99 | $tour_operator = tour_operator(); |
100 | 100 | $api_key = false; |
101 | 101 | |
102 | - if ( isset( $tour_operator->options['api']['googlemaps_key'] ) ) { |
|
102 | + if (isset($tour_operator->options['api']['googlemaps_key'])) { |
|
103 | 103 | $api_key = $tour_operator->options['api']['googlemaps_key']; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $metabox['fields'][] = array( |
107 | 107 | 'id' => 'location_title', |
108 | - 'name' => esc_html__( 'Location', 'lsx-activities' ), |
|
108 | + 'name' => esc_html__('Location', 'lsx-activities'), |
|
109 | 109 | 'type' => 'title', |
110 | 110 | ); |
111 | 111 | |
112 | 112 | $metabox['fields'][] = array( |
113 | 113 | 'id' => 'location', |
114 | - 'name' => esc_html__( 'Location', 'lsx-activities' ), |
|
114 | + 'name' => esc_html__('Location', 'lsx-activities'), |
|
115 | 115 | 'type' => 'gmap', |
116 | 116 | 'google_api_key' => $api_key, |
117 | 117 | ); |
@@ -119,28 +119,28 @@ discard block |
||
119 | 119 | |
120 | 120 | $metabox['fields'][] = array( |
121 | 121 | 'id' => 'gallery_title', |
122 | - 'name' => esc_html__( 'Gallery', 'lsx-activities' ), |
|
122 | + 'name' => esc_html__('Gallery', 'lsx-activities'), |
|
123 | 123 | 'type' => 'title', |
124 | 124 | ); |
125 | 125 | |
126 | 126 | $metabox['fields'][] = array( |
127 | 127 | 'id' => 'gallery', |
128 | - 'name' => esc_html__( 'Gallery', 'lsx-activities' ), |
|
128 | + 'name' => esc_html__('Gallery', 'lsx-activities'), |
|
129 | 129 | 'type' => 'image', |
130 | 130 | 'repeatable' => true, |
131 | 131 | 'show_size' => false, |
132 | 132 | ); |
133 | 133 | |
134 | -if ( class_exists( 'Envira_Gallery' ) ) { |
|
134 | +if (class_exists('Envira_Gallery')) { |
|
135 | 135 | $metabox['fields'][] = array( |
136 | 136 | 'id' => 'envira_title', |
137 | - 'name' => esc_html__( 'Envira Gallery', 'lsx-activities' ), |
|
137 | + 'name' => esc_html__('Envira Gallery', 'lsx-activities'), |
|
138 | 138 | 'type' => 'title', |
139 | 139 | ); |
140 | 140 | |
141 | 141 | $metabox['fields'][] = array( |
142 | 142 | 'id' => 'envira_gallery', |
143 | - 'name' => esc_html__( 'Envira Gallery', 'lsx-activities' ), |
|
143 | + 'name' => esc_html__('Envira Gallery', 'lsx-activities'), |
|
144 | 144 | 'type' => 'post_select', |
145 | 145 | 'use_ajax' => false, |
146 | 146 | 'allow_none' => true, |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | ), |
154 | 154 | ); |
155 | 155 | |
156 | - if ( class_exists( 'Envira_Videos' ) ) { |
|
156 | + if (class_exists('Envira_Videos')) { |
|
157 | 157 | $metabox['fields'][] = array( |
158 | 158 | 'id' => 'envira_video', |
159 | - 'name' => esc_html__( 'Envira Video Gallery', 'lsx-activities' ), |
|
159 | + 'name' => esc_html__('Envira Video Gallery', 'lsx-activities'), |
|
160 | 160 | 'type' => 'post_select', |
161 | 161 | 'use_ajax' => false, |
162 | 162 | 'allow_none' => true, |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | $post_types = array( |
175 | - 'post' => esc_html__( 'Posts', 'lsx-activities' ), |
|
176 | - 'accommodation' => esc_html__( 'Accommodation', 'lsx-activities' ), |
|
177 | - 'destination' => esc_html__( 'Destinations', 'lsx-activities' ), |
|
178 | - 'tour' => esc_html__( 'Tours', 'lsx-activities' ), |
|
175 | + 'post' => esc_html__('Posts', 'lsx-activities'), |
|
176 | + 'accommodation' => esc_html__('Accommodation', 'lsx-activities'), |
|
177 | + 'destination' => esc_html__('Destinations', 'lsx-activities'), |
|
178 | + 'tour' => esc_html__('Tours', 'lsx-activities'), |
|
179 | 179 | ); |
180 | 180 | |
181 | -foreach ( $post_types as $slug => $label ) { |
|
181 | +foreach ($post_types as $slug => $label) { |
|
182 | 182 | $metabox['fields'][] = array( |
183 | 183 | 'id' => $slug . '_title', |
184 | 184 | 'name' => $label, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $metabox['fields'][] = array( |
189 | 189 | 'id' => $slug . '_to_activity', |
190 | - 'name' => $label . esc_html__( ' related with this activity', 'lsx-activities' ), |
|
190 | + 'name' => $label . esc_html__(' related with this activity', 'lsx-activities'), |
|
191 | 191 | 'type' => 'post_select', |
192 | 192 | 'use_ajax' => false, |
193 | 193 | 'repeatable' => true, |
@@ -202,6 +202,6 @@ discard block |
||
202 | 202 | ); |
203 | 203 | } |
204 | 204 | |
205 | -$metabox['fields'] = apply_filters( 'lsx_to_activity_custom_fields', $metabox['fields'] ); |
|
205 | +$metabox['fields'] = apply_filters('lsx_to_activity_custom_fields', $metabox['fields']); |
|
206 | 206 | |
207 | 207 | return $metabox; |
@@ -8,31 +8,31 @@ |
||
8 | 8 | |
9 | 9 | global $lsx_to_archive, $post; |
10 | 10 | |
11 | -if ( 1 !== $lsx_to_archive ) { |
|
11 | +if (1 !== $lsx_to_archive) { |
|
12 | 12 | $lsx_to_archive = false; |
13 | 13 | } |
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <?php lsx_entry_before(); ?> |
17 | 17 | |
18 | -<article id="activity-<?php echo esc_attr( $post->post_name ); ?>" <?php post_class( 'lsx-to-archive-container' ); ?>> |
|
18 | +<article id="activity-<?php echo esc_attr($post->post_name); ?>" <?php post_class('lsx-to-archive-container'); ?>> |
|
19 | 19 | <?php lsx_entry_top(); ?> |
20 | 20 | |
21 | - <?php if ( is_single() && false === $lsx_to_archive ) { ?> |
|
21 | + <?php if (is_single() && false === $lsx_to_archive) { ?> |
|
22 | 22 | |
23 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>> |
|
23 | + <div <?php lsx_to_entry_class('entry-content'); ?>> |
|
24 | 24 | <div class="lsx-to-summary"> |
25 | 25 | <h2 class="lsx-to-summary-title"><?php the_title(); ?></h2> |
26 | 26 | </div> |
27 | 27 | |
28 | - <?php lsx_to_price( '<p class="lsx-to-meta-data lsx-to-meta-data-big lsx-to-meta-data-price"><span class="lsx-to-meta-data-key">' . esc_html__( 'From price', 'tour-operator' ) . ':</span> ', '</p>' ); ?> |
|
28 | + <?php lsx_to_price('<p class="lsx-to-meta-data lsx-to-meta-data-big lsx-to-meta-data-price"><span class="lsx-to-meta-data-key">' . esc_html__('From price', 'tour-operator') . ':</span> ', '</p>'); ?> |
|
29 | 29 | <?php the_content(); ?> |
30 | 30 | <?php lsx_to_sharing(); ?> |
31 | 31 | </div> |
32 | 32 | |
33 | - <?php } elseif ( is_search() || empty( tour_operator()->options[ get_post_type() ]['disable_entry_text'] ) ) { ?> |
|
33 | + <?php } elseif (is_search() || empty(tour_operator()->options[get_post_type()]['disable_entry_text'])) { ?> |
|
34 | 34 | |
35 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>><?php |
|
35 | + <div <?php lsx_to_entry_class('entry-content'); ?>><?php |
|
36 | 36 | lsx_to_entry_content_top(); |
37 | 37 | the_excerpt(); |
38 | 38 | lsx_to_entry_content_bottom(); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_wrap_before(); ?> |
12 | 12 | |
13 | - <div id="primary" class="content-area col-sm-12 <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
13 | + <div id="primary" class="content-area col-sm-12 <?php echo esc_attr(lsx_main_class()); ?>"> |
|
14 | 14 | |
15 | 15 | <?php lsx_content_before(); ?> |
16 | 16 | |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php lsx_content_top(); ?> |
20 | 20 | |
21 | - <?php if ( have_posts() ) : ?> |
|
21 | + <?php if (have_posts()) : ?> |
|
22 | 22 | |
23 | - <div class="row lsx-to-archive-items lsx-to-archive-template-<?php echo esc_attr( tour_operator()->archive_layout ); ?> lsx-to-archive-template-image-<?php echo esc_attr( tour_operator()->archive_list_layout_image_style ); ?>"> |
|
23 | + <div class="row lsx-to-archive-items lsx-to-archive-template-<?php echo esc_attr(tour_operator()->archive_layout); ?> lsx-to-archive-template-image-<?php echo esc_attr(tour_operator()->archive_list_layout_image_style); ?>"> |
|
24 | 24 | |
25 | - <?php while ( have_posts() ) : the_post(); ?> |
|
25 | + <?php while (have_posts()) : the_post(); ?> |
|
26 | 26 | |
27 | - <div class="<?php echo esc_attr( lsx_to_archive_class( 'lsx-to-archive-item' ) ); ?>"> |
|
28 | - <?php lsx_to_activity_content( 'content', 'activity' ); ?> |
|
27 | + <div class="<?php echo esc_attr(lsx_to_archive_class('lsx-to-archive-item')); ?>"> |
|
28 | + <?php lsx_to_activity_content('content', 'activity'); ?> |
|
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <?php endwhile; ?> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | <?php else : ?> |
36 | 36 | |
37 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
37 | + <?php get_template_part('partials/content', 'none'); ?> |
|
38 | 38 | |
39 | 39 | <?php endif; ?> |
40 | 40 |
@@ -32,9 +32,12 @@ |
||
32 | 32 | |
33 | 33 | </div> |
34 | 34 | |
35 | - <?php else : ?> |
|
35 | + <?php else { |
|
36 | + : ?> |
|
36 | 37 | |
37 | - <?php get_template_part( 'partials/content', 'none' ); ?> |
|
38 | + <?php get_template_part( 'partials/content', 'none' ); |
|
39 | +} |
|
40 | +?> |
|
38 | 41 | |
39 | 42 | <?php endif; ?> |
40 | 43 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_wrap_before(); ?> |
12 | 12 | |
13 | - <div id="primary" class="content-area col-sm-12 <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
13 | + <div id="primary" class="content-area col-sm-12 <?php echo esc_attr(lsx_main_class()); ?>"> |
|
14 | 14 | |
15 | 15 | <?php lsx_content_before(); ?> |
16 | 16 | |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php lsx_content_top(); ?> |
20 | 20 | |
21 | - <?php while ( have_posts() ) : the_post(); ?> |
|
21 | + <?php while (have_posts()) : the_post(); ?> |
|
22 | 22 | |
23 | 23 | <section id="summary" class="lsx-to-section lsx-to-collapse-section"> |
24 | - <h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e( 'Summary', 'lsx-activities' ); ?></h2> |
|
24 | + <h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e('Summary', 'lsx-activities'); ?></h2> |
|
25 | 25 | |
26 | 26 | <div id="collapse-summary" class="collapse in"> |
27 | 27 | <div class="collapse-inner"> |
28 | 28 | <div class="row"> |
29 | - <?php lsx_to_content( 'content', 'activity' ); ?> |
|
29 | + <?php lsx_to_content('content', 'activity'); ?> |
|
30 | 30 | </div> |
31 | 31 | </div> |
32 | 32 | </div> |
@@ -12,27 +12,27 @@ discard block |
||
12 | 12 | $has_single = ! lsx_to_is_single_disabled(); |
13 | 13 | $permalink = ''; |
14 | 14 | |
15 | -if ( $has_single ) { |
|
15 | +if ($has_single) { |
|
16 | 16 | $permalink = get_the_permalink(); |
17 | -} elseif ( ! is_post_type_archive( 'activity' ) ) { |
|
17 | +} elseif ( ! is_post_type_archive('activity')) { |
|
18 | 18 | $has_single = true; |
19 | - $permalink = get_post_type_archive_link( 'activity' ) . '#activity-' . $post->post_name; |
|
19 | + $permalink = get_post_type_archive_link('activity') . '#activity-' . $post->post_name; |
|
20 | 20 | } |
21 | 21 | ?> |
22 | 22 | <article <?php post_class(); ?>> |
23 | - <?php if ( empty( $disable_placeholder ) ) { ?> |
|
23 | + <?php if (empty($disable_placeholder)) { ?> |
|
24 | 24 | <div class="lsx-to-widget-thumb"> |
25 | - <?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?> |
|
26 | - <?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?> |
|
27 | - <?php if ( $has_single ) { ?></a><?php } ?> |
|
25 | + <?php if ($has_single) { ?><a href="<?php echo esc_url($permalink); ?>"><?php } ?> |
|
26 | + <?php lsx_thumbnail('lsx-thumbnail-single'); ?> |
|
27 | + <?php if ($has_single) { ?></a><?php } ?> |
|
28 | 28 | </div> |
29 | 29 | <?php } ?> |
30 | 30 | |
31 | 31 | <div class="lsx-to-widget-content"> |
32 | 32 | <h4 class="lsx-to-widget-title text-center"> |
33 | - <?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?> |
|
33 | + <?php if ($has_single) { ?><a href="<?php echo esc_url($permalink); ?>"><?php } ?> |
|
34 | 34 | <?php the_title(); ?> |
35 | - <?php if ( $has_single ) { ?></a><?php } ?> |
|
35 | + <?php if ($has_single) { ?></a><?php } ?> |
|
36 | 36 | </h4> |
37 | 37 | |
38 | 38 | <?php |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | <?php |
46 | 46 | $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; |
47 | 47 | |
48 | - lsx_to_price( '<span class="' . $meta_class . 'price"><span class="lsx-to-meta-data-key">' . esc_html__( 'From price', 'lsx-activities' ) . ':</span> ', '</span>' ); |
|
49 | - lsx_to_connected_destinations( '<span class="' . $meta_class . 'destinations"><span class="lsx-to-meta-data-key">' . __( 'Location', 'lsx-activities' ) . ':</span> ', '</span>' ); |
|
50 | - lsx_to_connected_accommodation( '<span class="' . $meta_class . 'accommodations"><span class="lsx-to-meta-data-key">' . __( 'Accommodation', 'lsx-activities' ) . ':</span> ', '</span>' ); |
|
51 | - lsx_to_connected_tours( '<span class="' . $meta_class . 'tours"><span class="lsx-to-meta-data-key">' . __( 'Tours', 'lsx-activities' ) . ':</span> ', '</span>' ); |
|
48 | + lsx_to_price('<span class="' . $meta_class . 'price"><span class="lsx-to-meta-data-key">' . esc_html__('From price', 'lsx-activities') . ':</span> ', '</span>'); |
|
49 | + lsx_to_connected_destinations('<span class="' . $meta_class . 'destinations"><span class="lsx-to-meta-data-key">' . __('Location', 'lsx-activities') . ':</span> ', '</span>'); |
|
50 | + lsx_to_connected_accommodation('<span class="' . $meta_class . 'accommodations"><span class="lsx-to-meta-data-key">' . __('Accommodation', 'lsx-activities') . ':</span> ', '</span>'); |
|
51 | + lsx_to_connected_tours('<span class="' . $meta_class . 'tours"><span class="lsx-to-meta-data-key">' . __('Tours', 'lsx-activities') . ':</span> ', '</span>'); |
|
52 | 52 | ?> |
53 | 53 | </div> |
54 | 54 | |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | lsx_to_widget_entry_content_bottom(); |
60 | 60 | $excerpt = ob_get_clean(); |
61 | 61 | |
62 | - if ( empty( $disable_text ) && ! empty( $excerpt ) ) { |
|
63 | - echo wp_kses_post( $excerpt ); |
|
64 | - } elseif ( $has_single ) { ?> |
|
65 | - <p><a href="<?php echo esc_url( $permalink ); ?>" class="moretag"><?php esc_html_e( 'View more', 'lsx-activities' ); ?></a></p> |
|
62 | + if (empty($disable_text) && ! empty($excerpt)) { |
|
63 | + echo wp_kses_post($excerpt); |
|
64 | + } elseif ($has_single) { ?> |
|
65 | + <p><a href="<?php echo esc_url($permalink); ?>" class="moretag"><?php esc_html_e('View more', 'lsx-activities'); ?></a></p> |
|
66 | 66 | <?php } |
67 | 67 | ?> |
68 | 68 | </div> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @link |
9 | 9 | * @copyright 2018 LightSpeedDevelopment |
10 | 10 | */ |
11 | -if (!class_exists( 'LSX_Activities' ) ) { |
|
11 | +if ( ! class_exists('LSX_Activities')) { |
|
12 | 12 | /** |
13 | 13 | * Main plugin class. |
14 | 14 | * |
@@ -66,19 +66,19 @@ discard block |
||
66 | 66 | $this->lsx_to_search_integration(); |
67 | 67 | |
68 | 68 | // Make TO last plugin to load |
69 | - add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); |
|
69 | + add_action('activated_plugin', array($this, 'activated_plugin')); |
|
70 | 70 | |
71 | - add_action('init',array($this,'load_plugin_textdomain')); |
|
71 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
72 | 72 | |
73 | - if(false !== $this->post_types){ |
|
74 | - add_filter( 'lsx_to_framework_post_types', array( $this, 'post_types_filter') ); |
|
75 | - add_filter( 'lsx_to_post_types', array( $this, 'post_types_filter') ); |
|
76 | - add_filter( 'lsx_to_post_types_singular', array( $this, 'post_types_singular_filter') ); |
|
77 | - add_filter('lsx_to_settings_path',array( $this, 'plugin_path'),10,2); |
|
73 | + if (false !== $this->post_types) { |
|
74 | + add_filter('lsx_to_framework_post_types', array($this, 'post_types_filter')); |
|
75 | + add_filter('lsx_to_post_types', array($this, 'post_types_filter')); |
|
76 | + add_filter('lsx_to_post_types_singular', array($this, 'post_types_singular_filter')); |
|
77 | + add_filter('lsx_to_settings_path', array($this, 'plugin_path'), 10, 2); |
|
78 | 78 | } |
79 | - if(false !== $this->taxonomies){ |
|
80 | - add_filter( 'lsx_to_framework_taxonomies', array( $this, 'taxonomies_filter') ); |
|
81 | - add_filter( 'lsx_to_framework_taxonomies_plural', array( $this, 'taxonomies_plural_filter') ); |
|
79 | + if (false !== $this->taxonomies) { |
|
80 | + add_filter('lsx_to_framework_taxonomies', array($this, 'taxonomies_filter')); |
|
81 | + add_filter('lsx_to_framework_taxonomies_plural', array($this, 'taxonomies_plural_filter')); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | require_once(LSX_ACTIVITIES_PATH . '/classes/class-lsx-activities-admin.php'); |
@@ -86,23 +86,23 @@ discard block |
||
86 | 86 | require_once(LSX_ACTIVITIES_PATH . '/includes/template-tags.php'); |
87 | 87 | |
88 | 88 | // flush_rewrite_rules() |
89 | - register_activation_hook( LSX_ACTIVITIES_CORE, array( $this, 'register_activation_hook' ) ); |
|
90 | - add_action( 'admin_init', array( $this, 'register_activation_hook_check' ) ); |
|
89 | + register_activation_hook(LSX_ACTIVITIES_CORE, array($this, 'register_activation_hook')); |
|
90 | + add_action('admin_init', array($this, 'register_activation_hook_check')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Include the post type for the search integration |
95 | 95 | */ |
96 | - public function lsx_to_search_integration(){ |
|
97 | - add_filter( 'lsx_to_search_post_types', array( $this, 'post_types_filter') ); |
|
98 | - add_filter( 'lsx_to_search_taxonomies', array( $this, 'taxonomies_filter') ); |
|
96 | + public function lsx_to_search_integration() { |
|
97 | + add_filter('lsx_to_search_post_types', array($this, 'post_types_filter')); |
|
98 | + add_filter('lsx_to_search_taxonomies', array($this, 'taxonomies_filter')); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Load the plugin text domain for translation. |
103 | 103 | */ |
104 | 104 | public function load_plugin_textdomain() { |
105 | - load_plugin_textdomain( 'lsx-activities', FALSE, basename( LSX_ACTIVITIES_PATH ) . '/languages'); |
|
105 | + load_plugin_textdomain('lsx-activities', FALSE, basename(LSX_ACTIVITIES_PATH) . '/languages'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -110,19 +110,19 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function set_vars() { |
112 | 112 | $this->post_types = array( |
113 | - 'activity' => __('Activities','lsx-activities') |
|
113 | + 'activity' => __('Activities', 'lsx-activities') |
|
114 | 114 | ); |
115 | 115 | $this->post_types_singular = array( |
116 | - 'activity' => __('Activity','lsx-activities') |
|
116 | + 'activity' => __('Activity', 'lsx-activities') |
|
117 | 117 | ); |
118 | 118 | $this->post_type_slugs = array_keys($this->post_types); |
119 | 119 | |
120 | - $this->options = get_option('_lsx-to_settings',false); |
|
121 | - if((false !== $this->options && isset($this->options['api']['googlemaps_key'])) || defined('GOOGLEMAPS_API_KEY')) { |
|
120 | + $this->options = get_option('_lsx-to_settings', false); |
|
121 | + if ((false !== $this->options && isset($this->options['api']['googlemaps_key'])) || defined('GOOGLEMAPS_API_KEY')) { |
|
122 | 122 | |
123 | - if (!defined('GOOGLEMAPS_API_KEY')) { |
|
123 | + if ( ! defined('GOOGLEMAPS_API_KEY')) { |
|
124 | 124 | $this->api_key = $this->options['api']['googlemaps_key']; |
125 | - } else { |
|
125 | + }else { |
|
126 | 126 | $this->api_key = GOOGLEMAPS_API_KEY; |
127 | 127 | } |
128 | 128 | } |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | /** |
132 | 132 | * Adds our post types to an array via a filter |
133 | 133 | */ |
134 | - public function plugin_path($path,$post_type){ |
|
135 | - if(false !== $this->post_types && array_key_exists($post_type,$this->post_types)){ |
|
134 | + public function plugin_path($path, $post_type) { |
|
135 | + if (false !== $this->post_types && array_key_exists($post_type, $this->post_types)) { |
|
136 | 136 | $path = LSX_ACTIVITIES_PATH; |
137 | 137 | } |
138 | 138 | return $path; |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * Adds our post types to an array via a filter |
143 | 143 | */ |
144 | - public function post_types_slugs_filter($post_types){ |
|
145 | - if(is_array($post_types)){ |
|
146 | - $post_types = array_merge($post_types,$this->post_type_slugs); |
|
147 | - }else{ |
|
144 | + public function post_types_slugs_filter($post_types) { |
|
145 | + if (is_array($post_types)) { |
|
146 | + $post_types = array_merge($post_types, $this->post_type_slugs); |
|
147 | + }else { |
|
148 | 148 | $post_types = $this->post_type_slugs; |
149 | 149 | } |
150 | 150 | return $post_types; |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * Adds our post types to an array via a filter |
155 | 155 | */ |
156 | - public function post_types_filter($post_types){ |
|
157 | - if(is_array($post_types) && is_array($this->post_types)){ |
|
158 | - $post_types = array_merge($post_types,$this->post_types); |
|
159 | - }elseif(is_array($this->post_types)){ |
|
156 | + public function post_types_filter($post_types) { |
|
157 | + if (is_array($post_types) && is_array($this->post_types)) { |
|
158 | + $post_types = array_merge($post_types, $this->post_types); |
|
159 | + }elseif (is_array($this->post_types)) { |
|
160 | 160 | $post_types = $this->post_types; |
161 | 161 | } |
162 | 162 | return $post_types; |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | /** |
166 | 166 | * Adds our post types to an array via a filter |
167 | 167 | */ |
168 | - public function post_types_singular_filter($post_types_singular){ |
|
169 | - if(is_array($post_types_singular) && is_array($this->post_types_singular)){ |
|
170 | - $post_types_singular = array_merge($post_types_singular,$this->post_types_singular); |
|
171 | - }elseif(is_array($this->post_types_singular)){ |
|
168 | + public function post_types_singular_filter($post_types_singular) { |
|
169 | + if (is_array($post_types_singular) && is_array($this->post_types_singular)) { |
|
170 | + $post_types_singular = array_merge($post_types_singular, $this->post_types_singular); |
|
171 | + }elseif (is_array($this->post_types_singular)) { |
|
172 | 172 | $post_types_singular = $this->post_types_singular; |
173 | 173 | } |
174 | 174 | return $post_types_singular; |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | /** |
178 | 178 | * Adds our taxonomies to an array via a filter |
179 | 179 | */ |
180 | - public function taxonomies_filter($taxonomies){ |
|
181 | - if(is_array($taxonomies) && is_array($this->taxonomies)){ |
|
182 | - $taxonomies = array_merge($taxonomies,$this->taxonomies); |
|
183 | - }elseif(is_array($this->taxonomies)){ |
|
180 | + public function taxonomies_filter($taxonomies) { |
|
181 | + if (is_array($taxonomies) && is_array($this->taxonomies)) { |
|
182 | + $taxonomies = array_merge($taxonomies, $this->taxonomies); |
|
183 | + }elseif (is_array($this->taxonomies)) { |
|
184 | 184 | $taxonomies = $this->taxonomies; |
185 | 185 | } |
186 | 186 | return $taxonomies; |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | /** |
190 | 190 | * Adds our taxonomies_plural to an array via a filter |
191 | 191 | */ |
192 | - public function taxonomies_plural_filter($taxonomies_plural){ |
|
193 | - if(is_array($taxonomies_plural) && is_array($this->taxonomies_plural)){ |
|
194 | - $taxonomies_plural = array_merge($taxonomies_plural,$this->taxonomies_plural); |
|
195 | - }elseif(is_array($this->taxonomies_plural)){ |
|
192 | + public function taxonomies_plural_filter($taxonomies_plural) { |
|
193 | + if (is_array($taxonomies_plural) && is_array($this->taxonomies_plural)) { |
|
194 | + $taxonomies_plural = array_merge($taxonomies_plural, $this->taxonomies_plural); |
|
195 | + }elseif (is_array($this->taxonomies_plural)) { |
|
196 | 196 | $taxonomies_plural = $this->taxonomies_plural; |
197 | 197 | } |
198 | 198 | return $taxonomies_plural; |
@@ -202,15 +202,15 @@ discard block |
||
202 | 202 | * Make TO last plugin to load. |
203 | 203 | */ |
204 | 204 | public function activated_plugin() { |
205 | - if ( $plugins = get_option( 'active_plugins' ) ) { |
|
206 | - $search = preg_grep( '/.*\/tour-operator\.php/', $plugins ); |
|
207 | - $key = array_search( $search, $plugins ); |
|
208 | - |
|
209 | - if ( is_array( $search ) && count( $search ) ) { |
|
210 | - foreach ( $search as $key => $path ) { |
|
211 | - array_splice( $plugins, $key, 1 ); |
|
212 | - array_push( $plugins, $path ); |
|
213 | - update_option( 'active_plugins', $plugins ); |
|
205 | + if ($plugins = get_option('active_plugins')) { |
|
206 | + $search = preg_grep('/.*\/tour-operator\.php/', $plugins); |
|
207 | + $key = array_search($search, $plugins); |
|
208 | + |
|
209 | + if (is_array($search) && count($search)) { |
|
210 | + foreach ($search as $key => $path) { |
|
211 | + array_splice($plugins, $key, 1); |
|
212 | + array_push($plugins, $path); |
|
213 | + update_option('active_plugins', $plugins); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | } |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | * On plugin activation |
221 | 221 | */ |
222 | 222 | public function register_activation_hook() { |
223 | - if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) { |
|
224 | - set_transient( '_tour_operators_activities_flush_rewrite_rules', 1, 30 ); |
|
223 | + if ( ! is_network_admin() && ! isset($_GET['activate-multi'])) { |
|
224 | + set_transient('_tour_operators_activities_flush_rewrite_rules', 1, 30); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | * On plugin activation (check) |
230 | 230 | */ |
231 | 231 | public function register_activation_hook_check() { |
232 | - if ( ! get_transient( '_tour_operators_activities_flush_rewrite_rules' ) ) { |
|
232 | + if ( ! get_transient('_tour_operators_activities_flush_rewrite_rules')) { |
|
233 | 233 | return; |
234 | 234 | } |
235 | 235 | |
236 | - delete_transient( '_tour_operators_activities_flush_rewrite_rules' ); |
|
236 | + delete_transient('_tour_operators_activities_flush_rewrite_rules'); |
|
237 | 237 | flush_rewrite_rules(); |
238 | 238 | } |
239 | 239 |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function post_types_slugs_filter($post_types){ |
145 | 145 | if(is_array($post_types)){ |
146 | 146 | $post_types = array_merge($post_types,$this->post_type_slugs); |
147 | - }else{ |
|
147 | + } else{ |
|
148 | 148 | $post_types = $this->post_type_slugs; |
149 | 149 | } |
150 | 150 | return $post_types; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public function post_types_filter($post_types){ |
157 | 157 | if(is_array($post_types) && is_array($this->post_types)){ |
158 | 158 | $post_types = array_merge($post_types,$this->post_types); |
159 | - }elseif(is_array($this->post_types)){ |
|
159 | + } elseif(is_array($this->post_types)){ |
|
160 | 160 | $post_types = $this->post_types; |
161 | 161 | } |
162 | 162 | return $post_types; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function post_types_singular_filter($post_types_singular){ |
169 | 169 | if(is_array($post_types_singular) && is_array($this->post_types_singular)){ |
170 | 170 | $post_types_singular = array_merge($post_types_singular,$this->post_types_singular); |
171 | - }elseif(is_array($this->post_types_singular)){ |
|
171 | + } elseif(is_array($this->post_types_singular)){ |
|
172 | 172 | $post_types_singular = $this->post_types_singular; |
173 | 173 | } |
174 | 174 | return $post_types_singular; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function taxonomies_filter($taxonomies){ |
181 | 181 | if(is_array($taxonomies) && is_array($this->taxonomies)){ |
182 | 182 | $taxonomies = array_merge($taxonomies,$this->taxonomies); |
183 | - }elseif(is_array($this->taxonomies)){ |
|
183 | + } elseif(is_array($this->taxonomies)){ |
|
184 | 184 | $taxonomies = $this->taxonomies; |
185 | 185 | } |
186 | 186 | return $taxonomies; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | public function taxonomies_plural_filter($taxonomies_plural){ |
193 | 193 | if(is_array($taxonomies_plural) && is_array($this->taxonomies_plural)){ |
194 | 194 | $taxonomies_plural = array_merge($taxonomies_plural,$this->taxonomies_plural); |
195 | - }elseif(is_array($this->taxonomies_plural)){ |
|
195 | + } elseif(is_array($this->taxonomies_plural)){ |
|
196 | 196 | $taxonomies_plural = $this->taxonomies_plural; |
197 | 197 | } |
198 | 198 | return $taxonomies_plural; |