Abilities
Registers the shared Knowledge Base abilities.
Namespace: WebberZone\Knowledge_Base
Since: 3.2.0
Source: includes/class-abilities.php line 22
Methods
__construct()
Constructor.
Since: 3.2.0
Line: 45
public function __construct( REST_Controller $rest_controller );
| Type | Name | Description |
|---|---|---|
REST_Controller |
$rest_controller |
REST controller. |
register_category()
Register the shared WebberZone ability category if it is not already present.
Since: 3.2.0
Line: 61
public function register_category( ): void;
Returns: void
register_abilities()
Register read-only Knowledge Base abilities.
Since: 3.2.0
Line: 80
public function register_abilities( ): void;
Returns: void
can_read_search()
Check whether the current user can read Knowledge Base content.
Since: 3.2.0
Line: 251
public function can_read_search( $input = ... ): bool;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: bool — Whether the current user can read.
can_read_sections()
Check whether the current user can read Knowledge Base sections.
Since: 3.2.0
Line: 265
public function can_read_sections( $input = ... ): bool;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: bool — Whether the current user can read sections.
search_articles()
Search published Knowledge Base articles.
Since: 3.2.0
Line: 279
public function search_articles( $input ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Search results or an error.
get_sections()
Get sections through the shared REST controller.
Since: 3.2.0
Line: 291
public function get_sections( $input ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Section tree or an error.