Function __global->cns_delete_topic

Definitions

sources/cns_topics_action2.php

  • Delete a topic.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

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 to delete
$reason LONG_TEXT No No Blank (empty string) N/A N/A The reason for this action
$post_target_topic_id ?AUTO_LINK No No Null N/A N/A Where topic to move posts in this topic to (null: delete the posts)
$check_perms boolean No No True N/A N/A Whether to check permissions
$reverse_point_transaction boolean No No False N/A N/A Whether to reverse the point transactions associated with the posts in this topic (ignored if $post_target_topic_id is specified)

Returns

  • The forum ID the topic is in (could be found without calling the function, but as we've looked it up, it is worth keeping) (null: private topic)
  • Type: ?AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Delete a topic.
 *
 * @param  AUTO_LINK $topic_id The ID of the topic to delete
 * @param  LONG_TEXT $reason The reason for this action
 * @param  ?AUTO_LINK $post_target_topic_id Where topic to move posts in this topic to (null: delete the posts)
 * @param  boolean $check_perms Whether to check permissions
 * @param  boolean $reverse_point_transaction Whether to reverse the point transactions associated with the posts in this topic (ignored if $post_target_topic_id is specified)
 * @return ?AUTO_LINK The forum ID the topic is in (could be found without calling the function, but as we've looked it up, it is worth keeping) (null: private topic)
 */

function cns_delete_topic(int $topic_id, string $reason = '', ?int $post_target_topic_id = null, bool $check_perms = true, bool $reverse_point_transaction = false) : ?int