WordPress allows us to define entries as private and protected . It’s as easy as choosing the visibility option in the post editor.
Now, we do not always like the default text or it is appropriate for our site, and if we do not want to completely change the translation file, we can easily modify those texts that precede these types of input.
As we already learned how to remove the Private and Protected legend , now we are going to learn how to modify it. All we have to do is the following …
Index of contents
Change the prefix «Private»
We add the following code to the functions.php
file of the active theme:
function change_private_title_prefix() { return 'Solo para suscriptores: %s'; } add_filter('private_title_format', 'change_private_title_prefix');
Change the prefix «Protected»
The same, we add this code to the functions.php
file of the theme that we have active:
function change_protected_title_prefix() { return 'Secreto: %s'; } add_filter('protected_title_format', 'change_protected_title_prefix');
Then you put the text that you like the most here too.
YOU MAY ALSO BE INTERESTED IN …
Did you like this article? You can’t imagine what you’re missing on YouTube !