I try to translate post types names (Post, Page and Attachment).
I have the following code:
function create_skip_post_types_box () {
$post_types = get_post_types(array('public'=>true), 'names' );
$opt = $this->_get_option();
$skip_types = is_array(@$opt['skip_post_types']) ? @$opt['skip_post_types'] : array();
foreach ($post_types as $tid=>$type) {
$checked = in_array($type, $skip_types) ? 'checked="checked"' : '';
echo
"<input type='hidden' name='wdpv[skip_post_types][{$type}]' value='0' />" . // Override for checkbox
"<input {$checked} type='checkbox' name='wdpv[skip_post_types][{$type}]' id='skip_post_types-{$tid}' value='{$type}' /> " .
"<label for='skip_post_types-{$tid}'>" . ucfirst($type) . "</label>" .
"<br />";
}
}
I tried to use ucfirst(__($type,'textdomain')) but it didn't work.
I know that for user roles we can use translate_user_role function, but what about post types?
Thank you!