Function __global->cns_delete_posts_topic
Definitions
sources/cns_posts_action3.php
- Delete posts from a topic.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $topic_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the topic we're deleting posts from |
| $posts | array | No | No | required parameter | N/A | N/A | A list of posts to delete |
| $reason | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | The reason for this action |
| $check_perms | boolean | No | No | True | N/A | N/A | Whether to check permissions |
| $cleanup | boolean | No | No | True | N/A | N/A | Whether to do a cleanup: delete the topic if there will be no posts left in it |
| $save_revision | boolean | No | No | True | N/A | N/A | Whether to save a revision |
| $reverse_point_transactions | boolean | No | No | True | N/A | N/A | Whether to also reverse any relevant point transactions for deleted posts |
Returns
- Whether the topic was deleted, due to all posts in said topic being deleted
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Delete posts from a topic.
*
* @param AUTO_LINK $topic_id The ID of the topic we're deleting posts from
* @param array $posts A list of posts to delete
* @param LONG_TEXT $reason The reason for this action
* @param boolean $check_perms Whether to check permissions
* @param boolean $cleanup Whether to do a cleanup: delete the topic if there will be no posts left in it
* @param boolean $save_revision Whether to save a revision
* @param boolean $reverse_point_transactions Whether to also reverse any relevant point transactions for deleted posts
* @return boolean Whether the topic was deleted, due to all posts in said topic being deleted
*/
function cns_delete_posts_topic(int $topic_id, array $posts, string $reason = '', bool $check_perms = true, bool $cleanup = true, bool $save_revision = true, bool $reverse_point_transactions = true) : bool
* Delete posts from a topic.
*
* @param AUTO_LINK $topic_id The ID of the topic we're deleting posts from
* @param array $posts A list of posts to delete
* @param LONG_TEXT $reason The reason for this action
* @param boolean $check_perms Whether to check permissions
* @param boolean $cleanup Whether to do a cleanup: delete the topic if there will be no posts left in it
* @param boolean $save_revision Whether to save a revision
* @param boolean $reverse_point_transactions Whether to also reverse any relevant point transactions for deleted posts
* @return boolean Whether the topic was deleted, due to all posts in said topic being deleted
*/
function cns_delete_posts_topic(int $topic_id, array $posts, string $reason = '', bool $check_perms = true, bool $cleanup = true, bool $save_revision = true, bool $reverse_point_transactions = true) : bool
