I’ve got a password protected post and comments_popup_link('No Comments', '1 Comment', '% Comments');
function displays “ENTER YOUR PASSWORD TO VIEW COMMENTS.” message. The question is, is it possible to change this message without touching core files, maybe apply filter or something like that. Thanks.
Leave a Reply
You must be logged in to post a comment.
The only hook to change that is
gettext
:Unfortunately, this is rather expensive:
gettext
is called many, many times, and the filter will run each time. You cannot deactivate it after the first match, because it might be needed more than once per page. I have added a wrapper function to make sure it is running only when there is a global$post
object.