Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31747 closed defect (bug) (fixed)

wp_insert_comment better docstrings

Reported by: lamosty's profile lamosty Owned by: drewapicture's profile DrewAPicture
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch
Focuses: docs Cc:


Function wp_insert_comment has incomplete docstring documentation. Its docstring says

The available comment data key names are 'comment_author_IP', 'comment_date',
'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'.

but the function accepts additional arguments through $commentdata assoc array, such as comment_type or comment_content.

Docstring could be enhanced to have a format like in the case of wp_insert_post function (=> argument type with a short description of what the argument does).

Attachments (2)

docs_update.31747.diff (2.5 KB) - added by lamosty 9 years ago.
Update docs of wp_insert_comment function
31747.patch (2.8 KB) - added by rachelbaker 9 years ago.
Minor formatting and description adjustments

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
9 years ago

  • Component changed from Text Changes to Comments

#2 @SergeyBiryukov
9 years ago

  • Keywords needs-patch added

9 years ago

Update docs of wp_insert_comment function

#3 @iseulde
9 years ago

  • Keywords has-patch added; needs-patch removed
  • Version trunk deleted

#4 @DrewAPicture
9 years ago

  • Owner set to DrewAPicture
  • Status changed from new to reviewing

9 years ago

Minor formatting and description adjustments

#5 @DrewAPicture
9 years ago

  • Milestone changed from Awaiting Review to 4.3
  • Type changed from enhancement to defect (bug)

#6 @DrewAPicture
9 years ago

In 32499:

Document the default arguments for wp_insert_comment() as a hash notation.

Props lamosty, rachelbaker.
See #31747.

#7 @DrewAPicture
9 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 32500:

Update the DocBlock for wp_new_comment() to reference the wp_insert_comment() documentation for argument information.

Fixes #31747.

Note: See TracTickets for help on using tickets.