Add editable_slug filter. Props nbachiyski. see #6915

git-svn-id: http://svn.automattic.com/wordpress/trunk@7896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-05 17:08:13 +00:00
parent 742f09dbc7
commit 0b05038ebb
4 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ if ( ! empty($cat_ID) ) {
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->slug); ?>" size="40" /><br />
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
</tr>
<tr class="form-field">

View File

@ -30,7 +30,7 @@ if ( ! empty($cat_ID) ) {
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
<td><input name="slug" id="slug" type="text" value="<?php echo $category->slug; ?>" size="40" />
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" />
<?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
</tr>
<tr class="form-field">

View File

@ -31,7 +31,7 @@ if ( ! empty($tag_ID) ) {
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape($tag->slug); ?>" size="40" />
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
</tr>
</table>

View File

@ -627,7 +627,7 @@ function get_sample_permalink($id, $title=null, $name = null) {
$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
}
$permalink = array($permalink, $post->post_name);
$permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
$post->post_status = $original_status;
$post->post_date = $original_date;
$post->post_name = $original_name;