Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change text in post excerpt metabox
<?php
/**
* Change text for the post excerpt
*
* @since 1.0.0
* @param string $translated_text
* @param string $text
* @param string $domain
* @return string
*/
function change_excerpt_name( $translated_text, $text, $domain ) {
if ( $_GET['post_type'] == 'promotions' ) {
switch ( $translated_text ) {
case 'Excerpt' :
$translated_text = 'Promotion Notes';
break;
case 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>' :
$translated_text = '';
break;
}
}
return $translated_text;
}
add_filter( 'gettext', 'change_excerpt_name', 20, 3 );
@richplane

This comment has been minimized.

Copy link

@richplane richplane commented Dec 15, 2016

That text is no longer correct. In the current version it's:
Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="https://codex.wordpress.org/Excerpt">Learn more about manual excerpts</a>.
-- the full stop is outside the link, there's no "target" attribute and Codex is on https.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment