Google Analytics by MonsterInsights
[Plugin: Google Analytics for WordPress] custom code text code shows slashes (includes fix) (1 post)

  1. sboisvert
    Posted 4 years ago #

    If you use the custom code box, you will most likely use code that includes '
    this is handled properly in the output of the plugin as there is a strip slashes there, the problem is that there is no strip slashes in the reshowing of that information in the plugin admin page. Therefore it will show up with slashes in the admin page. Therefore the next user comes along and if they don't understand that slahes need to be removed before saving whatever change they made, the custom code breaks.

    I've made this change to fix the problem, perhaps it is too wide sweeping or perhaps it solves other problems that others may be encountering in text fields.

    this replaces the whole function

    function textinput($id) {
    			$options = get_option( $this->optionname );
    			$val = '';
    			if ( isset( $options[$id] ) )
    				$val = stripslashes($options[$id]);
    			return '<input class="text" type="text" id="'.$id.'" name="'.$id.'" size="30" value="'.$val.'"/>';


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics by MonsterInsights
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.