Displays slug form fields.
Parameters
$post
WP_Postrequired- Current post object.
Source
function post_slug_meta_box( $post ) {
/** This filter is documented in wp-admin/edit-tag-form.php */
$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
?>
<label class="screen-reader-text" for="post_name">
<?php
/* translators: Hidden accessibility text. */
_e( 'Slug' );
?>
</label><input name="post_name" type="text" class="large-text" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
<?php
}
Hooks
- apply_filters( ‘editable_slug’,
string $slug ,WP_Term|WP_Post $tag ) Filters the editable slug for a post or term.
Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.