Changes in trunk/wp-admin/options-permalink.php [3373:4197]
- File:
-
- 1 edited
-
trunk/wp-admin/options-permalink.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-permalink.php
r3373 r4197 42 42 var aInputs = document.getElementsByTagName('input'); 43 43 44 for (var i = 0; i < aInputs.length; i++) { 44 for (var i = 0; i < aInputs.length; i++) { 45 45 aInputs[i].onclick = aInputs[i].onkeyup = upit; 46 46 } … … 58 58 $home_path = get_home_path(); 59 59 60 if ( isset($_POST) ) { 60 if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { 61 check_admin_referer('update-permalink'); 62 61 63 if ( isset($_POST['permalink_structure']) ) { 62 64 $permalink_structure = $_POST['permalink_structure']; … … 65 67 $wp_rewrite->set_permalink_structure($permalink_structure); 66 68 } 67 69 68 70 if ( isset($_POST['category_base']) ) { 69 71 $category_base = $_POST['category_base']; … … 73 75 } 74 76 } 75 76 $permalink_structure = get_ settings('permalink_structure');77 $category_base = get_ settings('category_base');77 78 $permalink_structure = get_option('permalink_structure'); 79 $category_base = get_option('category_base'); 78 80 79 81 if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) … … 101 103 <div class="wrap"> 102 104 <h2><?php _e('Customize Permalink Structure') ?></h2> 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> 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 »') ?>" /></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> 104 109 105 110 <?php … … 115 120 ); 116 121 ?> 117 <form name="form" action="options-permalink.php" method="post">118 122 <h3><?php _e('Common options:'); ?></h3> 119 123 <p> 120 124 <label> 121 125 <input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> /> 122 <?php _e('Default'); ?><br /> <span> » <code><?php echo get_ settings('home'); ?>/?p=123</code></span>126 <?php _e('Default'); ?><br /> <span> » <code><?php echo get_option('home'); ?>/?p=123</code></span> 123 127 </label> 124 128 </p> … … 126 130 <label> 127 131 <input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> /> 128 <?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_ settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span>132 <?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_option('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span> 129 133 </label> 130 134 </p> … … 132 136 <label> 133 137 <input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> /> 134 <?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_ settings('home') . $prefix ; ?>/archives/123</code></span>138 <?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_option('home') . $prefix ; ?>/archives/123</code></span> 135 139 </label> 136 140 </p> … … 142 146 <?php } ?> 143 147 /> 144 <?php _e('Custom, specify below'); ?> 148 <?php _e('Custom, specify below'); ?> 145 149 </label> 146 150 <br /> 147 151 </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>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> 149 153 150 154 <h3><?php _e('Optional'); ?></h3> 151 155 <?php if ($is_apache) : ?> 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>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> 153 157 <?php else : ?> 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>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> 155 159 <?php endif; ?> 156 160 <p> 157 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" />161 <?php _e('Category base'); ?>: <input name="category_base" type="text" class="code" value="<?php echo wp_specialchars($category_base, 1); ?>" size="30" /> 158 162 </p> 159 163 <p class="submit"> … … 164 168 <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’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> 165 169 <form action="options-permalink.php" method="post"> 170 <?php wp_nonce_field('update-permalink') ?> 166 171 <p> 167 172 <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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)