<?php

/********************************************************************************
 * This file was automatically generated by the version-loader-generator script
 * whenever the composer update command is run.
 *
 * WARNING: Do not modify this file directly. Your changes will be overwritten.
 *******************************************************************************/

namespace PublishPress\WordpressVersionNotices;

use function add_action;
use function do_action;

if (! function_exists('add_action')) {
    return;
}

if (! function_exists(__NAMESPACE__ . '\register2Dot2Dot1')) {
    if (! defined('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_INCLUDED')) {
        define('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_INCLUDED', __DIR__);
    }

    if (! class_exists('PublishPress\WordpressVersionNotices\Versions')) {
        require_once __DIR__ . '/Versions.php';

        add_action('plugins_loaded', [Versions::class, 'initializeLatestVersion'], -150, 0);
    }

    add_action('plugins_loaded', __NAMESPACE__ . '\register2Dot2Dot1', -190, 0);

    function register2Dot2Dot1()
    {
        if (! class_exists('PublishPress\WordpressVersionNotices\ServicesProvider')) {
            $versions = Versions::getInstance();
            $versions->register('2.2.1', __NAMESPACE__ . '\initialize2Dot2Dot1');
        }
    }

    function initialize2Dot2Dot1()
    {
        require_once __DIR__ . '/autoload.php';

        if (! defined('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_VERSION')) {
            define('PUBLISHPRESS_WORDPRESS_VERSION_NOTICES_VERSION', '2.2.1');
        }

        do_action('publishpress_wordpress_version_notices_2Dot2Dot1_initialized');
    }
}
