@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getShowHideLinks(): string |
119 | 119 | { |
120 | - if (! $this->showTicketDetails()) { |
|
120 | + if ( ! $this->showTicketDetails()) { |
|
121 | 121 | return ''; |
122 | 122 | } |
123 | 123 | return EEH_HTML::link( |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | "display-{$this->cssId()}", |
133 | 133 | 'display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js', |
134 | 134 | '', |
135 | - 'rel="' . $this->cssId() . '"' |
|
136 | - ) . EEH_HTML::link( |
|
135 | + 'rel="'.$this->cssId().'"' |
|
136 | + ).EEH_HTML::link( |
|
137 | 137 | '', |
138 | 138 | sprintf(esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), ' '), |
139 | 139 | esc_attr( |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | "hide-{$this->cssId()}", |
146 | 146 | 'hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js', |
147 | 147 | 'display:none;', |
148 | - 'rel="' . $this->cssId() . '"' |
|
148 | + 'rel="'.$this->cssId().'"' |
|
149 | 149 | ); |
150 | 150 | } |
151 | 151 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | 'FHEE__ticket_selector_chart_template__display_ticket_price_details', |
192 | 192 | true |
193 | 193 | ); |
194 | - $template_args['price_breakdown_heading'] = apply_filters( |
|
194 | + $template_args['price_breakdown_heading'] = apply_filters( |
|
195 | 195 | 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
196 | 196 | esc_html__('Price', 'event_espresso') |
197 | 197 | ); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | return EEH_Template::locate_template( |
203 | 203 | apply_filters( |
204 | 204 | 'FHEE__EventEspresso_modules_ticket_selector_TicketDetails__display__template_path', |
205 | - TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_details.template.php', |
|
205 | + TICKET_SELECTOR_TEMPLATES_PATH.'ticket_details.template.php', |
|
206 | 206 | $this->ticket |
207 | 207 | ), |
208 | 208 | $template_args |
@@ -19,193 +19,193 @@ |
||
19 | 19 | */ |
20 | 20 | class TicketDetails |
21 | 21 | { |
22 | - /** |
|
23 | - * @var EE_Ticket $ticket |
|
24 | - */ |
|
25 | - protected $ticket; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var EE_Ticket_Selector_Config $template_settings |
|
29 | - */ |
|
30 | - protected $template_settings; |
|
31 | - |
|
32 | - /** |
|
33 | - * @var string $date_format |
|
34 | - */ |
|
35 | - protected $date_format; |
|
36 | - |
|
37 | - /** |
|
38 | - * @var string $time_format |
|
39 | - */ |
|
40 | - protected $time_format; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var bool $event_is_expired |
|
44 | - */ |
|
45 | - protected $event_is_expired; |
|
46 | - |
|
47 | - |
|
48 | - /** |
|
49 | - * TicketDetails constructor. |
|
50 | - * |
|
51 | - * @param EE_Ticket $ticket |
|
52 | - * @param EE_Ticket_Selector_Config $template_settings |
|
53 | - * @param array $template_args |
|
54 | - */ |
|
55 | - public function __construct( |
|
56 | - EE_Ticket $ticket, |
|
57 | - EE_Ticket_Selector_Config $template_settings, |
|
58 | - array $template_args |
|
59 | - ) { |
|
60 | - $this->ticket = $ticket; |
|
61 | - $this->template_settings = $template_settings; |
|
62 | - $this->date_format = $template_args['date_format']; |
|
63 | - $this->time_format = $template_args['time_format']; |
|
64 | - $this->event_is_expired = $template_args['event_is_expired']; |
|
65 | - } |
|
66 | - |
|
67 | - |
|
68 | - /** |
|
69 | - * @return EE_Ticket |
|
70 | - */ |
|
71 | - public function getTicket(): EE_Ticket |
|
72 | - { |
|
73 | - return $this->ticket; |
|
74 | - } |
|
75 | - |
|
76 | - |
|
77 | - /** |
|
78 | - * @return bool |
|
79 | - */ |
|
80 | - public function showTicketDetails(): bool |
|
81 | - { |
|
82 | - return $this->template_settings->show_ticket_details; |
|
83 | - } |
|
84 | - |
|
85 | - |
|
86 | - /** |
|
87 | - * @return EE_Ticket_Selector_Config |
|
88 | - */ |
|
89 | - public function getTemplateSettings(): EE_Ticket_Selector_Config |
|
90 | - { |
|
91 | - return $this->template_settings; |
|
92 | - } |
|
93 | - |
|
94 | - |
|
95 | - /** |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - public function getDateFormat(): string |
|
99 | - { |
|
100 | - return $this->date_format; |
|
101 | - } |
|
102 | - |
|
103 | - |
|
104 | - /** |
|
105 | - * @return string |
|
106 | - */ |
|
107 | - public function getTimeFormat(): string |
|
108 | - { |
|
109 | - return $this->time_format; |
|
110 | - } |
|
111 | - |
|
112 | - |
|
113 | - /** |
|
114 | - * @return string |
|
115 | - * @throws EE_Error |
|
116 | - * @throws ReflectionException |
|
117 | - */ |
|
118 | - public function getShowHideLinks(): string |
|
119 | - { |
|
120 | - if (! $this->showTicketDetails()) { |
|
121 | - return ''; |
|
122 | - } |
|
123 | - return EEH_HTML::link( |
|
124 | - '', |
|
125 | - sprintf(esc_html__('show%1$sdetails%1$s+', 'event_espresso'), ' '), |
|
126 | - esc_attr( |
|
127 | - apply_filters( |
|
128 | - 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', |
|
129 | - esc_html__('click to show additional ticket details', 'event_espresso') |
|
130 | - ) |
|
131 | - ), |
|
132 | - "display-{$this->cssId()}", |
|
133 | - 'display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js', |
|
134 | - '', |
|
135 | - 'rel="' . $this->cssId() . '"' |
|
136 | - ) . EEH_HTML::link( |
|
137 | - '', |
|
138 | - sprintf(esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), ' '), |
|
139 | - esc_attr( |
|
140 | - apply_filters( |
|
141 | - 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', |
|
142 | - esc_html__('click to hide additional ticket details', 'event_espresso') |
|
143 | - ) |
|
144 | - ), |
|
145 | - "hide-{$this->cssId()}", |
|
146 | - 'hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js', |
|
147 | - 'display:none;', |
|
148 | - 'rel="' . $this->cssId() . '"' |
|
149 | - ); |
|
150 | - } |
|
151 | - |
|
152 | - |
|
153 | - /** |
|
154 | - * @return string |
|
155 | - * @throws EE_Error |
|
156 | - * @throws ReflectionException |
|
157 | - */ |
|
158 | - public function cssId(): string |
|
159 | - { |
|
160 | - return apply_filters( |
|
161 | - 'FHEE__ticket_selector_chart_template__ticket_details_css_id', |
|
162 | - "tckt-slctr-tkt-details-{$this->ticket->get_event_ID()}-{$this->ticket->ID()}" |
|
163 | - ); |
|
164 | - } |
|
165 | - |
|
166 | - |
|
167 | - /** |
|
168 | - * @param float|string $ticket_price |
|
169 | - * @param int|string $remaining |
|
170 | - * @param int|string $cols |
|
171 | - * @return string |
|
172 | - * @throws EE_Error |
|
173 | - * @throws ReflectionException |
|
174 | - */ |
|
175 | - public function display( |
|
176 | - $ticket_price = 0.00, |
|
177 | - $remaining = EE_INF, |
|
178 | - $cols = 2 |
|
179 | - ): string { |
|
180 | - $template_args = []; |
|
181 | - $template_args['ticket'] = $this->ticket; |
|
182 | - $template_args['ticket_price'] = $ticket_price; |
|
183 | - $template_args['remaining'] = $remaining; |
|
184 | - $template_args['cols'] = $cols; |
|
185 | - $template_args['show_ticket_details'] = $this->template_settings->show_ticket_details; |
|
186 | - $template_args['show_ticket_sale_columns'] = $this->template_settings->show_ticket_sale_columns; |
|
187 | - $template_args['ticket_details_row_class'] = espresso_get_object_css_class($this->ticket, '', 'details'); |
|
188 | - $template_args['ticket_details_css_id'] = $this->cssId(); |
|
189 | - $template_args['display_ticket_price'] = $ticket_price !== 0 |
|
190 | - && apply_filters( |
|
191 | - 'FHEE__ticket_selector_chart_template__display_ticket_price_details', |
|
192 | - true |
|
193 | - ); |
|
194 | - $template_args['price_breakdown_heading'] = apply_filters( |
|
195 | - 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
|
196 | - esc_html__('Price', 'event_espresso') |
|
197 | - ); |
|
198 | - $template_args['date_format'] = $this->date_format; |
|
199 | - $template_args['time_format'] = $this->time_format; |
|
200 | - $template_args['event_is_expired'] = $this->event_is_expired; |
|
201 | - |
|
202 | - return EEH_Template::locate_template( |
|
203 | - apply_filters( |
|
204 | - 'FHEE__EventEspresso_modules_ticket_selector_TicketDetails__display__template_path', |
|
205 | - TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_details.template.php', |
|
206 | - $this->ticket |
|
207 | - ), |
|
208 | - $template_args |
|
209 | - ); |
|
210 | - } |
|
22 | + /** |
|
23 | + * @var EE_Ticket $ticket |
|
24 | + */ |
|
25 | + protected $ticket; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var EE_Ticket_Selector_Config $template_settings |
|
29 | + */ |
|
30 | + protected $template_settings; |
|
31 | + |
|
32 | + /** |
|
33 | + * @var string $date_format |
|
34 | + */ |
|
35 | + protected $date_format; |
|
36 | + |
|
37 | + /** |
|
38 | + * @var string $time_format |
|
39 | + */ |
|
40 | + protected $time_format; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var bool $event_is_expired |
|
44 | + */ |
|
45 | + protected $event_is_expired; |
|
46 | + |
|
47 | + |
|
48 | + /** |
|
49 | + * TicketDetails constructor. |
|
50 | + * |
|
51 | + * @param EE_Ticket $ticket |
|
52 | + * @param EE_Ticket_Selector_Config $template_settings |
|
53 | + * @param array $template_args |
|
54 | + */ |
|
55 | + public function __construct( |
|
56 | + EE_Ticket $ticket, |
|
57 | + EE_Ticket_Selector_Config $template_settings, |
|
58 | + array $template_args |
|
59 | + ) { |
|
60 | + $this->ticket = $ticket; |
|
61 | + $this->template_settings = $template_settings; |
|
62 | + $this->date_format = $template_args['date_format']; |
|
63 | + $this->time_format = $template_args['time_format']; |
|
64 | + $this->event_is_expired = $template_args['event_is_expired']; |
|
65 | + } |
|
66 | + |
|
67 | + |
|
68 | + /** |
|
69 | + * @return EE_Ticket |
|
70 | + */ |
|
71 | + public function getTicket(): EE_Ticket |
|
72 | + { |
|
73 | + return $this->ticket; |
|
74 | + } |
|
75 | + |
|
76 | + |
|
77 | + /** |
|
78 | + * @return bool |
|
79 | + */ |
|
80 | + public function showTicketDetails(): bool |
|
81 | + { |
|
82 | + return $this->template_settings->show_ticket_details; |
|
83 | + } |
|
84 | + |
|
85 | + |
|
86 | + /** |
|
87 | + * @return EE_Ticket_Selector_Config |
|
88 | + */ |
|
89 | + public function getTemplateSettings(): EE_Ticket_Selector_Config |
|
90 | + { |
|
91 | + return $this->template_settings; |
|
92 | + } |
|
93 | + |
|
94 | + |
|
95 | + /** |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + public function getDateFormat(): string |
|
99 | + { |
|
100 | + return $this->date_format; |
|
101 | + } |
|
102 | + |
|
103 | + |
|
104 | + /** |
|
105 | + * @return string |
|
106 | + */ |
|
107 | + public function getTimeFormat(): string |
|
108 | + { |
|
109 | + return $this->time_format; |
|
110 | + } |
|
111 | + |
|
112 | + |
|
113 | + /** |
|
114 | + * @return string |
|
115 | + * @throws EE_Error |
|
116 | + * @throws ReflectionException |
|
117 | + */ |
|
118 | + public function getShowHideLinks(): string |
|
119 | + { |
|
120 | + if (! $this->showTicketDetails()) { |
|
121 | + return ''; |
|
122 | + } |
|
123 | + return EEH_HTML::link( |
|
124 | + '', |
|
125 | + sprintf(esc_html__('show%1$sdetails%1$s+', 'event_espresso'), ' '), |
|
126 | + esc_attr( |
|
127 | + apply_filters( |
|
128 | + 'FHEE__ticket_selector_chart_template__show_ticket_details_link_title', |
|
129 | + esc_html__('click to show additional ticket details', 'event_espresso') |
|
130 | + ) |
|
131 | + ), |
|
132 | + "display-{$this->cssId()}", |
|
133 | + 'display-tckt-slctr-tkt-details display-the-hidden lt-grey-text smaller-text hide-if-no-js', |
|
134 | + '', |
|
135 | + 'rel="' . $this->cssId() . '"' |
|
136 | + ) . EEH_HTML::link( |
|
137 | + '', |
|
138 | + sprintf(esc_html__('hide%1$sdetails%1$s-', 'event_espresso'), ' '), |
|
139 | + esc_attr( |
|
140 | + apply_filters( |
|
141 | + 'FHEE__ticket_selector_chart_template__hide_ticket_details_link_title', |
|
142 | + esc_html__('click to hide additional ticket details', 'event_espresso') |
|
143 | + ) |
|
144 | + ), |
|
145 | + "hide-{$this->cssId()}", |
|
146 | + 'hide-tckt-slctr-tkt-details hide-the-displayed lt-grey-text smaller-text hide-if-no-js', |
|
147 | + 'display:none;', |
|
148 | + 'rel="' . $this->cssId() . '"' |
|
149 | + ); |
|
150 | + } |
|
151 | + |
|
152 | + |
|
153 | + /** |
|
154 | + * @return string |
|
155 | + * @throws EE_Error |
|
156 | + * @throws ReflectionException |
|
157 | + */ |
|
158 | + public function cssId(): string |
|
159 | + { |
|
160 | + return apply_filters( |
|
161 | + 'FHEE__ticket_selector_chart_template__ticket_details_css_id', |
|
162 | + "tckt-slctr-tkt-details-{$this->ticket->get_event_ID()}-{$this->ticket->ID()}" |
|
163 | + ); |
|
164 | + } |
|
165 | + |
|
166 | + |
|
167 | + /** |
|
168 | + * @param float|string $ticket_price |
|
169 | + * @param int|string $remaining |
|
170 | + * @param int|string $cols |
|
171 | + * @return string |
|
172 | + * @throws EE_Error |
|
173 | + * @throws ReflectionException |
|
174 | + */ |
|
175 | + public function display( |
|
176 | + $ticket_price = 0.00, |
|
177 | + $remaining = EE_INF, |
|
178 | + $cols = 2 |
|
179 | + ): string { |
|
180 | + $template_args = []; |
|
181 | + $template_args['ticket'] = $this->ticket; |
|
182 | + $template_args['ticket_price'] = $ticket_price; |
|
183 | + $template_args['remaining'] = $remaining; |
|
184 | + $template_args['cols'] = $cols; |
|
185 | + $template_args['show_ticket_details'] = $this->template_settings->show_ticket_details; |
|
186 | + $template_args['show_ticket_sale_columns'] = $this->template_settings->show_ticket_sale_columns; |
|
187 | + $template_args['ticket_details_row_class'] = espresso_get_object_css_class($this->ticket, '', 'details'); |
|
188 | + $template_args['ticket_details_css_id'] = $this->cssId(); |
|
189 | + $template_args['display_ticket_price'] = $ticket_price !== 0 |
|
190 | + && apply_filters( |
|
191 | + 'FHEE__ticket_selector_chart_template__display_ticket_price_details', |
|
192 | + true |
|
193 | + ); |
|
194 | + $template_args['price_breakdown_heading'] = apply_filters( |
|
195 | + 'FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading', |
|
196 | + esc_html__('Price', 'event_espresso') |
|
197 | + ); |
|
198 | + $template_args['date_format'] = $this->date_format; |
|
199 | + $template_args['time_format'] = $this->time_format; |
|
200 | + $template_args['event_is_expired'] = $this->event_is_expired; |
|
201 | + |
|
202 | + return EEH_Template::locate_template( |
|
203 | + apply_filters( |
|
204 | + 'FHEE__EventEspresso_modules_ticket_selector_TicketDetails__display__template_path', |
|
205 | + TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_details.template.php', |
|
206 | + $this->ticket |
|
207 | + ), |
|
208 | + $template_args |
|
209 | + ); |
|
210 | + } |
|
211 | 211 | } |
@@ -38,103 +38,103 @@ |
||
38 | 38 | * @since 4.0 |
39 | 39 | */ |
40 | 40 | if (function_exists('espresso_version')) { |
41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | - /** |
|
43 | - * espresso_duplicate_plugin_error |
|
44 | - * displays if more than one version of EE is activated at the same time |
|
45 | - */ |
|
46 | - function espresso_duplicate_plugin_error() |
|
47 | - { |
|
48 | - ?> |
|
41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | + /** |
|
43 | + * espresso_duplicate_plugin_error |
|
44 | + * displays if more than one version of EE is activated at the same time |
|
45 | + */ |
|
46 | + function espresso_duplicate_plugin_error() |
|
47 | + { |
|
48 | + ?> |
|
49 | 49 | <div class="error"> |
50 | 50 | <p> |
51 | 51 | <?php |
52 | - echo esc_html__( |
|
53 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | - 'event_espresso' |
|
55 | - ); ?> |
|
52 | + echo esc_html__( |
|
53 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | + 'event_espresso' |
|
55 | + ); ?> |
|
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | - } |
|
61 | - } |
|
62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | + } |
|
61 | + } |
|
62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
63 | 63 | } else { |
64 | - define('EE_MIN_PHP_VER_REQUIRED', '7.2.0'); |
|
65 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | - /** |
|
67 | - * espresso_minimum_php_version_error |
|
68 | - * |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - function espresso_minimum_php_version_error() |
|
72 | - { |
|
73 | - ?> |
|
64 | + define('EE_MIN_PHP_VER_REQUIRED', '7.2.0'); |
|
65 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | + /** |
|
67 | + * espresso_minimum_php_version_error |
|
68 | + * |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + function espresso_minimum_php_version_error() |
|
72 | + { |
|
73 | + ?> |
|
74 | 74 | <div class="error"> |
75 | 75 | <p> |
76 | 76 | <?php |
77 | - printf( |
|
78 | - esc_html__( |
|
79 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | - 'event_espresso' |
|
81 | - ), |
|
82 | - EE_MIN_PHP_VER_REQUIRED, |
|
83 | - PHP_VERSION, |
|
84 | - '<br/>', |
|
85 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | - ); |
|
87 | - ?> |
|
77 | + printf( |
|
78 | + esc_html__( |
|
79 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | + 'event_espresso' |
|
81 | + ), |
|
82 | + EE_MIN_PHP_VER_REQUIRED, |
|
83 | + PHP_VERSION, |
|
84 | + '<br/>', |
|
85 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | + ); |
|
87 | + ?> |
|
88 | 88 | </p> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | - } |
|
91 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | + } |
|
93 | 93 | |
94 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | - } else { |
|
96 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | - /** |
|
98 | - * espresso_version |
|
99 | - * Returns the plugin version |
|
100 | - * |
|
101 | - * @return string |
|
102 | - */ |
|
103 | - function espresso_version() |
|
104 | - { |
|
105 | - return apply_filters('FHEE__espresso__espresso_version', '4.10.41.rc.001'); |
|
106 | - } |
|
94 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | + } else { |
|
96 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | + /** |
|
98 | + * espresso_version |
|
99 | + * Returns the plugin version |
|
100 | + * |
|
101 | + * @return string |
|
102 | + */ |
|
103 | + function espresso_version() |
|
104 | + { |
|
105 | + return apply_filters('FHEE__espresso__espresso_version', '4.10.41.rc.001'); |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * espresso_plugin_activation |
|
110 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | - */ |
|
112 | - function espresso_plugin_activation() |
|
113 | - { |
|
114 | - update_option('ee_espresso_activation', true); |
|
115 | - } |
|
108 | + /** |
|
109 | + * espresso_plugin_activation |
|
110 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | + */ |
|
112 | + function espresso_plugin_activation() |
|
113 | + { |
|
114 | + update_option('ee_espresso_activation', true); |
|
115 | + } |
|
116 | 116 | |
117 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
117 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
118 | 118 | |
119 | - require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | - bootstrap_espresso(); |
|
121 | - } |
|
119 | + require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | + bootstrap_espresso(); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | if (! function_exists('espresso_deactivate_plugin')) { |
124 | - /** |
|
125 | - * deactivate_plugin |
|
126 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | - * |
|
128 | - * @access public |
|
129 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | - * @return void |
|
131 | - */ |
|
132 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | - { |
|
134 | - if (! function_exists('deactivate_plugins')) { |
|
135 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | - } |
|
137 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | - deactivate_plugins($plugin_basename); |
|
139 | - } |
|
124 | + /** |
|
125 | + * deactivate_plugin |
|
126 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | + * |
|
128 | + * @access public |
|
129 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | + * @return void |
|
131 | + */ |
|
132 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | + { |
|
134 | + if (! function_exists('deactivate_plugins')) { |
|
135 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | + } |
|
137 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | + deactivate_plugins($plugin_basename); |
|
139 | + } |
|
140 | 140 | } |
141 | 141 | \ No newline at end of file |