Function __global->cns_move_posts

Definitions

sources/cns_posts_action3.php

  • Move posts from one topic to another.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$from_topic_id AUTO_LINK No No required parameter N/A N/A The ID of the source topic
$to_topic_id ?AUTO_LINK No No required parameter N/A N/A The ID of the destination topic (null: move to new topic in $forum_id)
$posts array No No required parameter N/A N/A A list of post IDs to move
$reason LONG_TEXT No No required parameter N/A N/A The reason for this action
$to_forum_id ?AUTO_LINK No No Null N/A N/A The forum the destination topic is in (null: find from DB)
$delete_if_empty boolean No No False N/A N/A Whether to delete the topic if all posts in it have been moved
$title ?SHORT_TEXT No No Null N/A N/A The title for the new topic (null: work out / irrelevant)

Returns

  • Whether the topic was deleted
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Move posts from one topic to another.
 *
 * @param  AUTO_LINK $from_topic_id The ID of the source topic
 * @param  ?AUTO_LINK $to_topic_id The ID of the destination topic (null: move to new topic in $forum_id)
 * @param  array $posts A list of post IDs to move
 * @param  LONG_TEXT $reason The reason for this action
 * @param  ?AUTO_LINK $to_forum_id The forum the destination topic is in (null: find from DB)
 * @param  boolean $delete_if_empty Whether to delete the topic if all posts in it have been moved
 * @param  ?SHORT_TEXT $title The title for the new topic (null: work out / irrelevant)
 * @return boolean Whether the topic was deleted
 */

function cns_move_posts(int $from_topic_id, ?int $to_topic_id, array $posts, string $reason, ?int $to_forum_id = null, bool $delete_if_empty = false, ?string $title = null) : bool