This function does some ad replacement for transposh benefit

  • Unknown's avatar

    Hello,
    What’s this code for? What does it do?

    In transposh-translation-filter-for-wordpress/core/parser.php
    line 657 – 678

    /**
    * This function does some ad replacement for transposh benefit
    */
    function do_ad_switch() {
    if (isset($this->html->noise) && is_array($this->html->noise)) {
    foreach ($this->html->noise as $key => $value) {
    if (strpos($value, ‘google_ad_client’) !== false) {
    $publoc = strpos($value, ‘pub-‘);
    $sufloc = strpos($value, ‘”‘, $publoc);
    if (!$sufloc)
    $sufloc = strpos($value, “‘”, $publoc);
    echo $publoc . ‘ ‘ . $sufloc;
    if ($publoc && $sufloc)
    $this->html->noise[$key] = substr($value, 0, $publoc) . ‘pub-752……….76’ . substr($value, $sufloc);
    }
    }
    }
    // INS TAGS
    foreach ($this->html->find(‘ins’) as $e) {
    $e->{‘data-ad-client’} = ‘ca-pub-752……..76’;
    }
    }

  • Hi there,

    Looks like you’re in the wrong forum. It appears that you’re using the open source WordPress.org software and you need to seek help at these forums:

    https://wordpress.org/support/forums/

    These forums are for WordPress.com hosted sites only. If you want to know more about the differences between WordPress.com and WordPress.org you can read this document:

    WordPress.com vs. WordPress.org

  • The topic ‘This function does some ad replacement for transposh benefit’ is closed to new replies.