What is the cleanest way to display a text message beside the submit button like this in screen shot:
I am currently doing it by editing the file wp-includes/comment-template
line 1577
(wordpress 3.5)
before:
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>"
value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
after:
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>"
value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
(your message will only be visible after moderation)
I understand this is not the optimal way to do it, but what is the way to do it.
I prefer as a plugin, but editing a theme would be fine.
You should not edit the WordPress core files!
If you have
comment_id_fields()
in your comments template, like this:you might use:
and place it in
functions.php
in your current theme directory.Yes, you’re right, editing the core is not good. Here’s one way to do it:
You can add this to your theme’s functions.php or put it in a plugin if you want.
You can add the text from the file comments.php