<?php
if(isset($_POST['save']))
{
foreach($_POST as $key => $value)
{
if($key != 'save')
{
if(!$plugin->set_setting('google-analytics', $filter->add_filter('clean_input', $key), $filter->add_filter('clean_input', $value)))
{
++$error;
}
}
}
if($error == 0)
{
header("location: ?plugin=google-analytics&saved=0");
exit;
}
else
{
header("location: ?plugin=google-analytics&saved=1");
exit;
}
}
?>
<form method="post">
<fieldset id="id">
<legend>Google Analytics Tracking ID - eg: UA-xxxxxx-x</legend>
<div class="container">
<div class="nest">
<input type="text" name="id" value="<?=$plugin->get_setting('google-analytics', 'id')?>"/>
</div>
</div>
</fieldset>
<p>Note: For the Google Analytics plugin to work the theme you are using must have a footer hook.</p>
<div id="save">
<button type="submit" class="save" name="save">Save</button>
<div id="loading"><img src="images/spinner.gif" alt="loading"/></div>
</div>
</form>