WordPress Comments — Visual Hook Guide

webroomtech.com
Feb 22, 2020

--

If you have enabled the build-in comments section in your WordPress site and want to modify it, you’ve come to the right place. Customizing the WordPress comments form is easy with the corresponding WordPress comments form hooks. You can add different content before or after the comments form or even after the form fields and above the Post comment button.

This visual guide for the WordPress comment form hooks will help you easily understand and find the right spot to add your custom content.

WordPress Comments — Visual Hook Guide

1. If the user is NOT logged in
The following hooks are available when the user is not logged in and is allowed to comment on the post and the comments are not closed:

See the WordPress comments visual hooks guide in the original article here.

2. If the user is logged in
If you are logged in, there are fewer hooks available since the name, email and website fields are not needed. The following hooks are not available when the user is logged in:

  • form_comment_before_fields
  • form_comment_after fields

3. User is not logged and “Users must be registered and logged in to comment” is activated
All unregistered users will see the following comment form with an additional hook: comment_form_must_log_in_after.

See the WordPress comments visual hooks guide in the original article here.

WordPress Comments Hooks

Here is a sum of the total seven WordPress comments hooks:

  1. comment_form_before
  2. comment_form_top
  3. comment_form_before_fields
  4. comment_form_after_fields
  5. comment_form
  6. comment_form_must_log_in_after
  7. comment_form_after

Learn more about Comments in WordPress.

Originally published at https://www.webroom.tech on February 22, 2020.

--

--

webroomtech.com
0 Followers

webroom.tech is created and written with one purpose: to help anyone developing their awesome WordPress and WooCommerce website.