Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created November 22, 2012 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/4129442 to your computer and use it in GitHub Desktop.
Save jaredatch/4129442 to your computer and use it in GitHub Desktop.
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
Copy link

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