Howdy!
I’m continuing to tell you about Stella API. Today we will be looking at post thumbnails.

Localization of custom post thumbnails

If you have more than one post thumbnail ( for example using “Multiple Post Thumbnails” plugin) localize it with stella_translate_custom_thumbnail function.

Usage

 stella_translate_custom_thumbnail( $label, $id, $post_http://theme.fm/?p=4673&preview=truetype );

Parameters

$label
The name of the post thumbnail to display in the admin metabox

$id
Used to build the CSS class for the admin meta box. Must be the same as in thumbnail, which will be localized

$post_type
The post type to register this thumbnail for. Must be the same as in thumbnail, which will be localized

Example

Using “Multiple Post Thumbnails” plugin you must already have something like this:

 if (class_exists('MultiPostThumbnails')) {
    new MultiPostThumbnails( array( 'label' => 'Really big image', 'id' => 'really-big-image', 'post_type' => 'post', ) );
} 

Ok, now tell Stella to localize it:
Add this code to your functions.php:


add_action( 'stella_parameters', 'stella_functions', 1 );
function stella_functions(){
    stella_translate_custom_thumbnail( 'Really big image', 'really-big-image', 'post' );
}

 
NOTE: use ‘stella_init’ action instead ‘stella_parametres’ since Stella 1.3 version.

Thanks for your interest in Stella. Please, don’t be shy and leave comments on what else you want to localize. Stay tuned, goodbye!