Friday, February 17, 2012

Rename Set Featured Image in Wordpress

Posts in Wordpress can have their own featured image when enabled.
Now, here's a way to modify both the 'Featured Image' title and the 'Set Featured Image' link text.

Just add the follwing code to your theme's functions.php

function customizeFeaturedImageLinkTitle( $content ) {
  return $content = str_replace( __('Set featured image'), __('Set DefaultMessage image'), $content);
}

function customizeFeaturedImageTitle($translated) {
  return str_ireplace('Featured Image', 'DefaultMessage Image', $translated);
}

add_filter('gettext','catalogph_customizeFeaturedImageTitle');
add_filter('ngettext','catalogph_customizeFeaturedImageTitle');