admin管理员组

文章数量:1323714

I am customizing a multisite installation of Wordpress, and I want to replace this text.

Site names can only contain lowercase letters (a-z) and numbers.

Problem is that this is in the core of Wordpress and I cannot find any hook for it? Do you have any idea on how to edit this with PHP? Or do I have to use some kind of CSS text replacement?

Thank you in advance!

The error appears under the blogname-field

I am customizing a multisite installation of Wordpress, and I want to replace this text.

Site names can only contain lowercase letters (a-z) and numbers.

Problem is that this is in the core of Wordpress and I cannot find any hook for it? Do you have any idea on how to edit this with PHP? Or do I have to use some kind of CSS text replacement?

Thank you in advance!

The error appears under the blogname-field

Share Improve this question asked Sep 10, 2020 at 13:42 jockebqjockebq 4631 gold badge6 silver badges18 bronze badges 1
  • What are you trying to change it to and why? – Tom J Nowell Commented Sep 10, 2020 at 14:05
Add a comment  | 

1 Answer 1

Reset to default 0

I actually managed to chage it with this:

function replace_registration_site_name_error( $translated_text, $text, $domain ) {
$default = 'Site names can only contain lowercase letters (a-z) and numbers.';
if ( $translated_text == $default ) {
    $translated_text = __( 'Test', 'my_text_domain' );
}
return $translated_text;
}

This works great. However I am not able to change these two strings with this method?

Site name must be at least %s character.
Site name must be at least %s characters.

Anyone know why?

本文标签: Replace form field error text