| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/xxxupdates.com/public_html/wp-content/plugins/age-gate/src/Presentation/ |
Upload File : |
<?php
namespace AgeGate\Presentation;
use AgeGate\Common\Content;
use AgeGate\Common\Settings;
class Title
{
private $settings;
private $content;
public function __construct(Content $content, Settings $settings)
{
$this->settings = $settings;
$this->content = $content;
if ($settings->method !== 'js' && $settings->switchTitle) {
add_filter('wpseo_title', [$this, 'returnPageTitle'], 1000, 1);
add_filter('rank_math/frontend/title', [$this, 'returnPageTitle'], 1000, 1);
add_filter('document_title_parts', [$this, 'changePageTitle'], 1000, 1);
add_filter('wp_title', [$this, 'changeDefaultTitle'], 10, 3);
}
}
public function getTitle()
{
return $this->settings->customTitle . ' - ' . get_bloginfo('name');
}
/**
* Change the page title for themes with theme_support
* for title-tag
*
* @return array
*/
public function changePageTitle($title = [])
{
if ($this->content->isRestricted()) {
return [
'title' => $this->settings->customTitle,
'site' => get_bloginfo('name'),
];
}
return $title;
}
/**
* Change the title for themes that
* do not support title tag
*
* @param string $title
* @param string $sep
* @param string $location
* @return string
*/
public function changeDefaultTitle($title, $sep, $location)
{
if ($this->content->isRestricted()) {
return $this->getTitle();
}
return $title;
}
/**
* Change the parts sent to Yoast or Think Math
*
* @return void
*/
public function returnPageTitle($title)
{
if ($this->content->isRestricted()) {
return $this->getTitle();
}
return $title;
}
}