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
- What are these entries in the database? Looks similar to JSON
- WP showing “warning: call_user_func_array()”, What to do?
- How can I pass a variable to wp_ajax action?
- Should I global $wpdb outside of any of my plugin’s functions scope?
- How can i change an image’s author?
- WP-Members redirect if member ALREADY logged in
- Get a list of galleries from an album in NextGEN Gallery [closed]
- Leveraging WordPress Comments on Custom Plugin Object page
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to get member list based on role by using buddypress?
- get shortcode value
- Unable to create new database table upon plugin activation using dbDelta
- Storing Options in a Shortcode
- Add Product Subtitle to Woocommerce Product Page
- Not getting author rank when using return
- Plugins Page invisible / white
- Help With MySQL to WPDB Query Conversion
- code is working properly in Core PHP but writing coding in WordPress
- How can I fix the mixed content problems of the kk star ratings plugin?
- Basic Object Oriented plugin question
- How to remove traces from widget during uninstallation
- WordPress + PHP + IIS + PHP Fatal error: require():
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- Adding regex filter to feedwordpress
- Duplicate results are displayed in a custom plugin [closed]
- php code crashes site – possible syntax error
- Best/Correct way to add an option to a category
- Help with WP Business Directory Manager Plugin?
- I receive taxonomy id
- Is there a way to convert shortcodes to html content?
- Loop in elementor custom widget not working
- Change text string in a plugin
- get_users(); Is an Undefined Function When Used in Cron Job
- the_content() printing DOCTYPE, and tags in the middle of page
- How to change WooCommece variation data programmtically [closed]
- How to include files relative to a file’s directory
- .php file for woocommerce edit category? [closed]
- Asynchronous request in wordpress
- dynamically create callback functions inside a for loop
- Where do plugin variables live in the db?
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- How do I display PHP file contents on front end of WordPress?
- Can i stream data to a custom_post_type?
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- SimpleXML is not working with xml response from external api
- My wp database has been hacked
- No result after wpdb->insert
- Cannot pass variable to page definition
- How do I change tab url
- Disqus comments count taking long to update
- Things that saved lose when logout
- How to speed up installing plugins and upgrading WordPress
- Unfortunately removed myself as plugin committer
- PHP and Jquery pass value from form. Update function on DataBase
- Plugin use of ajax/jquery depending dropdown
- How to submit the custom form data in database in WordPress without plugin?
- Unable to show 4 products in a row
- Is it possible to recover Deleted users?
- WordPress portfolio pagination on home page
- Form with response button after on table after submission
- Warning: Undefined variable $admin
- public custom posts not showing in my wordpress plugin
- Can’t save formdata in DB