post_slug_meta_box() WordPress Function

The post_slug_meta_box() function is used to display a meta box on the post editing screen. This meta box allows you to specify a custom slug for the post.

post_slug_meta_box( WP_Post $post ) #

Displays slug form fields.


Parameters

$post

(WP_Post)(Required)Current post object.


Top ↑

Source

File: wp-admin/includes/meta-boxes.php

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 _e( 'Slug' ); ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
	<?php
}


Top ↑

Changelog

Changelog
VersionDescription
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.