How to alter the text of the post “Excerpt” box label in WordPress post editor?

My theme gives the site owner the option of using each post’s “Excerpt” field to fill in the “meta description” tag for each page.

It would be helpful if I can filter the text label and description text that appears on the default Excerpt input control when viewed inside the post editor.

Does a filter or hook exist for this?

Alternately, I suppose I could use jQuery to do something via the DOM.

3 Answers
3

there is a filter hook you can use and it is gettext
here:

add_filter( 'gettext', 'wpse22764_gettext', 10, 2 );
function wpse22764_gettext( $translation, $original )
{
    if ( 'Excerpt' == $original ) {
        return 'My Excerpt label';
    }else{
        $pos = strpos($original, 'Excerpts are optional hand-crafted summaries of your');
        if ($pos !== false) {
            return  'My Excerpt description';
        }
    }
    return $translation;
}

Leave a Comment