2

I'm trying to create a comment, using the Python library for WordPress's XMLRPC API, and set the comment's status to unapproved or "hold". But all comments insertions via the API seem to create approved comments.

  comment = WordPressComment()
  comment.content = body
  comment.status = 'hold'
  wp.call(NewComment(post_id, comment))

Is this parameter not supported on the create comments method?

Rob Flaherty
  • 1,055
  • 6
  • 16

1 Answers1

2

Answer: it's not directly possible by setting the status on the NewComment request.

But you can use the pre_comment_approved filter to define your own handler and add an unapproved status when the comment is inserted into the database.

Rob Flaherty
  • 1,055
  • 6
  • 16
  • 1
    It's also possible to [create custom methods](http://stackoverflow.com/a/25507463/1287812) and retrieve/set granular information. – brasofilo Aug 31 '14 at 22:59