Last active
June 19, 2022 13:14
-
-
Save mattradford/a640c0af118c603ffdf24cf6d290c03c to your computer and use it in GitHub Desktop.
Translate the GeneratePress 404 page title using Polylang strings translation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Translate the GeneratePress 404 page title | |
* | |
* The string can be translated in Languages -> Strings translations | |
*/ | |
if ( function_exists( 'pll_register_string' ) ) { | |
function mattrad_404_text() { | |
$error_text = 'That page cannot be found'; | |
pll_register_string( '404', $error_text , 'text_domain'); | |
return pll__( $error_text ); | |
} | |
add_filter( 'generate_404_title', 'mattrad_404_text' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment