The problem is most probably, that you don’t actually call the filter. WordPress does this not automatically for you.
If you want to create a custom filter you have to manually call apply_filters
, so that the added filters get executed:
function the_views($postID){
$count_key = 'views';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
$count = 0;
}
// use apply_filters to call the filter
return sprintf($count == 0 ? '%s View' : '%s à ¦¬à ¦¾à ¦°',
apply_filters('the_views', $count));
// better alternative: use the WordPress translation API:
//return sprintf(_n('%s View', '%s Views', $count),
//apply_filters('the_views', $count));
}
I have modified the code a bit so the digit “0” gets also translated/converted. I have also added a suggestion at the end to use the WP translation API. There’s a bit more effort required to translate it that way but it would bring some benefits (you could translate it to other languages without code-changes and the result would be proper pluralized).