Function __global->cns_may_delete_post_by
Definitions
sources/cns_posts.php
- Find whether a member may delete the detailed post.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $post_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The post ID |
| $post_time | ?TIME | No | No | required parameter | N/A | N/A | The time of the post (null: lookup) |
| $resource_owner | ?MEMBER | No | No | required parameter | N/A | N/A | The owner of the post (null: lookup) |
| $forum_id | ?AUTO_LINK | No | No | required parameter | N/A | N/A | The forum the post is in (null: is a Private Topic, unless $post_time is null in which case we look this up too) |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member (null: current member) |
| $topic_is_closed | ?boolean | No | No | Null | N/A | N/A | Whether the topic the post is in is closed (null: don't consider this, maybe we're not considering any one specific case, unless $post_time is null in which case we look this up to) |
| &$reason | ?string | Yes | No | Null | N/A | N/A | The reason for the topic being closed is put here (null: no interesting reason) |
Returns
- The answer
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find whether a member may delete the detailed post.
*
* @param AUTO_LINK $post_id The post ID
* @param ?TIME $post_time The time of the post (null: lookup)
* @param ?MEMBER $resource_owner The owner of the post (null: lookup)
* @param ?AUTO_LINK $forum_id The forum the post is in (null: is a Private Topic, unless $post_time is null in which case we look this up too)
* @param ?MEMBER $member_id The member (null: current member)
* @param ?boolean $topic_is_closed Whether the topic the post is in is closed (null: don't consider this, maybe we're not considering any one specific case, unless $post_time is null in which case we look this up to)
* @param ?string $reason The reason for the topic being closed is put here (null: no interesting reason)
* @return boolean The answer
*/
function cns_may_delete_post_by(int $post_id, ?int $post_time, ?int $resource_owner, ?int $forum_id, ?int $member_id = null, ?bool $topic_is_closed = null, ?string &$reason = null) : bool
* Find whether a member may delete the detailed post.
*
* @param AUTO_LINK $post_id The post ID
* @param ?TIME $post_time The time of the post (null: lookup)
* @param ?MEMBER $resource_owner The owner of the post (null: lookup)
* @param ?AUTO_LINK $forum_id The forum the post is in (null: is a Private Topic, unless $post_time is null in which case we look this up too)
* @param ?MEMBER $member_id The member (null: current member)
* @param ?boolean $topic_is_closed Whether the topic the post is in is closed (null: don't consider this, maybe we're not considering any one specific case, unless $post_time is null in which case we look this up to)
* @param ?string $reason The reason for the topic being closed is put here (null: no interesting reason)
* @return boolean The answer
*/
function cns_may_delete_post_by(int $post_id, ?int $post_time, ?int $resource_owner, ?int $forum_id, ?int $member_id = null, ?bool $topic_is_closed = null, ?string &$reason = null) : bool
