fauzanjeg

Translate Text in Specific Page || 404 Page

Nov 23rd, 2021 (edited)
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. /* Translate Text in Specific Page || 404 Page */
  2. function translate_text_in_404_page( $translation, $text, $domain ) {
  3.     if ( is_404() ) {
  4.         switch( $translation ) {
  5.             case 'Latest Articles':
  6.                 $translation = 'Latest Articles Edited';
  7.                 break;
  8.         }
  9.     }
  10.  
  11.     return $translation;
  12. }
  13. add_filter( 'gettext', 'translate_text_in_404_page', 10, 3 );
Add Comment
Please, Sign In to add comment