# age-gate/3.7.3/src/Integration/Divi.php

Age Gate, version 3.7.3. 59 lines.

- Page: https://pluginprobe.com/plugins/age-gate/3.7.3/code/src/Integration/Divi.php
- Raw: https://pluginprobe.com/plugins/age-gate/3.7.3/raw/src/Integration/Divi.php
- Modified: 2025-03-27T08:14:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/age-gate/3.7.3/code/src/Integration/Divi.php#L10-L20`.

```php
<?php

namespace AgeGate\Integration;

use AgeGate\Common\Settings;
use AgeGate\Common\Integration;

class Divi extends Integration
{
    public function exists()
    {
        return function_exists('et_fb_is_enabled');
    }

    public function init()
    {
        if ($this->exists()) {
            // add_action('init', function () {
            if (isset($_GET['et_fb']) && current_user_can('edit_posts')) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
                Settings::getInstance()->set('isBuilder', true);
            }

            add_action('age_gate/before_render', [$this, 'pauseDiviCssCache']);

            // });
        }
    }

    public function pauseDiviCssCache()
    {
        $class = 'ET_Core_PageResource';

        // Output Location: head-early, right after theme styles have been enqueued.
        remove_action('wp_enqueue_scripts', [$class, 'head_early_output_cb'], 11);

        // Output Location: head, right BEFORE the theme and wp's custom css.
        remove_action('wp_head', [$class, 'head_output_cb'], 99);

        // Output Location: head-late, right AFTER the theme and wp's custom css.
        remove_action('wp_head', [$class, 'head_late_output_cb'], 103);

        // Output Location: footer
        remove_action('wp_footer', [$class, 'footer_output_cb'], 20);

        // Always delete cached resources for a post upon saving.
        remove_action('save_post', [$class, 'save_post_cb'], 10, 3);

        // Always delete cached resources for theme customizer upon saving.
        remove_action('customize_save_after', [$class, 'customize_save_after_cb']);

        // Add fallback callbacks (lol) to link/script tags
        remove_filter('style_loader_tag', [$class, 'link_and_script_tags_filter_cb'], 999, 2);

        remove_filter('wp_get_custom_css', 'et_epanel_handle_custom_css_output', 999, 2);

        add_action('wp_head', 'wp_custom_css_cb', 101);
    }
}

```
