Last active
August 1, 2017 16:35
-
-
Save stephanieleary/e96db15f0d8049a02cfc3af7c2d11f6e to your computer and use it in GitHub Desktop.
Change post excerpt meta box title and contents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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