AnonSec Team
Server IP : 10.131.40.8  /  Your IP : 216.73.216.37
Web Server : Apache
System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : ludmqhh ( 137773)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/ludmqhh/www/hotel-forum/wp-content/plugins/mailchimp-for-wp/integrations/give/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/ludmqhh/www/hotel-forum/wp-content/plugins/mailchimp-for-wp/integrations/give/class-give.php
<?php

defined('ABSPATH') or exit;

/**
 * @ignore
 */
class MC4WP_Give_Integration extends MC4WP_Integration
{
    public $name        = 'Give';
    public $description = 'Subscribes people from your Give donation forms.';
    public $shown       = false;

    public function add_hooks()
    {
        if (! $this->options['implicit']) {
            add_action('give_purchase_form_register_login_fields', [ $this, 'output_checkbox' ], 50);
        }

        add_action('give_checkout_before_gateway', [ $this, 'subscribe_from_give' ], 90, 2);
    }

    public function subscribe_from_give($posted, $user)
    {
        // was sign-up checkbox checked?
        if (true !== $this->triggered()) {
            return;
        }

        $merge_fields = [
            'EMAIL' => $user['email'],
        ];

        if (! empty($user['first_name'])) {
            $merge_fields['FNAME'] = $user['first_name'];
        }

        if (! empty($user['last_name'])) {
            $merge_fields['LNAME'] = $user['last_name'];
        }

        return $this->subscribe($merge_fields);
    }

    public function is_installed()
    {
        return defined('GIVE_VERSION');
    }
}

AnonSec - 2021