This is how I’ve handled passing messages back to the user before: within your current function, set a transient with your message:
set_transient( 'admin_notice', 'Please put down your weapon. You have 20 seconds to comply.' );
Then add a new hooked function:
function admin_notices() {
$notice = get_transient( 'admin_notice' );
if ( $notice ) {
echo '<div class="error"><p>' . $notice . '</p></div>';
delete_transient( 'admin_notice' );
}
}
add_action( 'admin_notices', 'admin_notices' );
Related Posts:
- How to rearrange fields in comment_form()
- Removing the “Website” Field from Comments and Replies?
- How to add a class to the comment submit button?
- How to wrap submit button of comment form with div
- Resetting comment count
- comments reply script not working
- How do I set up real anonymous posting in bbpress forums? [closed]
- How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?
- Using filter to add additional fields to comment_form()
- Why are default comments deprecated?
- Comments Reply Form
- Programmatically block commenting by restricting view of comment form
- Custom Field Added In Comment Form Not Showing In Edit
- Add a drop down list to comment form?
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Making a Comment on a page without being on that page?
- customize comment form
- How to save new comment as custom comment type?
- How to modify comments form using comment_form()?
- How to add consent checkbox in comment section
- How to add enctype to multipart/form-data to comment form?
- Changing position of cancel_comment_reply_link and other elements of comment form
- Publish a message on facebook after having posted a comment
- Share comment to twitter after publishing [closed]
- Disable comments
- Why is_wp_error() is not returning false even there’s no defined error
- How to add attributes to the comment form tag?
- Comment form connection to Gravity Forms
- Auto-fill Custom comment fields
- Change order of comment fields
- How to call my custom WordPress Comment form without getting the comments?
- Problems with comments callback (Argument #1 is not an array?)
- Create comments.php form of custom HTML code
- How can I test why the comment hook is not working?
- How can I convert anonymous commenters into registered users?
- comment_post action hook running on page load instead of after a comment is posted
- Add class to comment form div when comment-reply button is clicked
- To whom do emails get sent via the WordPress comments form?
- blank page after submitting a comment
- Display complete comment section via post ID
- Notification if Comment Author Field is left empty. E.g. change input border colour
- Assign author to comment from post edit page
- How to retain comment text on comment form after login/registration?
- Check if comment was successfully submited
- Ajax submit comments
- Why could my comment_form variable not be working?
- Display avatar with comment form?
- anyone can help me to know whats going wrong? [closed]
- How to make comments private for commentor and post author
- Name of comment field differs on different sites
- Add comment_meta to wp_comment_reply
- Get comment id of the individual comments in comment list when modifying comment posted using comment text filter
- How can I embed comments plugin to my own website?
- Custom comment field not showing when logged-in
- get_comment_meta not behaving as expected
- unsetting required fields in the comment reply form
- Comment form in wordpress theme returns a javascript alert
- Clicking Comment “Reply” Button only replies to first comment
- How to filter comments by comment_meta
- Changing the Comment Fields using Filter (without success)
- Cannot Remove Title Reply from Custom Comment Template for Signup Page
- comment just attachment .. reply just text … can I do that?
- Custom sort comments with select form
- Same comment section on every page
- Update post “A” on comment submition on post “B”
- How to display replies to his comments in user profile of current user
- reply comment below the comment box without reload page
- Force to show all fields in comment forms to the logged-in users
- Top rated posts Average rating issue
- Author name length character limit?
- Check if comment author has url
- How to make comment reply available only for login members of a certain user roles only?
- How to call out the date of user’s first comment?
- Comment form not working
- How to pass settings to comment_form() if theme only uses comments_template()?
- edit comments in front end
- How to replace anonymous comment form with a registration form on wordpress?
- How to add a class to comment submit button?
- WordPress Commenting System User access and Security
- Comments.php is not getting called on main blog page
- How to enable truly anonymous posting in bbPress forums? [closed]
- Comment section not appearing on posts
- reply to comment excerpt instead of author in comment title
- Adding restrictions to open comments
- wp-editor-area textarea disapear on cancel-comment-reply-link click
- Comment form – different title if no comment yet
- Display Comment Form on dedicated Page for each post
- WordPress Comments jQuery Doesn’t submit
- Insert comment and still use moderation
- Need an advice about comments
- Actual comments not showing, but form is?
- add field comment [duplicate]
- How to remove or customize “Comment” in comments form?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- Clicking Comment “Reply” Button only replies to first comment
- Merge comments from Facebook with WP comments [closed]
- Why default comment fields don’t show up?
- How to enable truly anonymous posting in bbPress forums? [closed]
- Replace Entire Comment Box with Text
- How to hide and disable URL and email fields from comments?