Skip to content

Instantly share code, notes, and snippets.

Last active Aug 1, 2017
What would you like to do?
Change post excerpt meta box title and contents
remove_meta_box( 'postexcerpt', 'post', 'side' );
// use original box:
// add_meta_box('postexcerpt', __( 'Plain Text Summary' ), 'post_excerpt_meta_box', 'post', 'normal', 'high');
// replace box altogether:
add_meta_box( 'postexcerpt', __( 'Plain Text Summary' ), 'custom_post_excerpt_meta_box', 'post', 'normal', 'high' );
function custom_post_excerpt_meta_box( $post ) {
<label class="screen-reader-text" for="excerpt"><?php _e( 'Plain Text Summary' ) ?></label>
<textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
_e( 'The plain text summary will appear on archive pages (e.g. lists of posts by category) and in search results.' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment