fauzanjeg

Translate some Text

Oct 26th, 2021 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. /* Change some Text */
  2. function change_some_text( $translated_text ) {
  3.     switch ( $translated_text ) {
  4.         case 'Load More':
  5.             $translated_text = __( 'Load More Translated' );
  6.             break;
  7.         case 'Read more':
  8.             $translated_text = __( 'Read More Translated' );
  9.             break;
  10.         /* Breadcrumb Section */
  11.         case 'Home':
  12.             $translated_text = __( 'Home Translated' );
  13.             break;
  14.         case 'Category':
  15.             $translated_text = __( 'Category Translated' );
  16.             break;
  17.         /* Comments Section */
  18.         case 'Leave a Reply':
  19.             $translated_text = __( 'Leave a Reply Translated' );
  20.             break;
  21.         case 'You must <a href=\"%s\">log in</a> to post a comment.':
  22.             $translated_text = __( 'You must <a href=\"%s\">log in</a> to post a comment. Translated' );
  23.             break;
  24.     }
  25.  
  26.     return $translated_text;
  27. }
  28. add_filter( 'gettext', 'change_some_text', 20, 1 );
Add Comment
Please, Sign In to add comment