Skip to content

Commit

Permalink
main bootstrapping callback can be anonymous function
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jan 29, 2025
1 parent 64d337c commit 16fb0ec
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions mailchimp-for-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,13 @@
// Prevent direct file access
defined('ABSPATH') or exit;




/** @ignore */
function _mc4wp_load_plugin()
{
// bootstrap main plugin
add_action('plugins_loaded', function () {
global $mc4wp;

// don't run if Mailchimp for WP Pro 2.x is activated
if (defined('MC4WP_VERSION')) {
return;
}

// don't run if PHP version is lower than 7.4.0
if (PHP_VERSION_ID < 70400) {
if (defined('MC4WP_VERSION') || PHP_VERSION_ID < 70400) {
return;
}

Expand Down Expand Up @@ -101,10 +93,7 @@ function _mc4wp_load_plugin()

// bootstrap integrations
require __DIR__ . '/integrations/bootstrap.php';
}

// bootstrap main plugin
add_action('plugins_loaded', '_mc4wp_load_plugin', 8);
}, 8);

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

0 comments on commit 16fb0ec

Please sign in to comment.