Skip to content

Instantly share code, notes, and snippets.

@sillybean sillybean/functions.php
Last active Aug 1, 2017

Embed
What would you like to do?
Change post excerpt meta box title and contents
<?php
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>
<p><?php
_e( 'The plain text summary will appear on archive pages (e.g. lists of posts by category) and in search results.' );
?></p>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.