Site logo

Archived topic

Where to add a 'filter' snippet?

7 replies · Started by Martin on March 26, 2022

Viewing posts 1–8 of 8

Sorry if this is a numpty question but where can I add this (to change the title of comments form):

add_filter( 'generate_comment_form_title', function() {
    return 'What do others say';
} );

Thanks.

Thought I would update this as I realised the filter mentioned above relates to the 'comments title' (where the submitted comments are displayed). What I want to change is 'Leave a Comment'.

And what I also what to do is allow Feedback but not display the feedback on the posts as they are purely for admin reference and serve no purpose to public viewers.

Thanks.

Found it:

add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
    return 'Join the conversation';
}

And to not show comments on the front-end I've simply made them require approval.

I'll leave this here in case anyone else find it useful.

Thanks David.

Is there a hook or filter that allows me to ensure no comments are displayed on posts even though we allow comments to be submitted?

Just to be clear - you want to keep the Comment Form but not display the Comments ?

Yes. That's correct.
If I rely on comments staying 'unapproved' someone might approve a comment (which I'm not actually using as 'comments' - they are related to business).
If one gets 'approved' I don't want it to be visible.

This archived topic is closed to new replies.