WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Google Analytics for WordPress] custom code text code shows slashes (includes fix)

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

  • 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.'"/>';
    		}

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

  • The topic ‘[Plugin: Google Analytics for WordPress] custom code text code shows slashes (includes fix)’ is closed to new replies.