Protected_Categories extends Plugin_Integration implements Registerable
Protected Categories Plugin Integration.
Tags
Interfaces, Classes and Traits
- Registerable
Table of Contents
- $plugin_class : string
- The main plugin class to check for existence.
- $plugin_function : string
- The main plugin function to check for existence.
- hide_protected_choices() : array<string|int, mixed>
- Hide protected product choices from filter options.
- hide_protected_products() : array<string|int, mixed>
- Hide protected products from the results.
- plugin_is_enabled() : bool
- Check if the plugin is enabled.
- register() : void
- Register the integration.
Properties
$plugin_class
The main plugin class to check for existence.
protected
string
$plugin_class
= ''
$plugin_function
The main plugin function to check for existence.
protected
string
$plugin_function
= '\\Barn2\\Plugin\\WC_Protected_Categories\\wpc'
Methods
hide_protected_choices()
Hide protected product choices from filter options.
public
hide_protected_choices(array<string|int, mixed> $choices, Query $query) : array<string|int, mixed>
Parameters
- $choices : array<string|int, mixed>
-
The filter choices to filter.
- $query : Query
-
The query object.
Return values
array<string|int, mixed> —The filtered choices.
hide_protected_products()
Hide protected products from the results.
public
hide_protected_products(array<string|int, mixed> $products, Query $query) : array<string|int, mixed>
Parameters
- $products : array<string|int, mixed>
-
The products to filter.
- $query : Query
-
The query object.
Return values
array<string|int, mixed> —The filtered products.
plugin_is_enabled()
Check if the plugin is enabled.
public
plugin_is_enabled() : bool
Return values
bool —register()
Register the integration.
public
register() : void