Comments
Create, update, delete, and query Comments associated with a post.
Table Specific Information
Select
The provider uses the WordPress API to process supported filters. The provider processes other filters client-side within the provider. You can turn off the client-side execution of the query by setting SupportEnhancedSQL to false in which case any search criteria that refers to other columns will cause inconsistent data. To retrieve and filter the values for AuthorEmail column, use context=edit in the WHERE clause.
For example, the following queries are processed server side.
SELECT * FROM Comments WHERE Id = 61 SELECT * FROM Comments WHERE Id IN (61, 45) SELECT * FROM Comments WHERE AuthorEmail = '[email protected]' AND Status = 'approve' AND Type = 'comment' AND PostId = '1' and context='edit'; SELECT * FROM Comments WHERE Author IN ('1', '2') SELECT * FROM Comments WHERE Date > '2018-02-02T02:02:23' SELECT * FROM Comments WHERE Date < '2018-02-02T02:02:23' SELECT * FROM Comments ORDER BY Date DESCAlso, ordering by Id, DateGMT, Type, Parent, is handled by the WordPress API.
Insert
To insert comments you must specify the following columns: PostId, Content.
INSERT INTO Comments (PostId, Content) VALUES ('1', 'This is a comment in the post with id 1.')
Update
To update a comment you must specify the following column: IdUPDATE Comments SET Content = 'Updated content' WHERE Id = '1234'Other fields that you can use on INSERT / UPDATE queries are: Author, AuthorEmail, AuthorIp, AuthorName, AuthorUrl, Content, Date, DateGMT, Parent, PostId, Status.
Delete
To delete a Comment you must specify the following column: Id.
DELETE FROM Comments WHERE Id = '1234'
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | Integer | True |
Unique identifier for the object. |
Author | Integer | False |
The ID of the user object, if author was a user. |
AuthorEmail | String | False |
Email address for the object author. To retrieve and filter the values for this column, use context=edit in the WHERE clause. |
AuthorIp | String | False |
IP address for the object author. To retrieve the values for this column, use context=edit in the WHERE clause. |
AuthorName | String | False |
Display name for the object author. |
AuthorUrl | String | False |
URL for the object author. |
Date | Datetime | False |
The date the object was published. |
DateGMT | Datetime | False |
The date the object was published as GMT. |
Status | String | False |
State of the object. The allowed values are hold, approved, spam, trash. |
Type | String | True |
Type of Comment for the object. |
Parent | Integer | False |
The ID for the parent of the object. |
Content | String | False |
The content for the object. |
PostId | Integer | False |
The ID of the associated post object. |
Link | String | True |
URL to the object. |
Pseudo-Columns
Name | Type | Description |
Context | String |
Scope under which the request is made; determines fields present in response. The allowed values are view, edit, embed. |