fewbricks\fewbricks::construct PHP Method

construct() public static method

public static construct ( )
    public static function construct()
    {
        self::init_messages();
        // Only perform requirement checks in admin system.
        // If any requirements are not met, this should be discovered by devs before pushing to production so let's save
        // some CPU cycles on the frontend by not running all these checks there.
        if (is_admin()) {
            // Check that crucial requirements are checked
            if (self::acf_exists() && self::fewbricks_hidden_exists() && self::fewbricks_template_dir_exists()) {
                // We have to deal with checking if hidden field is activated in a special way.
                // This is because we can not check if class exists since ACF will init the class when its needed and
                // the fewbricks_hidden_exists-function used above only makes sure that the files exists, not if the
                // plugin really is activated.
                self::add_fewbricks_hidden_activated_check();
                // We are not 100% sure that Fewbricks Hidden is activated here but let's do this anyways
                // an have the activated_check-function display a message to the user if Fewbricks Hidden is not
                // active.
                self::init();
            }
        } else {
            // Not in admin system, so assume that all is good.
            self::init();
        }
    }