Abilities
Registers the shared Contextual Related Posts abilities.
Namespace: WebberZone\Contextual_Related_Posts
Since: 4.5.0
Source: includes/class-abilities.php line 22
Methods
__construct()
Register ability hooks.
Since: 4.5.0
Line: 29
public function __construct( );
register_category()
Register the WebberZone ability category if it is not already present.
Since: 4.5.0
Line: 44
public function register_category( ): void;
Returns: void
register_abilities()
Register the shared abilities.
Since: 4.5.0
Line: 63
public function register_abilities( ): void;
Returns: void
can_get_related_posts()
Check whether the current user can read the source post through the REST API.
Since: 4.5.0
Line: 150
public function can_get_related_posts( $input ): bool;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: bool — Whether the source post is readable.
get_related_posts()
Get related posts for a readable source post.
Since: 4.5.0
Line: 173
public function get_related_posts( $input ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Related posts or an error.