You could use get_comments()
, this way you don’t have to loop through posts.
<?php
$args = array(
'post_author' => '' // fill in post author ID
);
$author_comments = get_comments($args);
echo count($author_comments);
?>
Related Posts:
- How to properly insert data into custom table via plugin
- Simple form that saves to database
- How to store ACF custom fields data in a custom table
- Set a User as Author of all ‘New Posts’ posted
- Change destination author link
- Don’t send notification if author comments his own post plugin help?
- How to edit/delete single row items in a table on my own menu page
- Improving a Stackoverflow “inspired” badge system to display badges in author page
- How to write one comment and publish on every post using database or plugin?
- Make id column as AUTO INCREMENT on plugin activation
- How can I get WordPress to save comments in markdown format?
- How to access data in wordpress database externally using php
- Notify comment author upon reply
- Change get_current_user_id code to the author’s profile
- Creating a CSV with PHP inside the plugin directory
- Issue running db create table query from static method
- How to create plugin/ page that reads from database
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Individual Comment Notification Setting For Post Author
- Is this plugin safe to run?
- How to display results from a data table with an encrypted user id?
- add_action for publish_post doesn’t work
- Getting URL GET parameter with Code snippets and storing it in database?
- Display Author name PHP (Selfmade Plug-IN)
- Cant create table on plugin activation
- How to use WordPress header function and footer function and not load word press database
- Get Shortcode output to database for static post_content
- Moving a few select DB tables to a new WP instance
- How can I store user preferences in WordPress and retreive them later?
- How to get the total count of Favorite/Favorited authors
- Paginated Comments “reply” does not work!
- Displaying friend’s posts only
- How to save information related to post in database?
- How to fix vanilla comments extra iframe space
- Getting Post Permalink Outside of Loop Not Working
- plugin doesn’t retrieve data from database
- can not serialize and insert data from custom form
- How can you call to data in google sheet based on ID number?
- If I delete plugins via FTP are settings kept in DB?
- Get a list of galleries from an album in NextGEN Gallery [closed]
- How to install and activate a plugin via an external PHP script
- Override comments.php template with plugin
- how to include a simple jquery file into a wordpress plugin
- Calling a plugin in theme development
- Display a text message if the field is not found and not if found
- Unable to activate wordpress importer after installing it
- Reposition Woocommerce Message
- Leveraging WordPress Comments on Custom Plugin Object page
- greatest() function returns undefined property
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Display comments of users on single page
- How do you remove plugin edit option?
- Escape when echoed
- Scope for PHP Variables Assigned in functions.php or a plugin
- add_meta_box (Will display only in specific page admin WordPress)
- Make specific products accessible only to a user role in WooCommerce
- force customers to add only single item to card per purchase EDD [closed]
- Undefined property: WP_Post_Type::$ID
- Plugin exceeds memory limit
- How to get post URL in the_content filter?
- How to remove xmlns on language_attributes()?
- Add a plugin before main container
- Shortcode to generate and save password in a file
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to get member list based on role by using buddypress?
- I don’t understand how this parameter works..?
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- How to initialize something in unit test before the init hook being called?
- Is the wordpress user-model changed in wpmu?
- Function to prevent users from trashing comments
- Default Plugin Settings Not Writing to Database
- Creating Tables on Network Activation
- Missing argument 3 for wp_register_sidebar_widget()
- How to Include a Loop Template File in a Plugin
- Write to / remove from default .htaccess file from plugin?
- What kind of data is that?
- Update Option Error: Notice: Undefined index
- How can I display a contact form for out of stock products in WooCommerce?
- Pass a php string to a javascript variable
- get shortcode value
- Cannot login to ADMIN even after changing password in phpmyadmin
- How to get number of Affected rows from wordpress dbDelta() function
- Unable to create new database table upon plugin activation using dbDelta
- add_filter comment_edit_redirect not working
- Show price with Geo IP location
- Where to hook my plugin’s action
- WordPress Ajax Callback
- Add category to body class
- The called constructor method for WP_Widget in GFWidget is deprecated since version 4.3.0! Use
- Plugin Development sqlite or WordPress’ database
- How do you override the default comment template?
- How to review WordPress website php version compatibility?
- printf – problem to understand code
- Custom Post Type Plugin not loading category template and loading 404 instead
- Embed a Google Sheet as you view it in a separate tab?
- Sending email from inside a plugin using PHP PEAR
- Auto delete WordPress users according to time
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- How to change commenter links to /user/user_id?
- How to determine what is generating large amount of database queries?