Skip to content

Commit 16fb0ec

Browse files
main bootstrapping callback can be anonymous function
1 parent 64d337c commit 16fb0ec

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

mailchimp-for-wp.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,13 @@
3232
// Prevent direct file access
3333
defined('ABSPATH') or exit;
3434

35-
36-
37-
38-
/** @ignore */
39-
function _mc4wp_load_plugin()
40-
{
35+
// bootstrap main plugin
36+
add_action('plugins_loaded', function () {
4137
global $mc4wp;
4238

4339
// don't run if Mailchimp for WP Pro 2.x is activated
44-
if (defined('MC4WP_VERSION')) {
45-
return;
46-
}
47-
4840
// don't run if PHP version is lower than 7.4.0
49-
if (PHP_VERSION_ID < 70400) {
41+
if (defined('MC4WP_VERSION') || PHP_VERSION_ID < 70400) {
5042
return;
5143
}
5244

@@ -101,10 +93,7 @@ function _mc4wp_load_plugin()
10193

10294
// bootstrap integrations
10395
require __DIR__ . '/integrations/bootstrap.php';
104-
}
105-
106-
// bootstrap main plugin
107-
add_action('plugins_loaded', '_mc4wp_load_plugin', 8);
96+
}, 8);
10897

10998
// schedule the action hook to refresh the stored Mailchimp lists on a daily basis
11099
register_activation_hook(__FILE__, function () {

0 commit comments

Comments
 (0)