wordpress - PHP string with link inside

I have this Wordpress function:
function register_text( $translated ) {
$translated = str_ireplace('Register', 'REGISTER', $translated);
return $translated;
}
add_filter( 'gettext', 'register_text' );
add_filter( 'ngettext', 'register_text' );
I would like for "REGISTER" to be<a href="#register"></a> REGISTER
The question would be I guess: how to add html inside that string.
Thank you and sorry if this is too obvious. Total php newbie here
Answer
Solution:
function register_text( $translated ) {
$translated = str_ireplace('Register', '<a href="#register"></a> REGISTER', $translated);
return $translated;
}
Seems that you call the filter function from insidehtmlspecialchar()
thath render the login box also. Check the login template .
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: foreach() argument must be of type array|object, null given
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.