<?php
global $current_user;
$args = array(
'user_id' => $current_user->ID,
'post_id' = 100, // post ID. Can be '$post->ID' depending where you are calling this from
'count' => true
);
if(get_comments($args) >= 1){
echo 'disabled';
} else {
comment_form();
}
Function_Reference/get_comments
Based on AndrettiMilas code.
Related Posts:
- How do I comment out a block of tags in XML?
- Commenting in user profile page?
- How to enable comments for pending and draft posts?
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Reverse comment pagination numbers
- Show comments from multiple post IDs in comment template
- get recent comments of a particular category
- Whitelisting Commenters
- WP_Comment_Query() displays “password protected” comments?
- Add a custom class to awating comments
- How to add custom comment fields but *only on the comment reply form*?
- Is it possible to move a comment that should be a reply to another comment?
- Can I seperate comments from post?
- Show only posts which can be commented
- What should I hook to add extra fields to comments?
- Get a variable field of all comments of current post
- Average Score of all ratings in comments
- Making a Comment on a page without being on that page?
- Display commenter’s registration date on comments?
- How do I display the commentor’s first name and last name in the comments?
- show un-approved comments at wordpress front end
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, func
- How To Disable Comments On New Page
- What is the server IP comment hack
- How to add consent checkbox in comment section
- Do I have to have a nonce for a custom comment field?
- Get last seen date/time in wordpress get_comments() [closed]
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- How to get replies of a comment?
- Share comment to twitter after publishing [closed]
- changing comment-page-# to something like review-page-#
- Change username to nickname in comment section
- Comments deactivated
- List user comments in author page
- Filter custom posts with / without comments
- Create comments.php form of custom HTML code
- Display comments on homepage of twenty seventeen theme
- How to dynamic Heart Like in WordPress?
- Disqus comments and pingback script – how to change the order?
- To whom do emails get sent via the WordPress comments form?
- Comment Moderation and CDN Caching
- Comments feed – Undefined named entity: ndash
- Assign author to comment from post edit page
- The “\” is missing when comments is updated
- warnCommentChanges always being triggered on update
- how get comments only on post of current logged in user?
- How to get comment id in callback function?
- Posting comment returns 404
- How-To and Troubleshooting Canonical Links for Paginated Comments
- Get declared variable in single.php to work in comments.php without re-declaring it [closed]
- What is causing wp-comments-post.php to redirect to the browser’s IP address?
- Extra Title field for Comments
- Comments offset
- How to hide trackbacks on wp-admin/edit-comments.php
- Using a static callback on wp_insert_comment
- WordPress Recent Comments Widget exclude own comments
- How to prevent multiple comments
- Displaying comments on pages distinguished by GET IDs
- How to get comment images stored as serialized comment meta
- Hide comments on specific pages, not just disable future comments
- Is there a hook to update / replace values in the “Enable threaded (nested) comments x levels deep” drop down?
- Add comment_meta to wp_comment_reply
- How to change comment texts that has a specific comment_ID – Hook into comment
- How do comments work?
- Can’t reply to comments [closed]
- counting trackbacks, pingbacks and comments of a post
- ask and edit an extra comment field
- Modify links in user comments
- How indicate when a functions was upgraded in relationship to the entire program [closed]
- Empty comments field or
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- Default Gravatar not showing for pings
- How to filter comments by comment_meta
- Prevent users to delete comments from trash
- How can I hide comment of the authors from their published posts?
- How to customize ‘children comments’ in WordPress?
- How to display replies to his comments in user profile of current user
- Top rated posts Average rating issue
- stop url changing when user comments
- Keep comment author’s name on their comment even when their account is deleted
- Badges for Guests based on their comment counts [closed]
- 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
- Allowing comments on author pages
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- WordPress Comments – Only show part of user name
- Where is the Leave a Comment link set
- Broken comments section – WordPress 2014 Theme
- Need an advice about comments
- I want to fill the comment with the comment count?
- delete user not working
- By Default, Turn Comments Off for Pages & Leave Comments On for Posts
- same comment list for two posts
- Replace do_action() with a normal submit form in comments.php
- edit-comments.php in Admin – how to change ‘Comments’ title?
- Comments on pages not appearing, even though I enabled them
- Stop future commenting on specific post
- comment_approved custom value
- TinyMCE in comment reply form showing toolbar but can’t edit reply