Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-permalink.php

    r4197 r3373  
    4242var aInputs = document.getElementsByTagName('input');
    4343
    44 for (var i = 0; i < aInputs.length; i++) {
     44for (var i = 0; i < aInputs.length; i++) {     
    4545aInputs[i].onclick = aInputs[i].onkeyup = upit;
    4646}
     
    5858$home_path = get_home_path();
    5959
    60 if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
    61     check_admin_referer('update-permalink');
    62 
     60if ( isset($_POST) ) {
    6361    if ( isset($_POST['permalink_structure']) ) {
    6462        $permalink_structure = $_POST['permalink_structure'];
     
    6765        $wp_rewrite->set_permalink_structure($permalink_structure);
    6866    }
    69 
     67   
    7068    if ( isset($_POST['category_base']) ) {
    7169        $category_base = $_POST['category_base'];
     
    7573    }
    7674}
    77 
    78 $permalink_structure = get_option('permalink_structure');
    79 $category_base = get_option('category_base');
     75   
     76$permalink_structure = get_settings('permalink_structure');
     77$category_base = get_settings('category_base');
    8078
    8179if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') )
     
    103101<div class="wrap">
    104102  <h2><?php _e('Customize Permalink Structure') ?></h2>
    105 <form name="form" action="options-permalink.php" method="post">
    106 <?php wp_nonce_field('update-permalink') ?>
    107 <p class="submit"><input type="submit" name="submit" value="<?php _e('Update Permalink Structure &raquo;') ?>" /></p>
    108   <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
     103  <p><?php _e('By default WordPress uses web URIs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URI structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
    109104
    110105<?php
     
    120115    );
    121116?>
     117<form name="form" action="options-permalink.php" method="post">
    122118<h3><?php _e('Common options:'); ?></h3>
    123119<p>
    124120    <label>
    125121<input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> />
    126 <?php _e('Default'); ?><br /> <span> &raquo; <code><?php echo get_option('home'); ?>/?p=123</code></span>
     122<?php _e('Default'); ?><br /> <span> &raquo; <code><?php echo get_settings('home'); ?>/?p=123</code></span>
    127123   </label>
    128124</p>
     
    130126    <label>
    131127<input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> />
    132 <?php _e('Date and name based'); ?><br /> <span> &raquo; <code><?php echo get_option('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
     128<?php _e('Date and name based'); ?><br /> <span> &raquo; <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>
    133129   </label>
    134130</p>
     
    136132    <label>
    137133<input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> />
    138 <?php _e('Numeric'); ?><br /> <span> &raquo; <code><?php echo get_option('home') . $prefix  ; ?>/archives/123</code></span>
     134<?php _e('Numeric'); ?><br /> <span> &raquo; <code><?php echo get_settings('home') . $prefix  ; ?>/archives/123</code></span>
    139135   </label>
    140136</p>
     
    146142<?php } ?>
    147143 />
    148 <?php _e('Custom, specify below'); ?>
     144<?php _e('Custom, specify below'); ?>   
    149145</label>
    150146<br />
    151147</p>
    152 <p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo wp_specialchars($permalink_structure, 1); ?>" size="50" /></p>
     148<p id="customstructure"><?php _e('Custom structure'); ?>: <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo $permalink_structure; ?>" size="50" /></p>
    153149
    154150<h3><?php _e('Optional'); ?></h3>
    155151<?php if ($is_apache) : ?>
    156     <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
     152    <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
    157153<?php else : ?>
    158     <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
     154    <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p>
    159155<?php endif; ?>
    160156    <p>
    161   <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code"  value="<?php echo wp_specialchars($category_base, 1); ?>" size="30" />
     157  <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code"  value="<?php echo $category_base; ?>" size="30" />
    162158     </p>
    163159    <p class="submit">
     
    168164  <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Make_a_Directory_Writable">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
    169165<form action="options-permalink.php" method="post">
    170 <?php wp_nonce_field('update-permalink') ?>
    171166   <p>
    172167<textarea rows="5" style="width: 98%;" name="rules"><?php echo $wp_rewrite->mod_rewrite_rules(); ?>
Note: See TracChangeset for help on using the changeset viewer.