Support » Plugins » Hacks » How to translate widget title

  • Add following code in theme’s functions.php:

    function translate_title($title) {
     return __($title);
    }
    add_filter('widget_title', translate_title);

    If custom widget does not react to this filter, shall suggest this feature for next release or hack it in widget.php:

    function widget($args, $instance) {
     // add this before echoing title
     $instance['title'] = apply_filters('widget_title', $instance['title']);
    }

  • The topic ‘How to translate widget title’ is closed to new replies.