WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
Remove extra whitespace from markup of tracked outbound lin (1 post)

  1. MK Safi
    Member
    Posted 3 years ago #

    The plugin was adding unnecessary whitespace to <a> markup of my site, like between the " and the > here:

    <a
    href="http://winkpress.com/privacy-policy/" >Privacy</a>

    Not a big deal I know, but because of my specific circumstances it was causing problems, so to remove the extra space, I modified lines 1042 and 1043 of googleanalytics.php to this:

    $matches[4] = ($matches[4] == ' ' || empty($matches[4])) ? '' : ' ' . trim($matches[4]);
    return '<a ' . $matches[1] . 'href="' . $matches[2] . '//' . $matches[3] . '"' . $matches[4] . '>' . $matches[5] . '</a>';

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by MK Safi
  • This topic is not a support question
  • WordPress version: 3.1