Function __global->has_post_access
Definitions
sources/cns_posts.php
- Find whether a member can access a particular 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 | Post ID |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | Member involved (null: current member) |
| $post_details | ?array | No | No | Null | N/A | N/A | Post row (null: lookup) |
Returns
- Whether they can
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find whether a member can access a particular post.
*
* @param AUTO_LINK $post_id Post ID
* @param ?MEMBER $member_id Member involved (null: current member)
* @param ?array $post_details Post row (null: lookup)
* @return boolean Whether they can
*/
function has_post_access(int $post_id, ?int $member_id = null, ?array $post_details = null) : bool
* Find whether a member can access a particular post.
*
* @param AUTO_LINK $post_id Post ID
* @param ?MEMBER $member_id Member involved (null: current member)
* @param ?array $post_details Post row (null: lookup)
* @return boolean Whether they can
*/
function has_post_access(int $post_id, ?int $member_id = null, ?array $post_details = null) : bool

