WPCOM_VIP_Support_Role::update PHP Méthode

update() protected méthode

Checks the version option value against the version property value, and runs update routines as appropriate.
protected update ( )
    protected function update()
    {
        $option_name = 'vipsupportrole_version';
        $version = absint(get_option($option_name, 0));
        if ($version == self::VERSION) {
            return;
        }
        if ($version < 1 && function_exists('wpcom_vip_add_role')) {
            self::add_role();
            self::error_log("VIP Support Role: Added VIP Support role ");
        }
        // N.B. Remember to increment self::VERSION above when you add a new IF
        update_option($option_name, self::VERSION);
        $this->error_log("VIP Support Role: Done upgrade, now at version " . self::VERSION);
    }