Various cleanups.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ed915a5aab
commit
6f66293c21
|
@ -2,23 +2,6 @@
|
||||||
$title = 'Permalink Options';
|
$title = 'Permalink Options';
|
||||||
$parent_file = 'options-general.php';
|
$parent_file = 'options-general.php';
|
||||||
|
|
||||||
function add_magic_quotes($array) {
|
|
||||||
foreach ($array as $k => $v) {
|
|
||||||
if (is_array($v)) {
|
|
||||||
$array[$k] = add_magic_quotes($v);
|
|
||||||
} else {
|
|
||||||
$array[$k] = addslashes($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $array;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!get_magic_quotes_gpc()) {
|
|
||||||
$_GET = add_magic_quotes($_GET);
|
|
||||||
$_POST = add_magic_quotes($_POST);
|
|
||||||
$_COOKIE = add_magic_quotes($_COOKIE);
|
|
||||||
}
|
|
||||||
|
|
||||||
$wpvarstoreset = array('action','standalone', 'option_group_id');
|
$wpvarstoreset = array('action','standalone', 'option_group_id');
|
||||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
$wpvar = $wpvarstoreset[$i];
|
$wpvar = $wpvarstoreset[$i];
|
||||||
|
@ -35,9 +18,9 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once('optionhandler.php');
|
require_once('./optionhandler.php');
|
||||||
|
|
||||||
if ($_POST['Submit']) {
|
if ($_POST['submit']) {
|
||||||
update_option('permalink_structure', $_POST['permalink_structure']);
|
update_option('permalink_structure', $_POST['permalink_structure']);
|
||||||
$permalink_structure = $_POST['permalink_structure'];
|
$permalink_structure = $_POST['permalink_structure'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -49,11 +32,11 @@ switch($action) {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$standalone = 0;
|
$standalone = 0;
|
||||||
include_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
if ($user_level <= 6) {
|
if ($user_level <= 6) {
|
||||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||||
}
|
}
|
||||||
include('options-head.php');
|
require('./options-head.php');
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2>Edit Permalink Structure</h2>
|
<h2>Edit Permalink Structure</h2>
|
||||||
|
@ -62,7 +45,7 @@ default:
|
||||||
<li><code>%year%</code> --- The year of the post, 4 digits, for example <code>2004</code> </li>
|
<li><code>%year%</code> --- The year of the post, 4 digits, for example <code>2004</code> </li>
|
||||||
<li><code>%monthnum%</code> --- Month of the year, for example <code>05</code></li>
|
<li><code>%monthnum%</code> --- Month of the year, for example <code>05</code></li>
|
||||||
<li><code>%day% </code>--- Day of the month, for example <code>28</code></li>
|
<li><code>%day% </code>--- Day of the month, for example <code>28</code></li>
|
||||||
<li><code>%postname%</code> --- A sanitized version of the title of the post. So "This Is A Great Post!" becomes "<code>this-is-a-great-post</code>" in the URI </li>
|
<li><code>%postname%</code> --- A sanitized version of the title of the post. So “This Is A Great Post!” becomes “<code>this-is-a-great-post</code>” in the URI </li>
|
||||||
<li><code>%post_id%</code> --- The unique ID # of the post, for example <code>423</code> <strong></strong></li>
|
<li><code>%post_id%</code> --- The unique ID # of the post, for example <code>423</code> <strong></strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>So for example a value like:</p>
|
<p>So for example a value like:</p>
|
||||||
|
@ -75,10 +58,10 @@ default:
|
||||||
<form name="form" action="options-permalink.php" method="post">
|
<form name="form" action="options-permalink.php" method="post">
|
||||||
<p>Use the template tags above to create a virtual site structure:</p>
|
<p>Use the template tags above to create a virtual site structure:</p>
|
||||||
<p>
|
<p>
|
||||||
<input name="permalink_structure" type="text" style="width: 100%;" value="<?php echo $permalink_structure; ?>" />
|
<input name="permalink_structure" type="text" style="width: 98%;" value="<?php echo $permalink_structure; ?>" />
|
||||||
</p>
|
</p>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="Submit" value="Update Permalink Structure">
|
<input type="submit" name="submit" value="Update Permalink Structure">
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
@ -120,5 +103,5 @@ echo "</div>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
include("admin-footer.php")
|
require('./admin-footer.php');
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue