post_excerpt_meta_box() WordPress Function

The post_excerpt_meta_box() function allows you to add a meta box to the post editor screen for adding an excerpt to a post. This is useful for posts that are too long for the main content area and need to be summarized.

post_excerpt_meta_box( WP_Post $post ) #

Displays post excerpt form fields.


Parameters

$post

(WP_Post)(Required)Current post object.


Top ↑

Source

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

function post_excerpt_meta_box( $post ) {
	?>
<label class="screen-reader-text" for="excerpt"><?php _e( 'Excerpt' ); ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
<p>
	<?php
	printf(
		/* translators: %s: Documentation URL. */
		__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
		__( 'https://wordpress.org/support/article/excerpt/' )
	);
	?>
</p>
	<?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.