Advertisement
kkarpieszuk

another way to register widget's title and text

Jul 7th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. // this part
  3. $title = apply_filters( 'widget_title', $instance['title'] );
  4.         $content = apply_filters( 'widget_content', $instance['content'] );
  5.  
  6. // change into
  7.  
  8. $title = icl_t( 'my_plugin_name','my_widget_title', $instance['title'] );
  9. $content = icl_t( 'my_plugin_name', 'my_widget_content', $instance['content'] );
  10.  
  11. // in wp-admin > widgets confirgure this widget and visit at least once front end page which displays widget.
  12. // after that go to wpml > st
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement