WordPress.org
  • News
  • Showcase
  • Hosting
    • Themes
    • Plugins
    • Patterns
    • Blocks
    • Openverse ↗︎
    • Learn WordPress
    • Documentation
    • Forums
    • Developers
    • WordPress.tv ↗︎
    • Make WordPress
    • Photo Directory
    • Five for the Future
    • Events
    • Job Board ↗︎
    • About WordPress
    • Enterprise
    • Gutenberg ↗︎
    • Swag Store ↗︎
  • Get WordPress
Get WordPress
WordPress.org

WordPress Developer Resources

wp_check_comment_data()

  • Developer Blog
  • Code Reference
  • WP-CLI Commands
  • Developer Blog
  • Code Reference
  • WP-CLI Commands
HomeReferenceFunctionswp_check_comment_data()

wp_check_comment_data( array $comment_data ): int|string|WP_Error

In this article

  • Parameters
  • Return
  • Source
  • Hooks
  • Related
  • Changelog

↑ Back to top

Checks whether comment data passes internal checks or has disallowed content.

Parameters

$comment_dataarrayrequired
Array of arguments for inserting a comment.

Return

int|string|WP_Error The approval status on success (0|1|'spam'|'trash'), WP_Error otherwise.