Sorry, I don’t know why the checkbox is not visible on your site. This would require debugging your WordPress installation. If you use any kind of caching – disable that first to test if this changes anything. Also maybe another plugin dealing with comments as well may cause a conflict.
However – it is not possible at all to send emails without the checkbox. Only if people check the checkbox they will get e-mail-notification for replies.
I got it to work by editing wp-includes/comment-template.php which obviously is bad practice so I don’t intend to use this as a solution.
These are the changes:
L2481 I commented it out because wp_parse_args was overwriting the cren fields.
old:
$args = wp_parse_args( $args, apply_filters( ‘comment_form_defaults’, $defaults ) );
new:
// $args = wp_parse_args( $args, apply_filters( ‘comment_form_defaults’, $defaults ) );
L2484 I swapped the arguments because again this merge was overwriting cren fields.
old:
$args = array_merge( $defaults, $args );
new:
$args = array_merge( $args, $defaults );
I’m even more puzzled now because it seems the plugin is doing everything fine and that core WP code messes it up which isn’t possible because other people don’t have an issue.
This is more to give you an update and not so much as to expecting support. If you have ideas, very welcome of course.
Kind regards and thank you for your previous response.
-
This reply was modified 5 years, 7 months ago by
progonkpa.
-
This reply was modified 5 years, 7 months ago by
progonkpa.
Yes, editing the core code should never be done!
I believe there may be another plugin which causes problems here. My plugin uses the comment_form_default_fields hook (also see https://developer.ww.wp.xz.cn/reference/hooks/comment_form_default_fields/) to add the checkbox. If this does not work, then there is something wrong with your installation. I use the plugin on my own website as well and have no problems with the latest WordPress version.
Also see as an example: https://arnowelzel.de/en/the-art-of-code
That video was surprisingly entertaining 😀
I noticed now when I’m logged in as admin on the reading page (not edit UI), the checkbox is visible.
While as anonymous user, I see a checkbox talking about comment form cookies.
Does that ring a bell for you somewhere?
I confirmed it works on a fresh install.
A suggestion, perhaps it’s better to not nest the input and pull it up one level higher in the HTML because it fiddles with the default layout it seems.
View post on imgur.com
Kr,
I add the additional checkbox as a form field to the comment form – that’s the reason why the hook “comment_form_default_fields” exists (see https://developer.ww.wp.xz.cn/reference/hooks/comment_form_default_fields/). WordPress will then use that field when building the form output.
Also there is no “one level higher”, only hooks which add stuff to the comment form:
https://developer.ww.wp.xz.cn/reference/files/wp-includes/comment-template.php/
As I already mentioned: I believe you have some other plugin installed which causes a conflict. Or maybe the theme causes a problem here.
Edit:
“comment form cookies” sound like some other plugin which adds stuff to your site to prevent spam or so. My plugin does not set or require any special cookie. Maybe that other plugin also fiddles with the comment form fields if not logged in as a user.
-
This reply was modified 5 years, 7 months ago by
Arno Welzel.