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

Age Gate, version 3.7.3. 44 lines.

- Page: https://pluginprobe.com/plugins/age-gate/3.7.3/code/src/Integration/Woof.php
- Raw: https://pluginprobe.com/plugins/age-gate/3.7.3/raw/src/Integration/Woof.php
- Modified: 2025-06-10T12:21:14+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/Woof.php#L10-L20`.

```php
<?php

namespace AgeGate\Integration;

use AgeGate\Common\Integration;

class Woof extends Integration
{
    public function exists()
    {
        return class_exists('WOOF');
    }

    public function init()
    {
        if ($this->exists()) {

            add_filter('age_gate/init/content', function($content) {
                global $WOOF;

                if (!$WOOF instanceof \WOOF) {
                    return $content;
                }

                if (method_exists($WOOF, 'get_really_current_term') && $term = $WOOF->get_really_current_term()) {
                    // dd($term);
                    $content = new \AgeGate\Common\Content($term, 'term');
                } elseif ($WOOF->is_isset_in_request_data($WOOF->get_swoof_search_slug())) {
                    global $wp_query;

                    if (($wp_query->query_vars['taxonomy'] ?? false) && ($wp_query->query_vars['term'] ?? false)) {

                        if ($term = get_term_by('slug', $wp_query->query_vars['term'], $wp_query->query_vars['taxonomy'])) {
                            $content = new \AgeGate\Common\Content($term, 'term');
                        }
                    }
                }

                return $content;
            });
        }
    }
}

```
