Screen
in package
Contains logic for the WooCommerce Navigation menu.
Table of Contents
- $instance : Screen
- Class instance.
- $post_types : array<string|int, mixed>
- Registered post types.
- $screen_ids : array<string|int, mixed>
- Screen IDs of registered pages.
- $taxonomies : array<string|int, mixed>
- Registered taxonomies.
- add_body_class() : string
- Add navigation classes to body.
- add_screen() : mixed
- Adds a screen ID to the list of screens that use the navigtion.
- get_plugin_page() : string
- Get the plugin page slug.
- get_post_types() : mixed
- Returns an array of registered post types.
- get_screen_ids() : mixed
- Returns an array of filtered screen ids.
- get_taxonomies() : mixed
- Returns an array of registered post types.
- init() : mixed
- Init.
- instance() : mixed
- Get class instance.
- is_woocommerce_core_taxonomy() : bool
- Check if a given taxonomy is a WooCommerce core related taxonomy.
- is_woocommerce_page() : bool
- Check if we're on a WooCommerce page
- register_post_type() : mixed
- Register post type for use in WooCommerce Navigation screens.
- register_taxonomy() : mixed
- Register taxonomy for use in WooCommerce Navigation screens.
Properties
$instance
Class instance.
protected
static Screen
$instance
= null
$post_types
Registered post types.
protected
static array<string|int, mixed>
$post_types
= array()
$screen_ids
Screen IDs of registered pages.
protected
static array<string|int, mixed>
$screen_ids
= array()
$taxonomies
Registered taxonomies.
protected
static array<string|int, mixed>
$taxonomies
= array()
Methods
add_body_class()
Add navigation classes to body.
public
add_body_class(string $classes) : string
Parameters
- $classes : string
-
Classes.
Return values
string —add_screen()
Adds a screen ID to the list of screens that use the navigtion.
public
static add_screen(string $callback[, string|null $parent = null ]) : mixed
Finds the parent if none is given to grab the correct screen ID.
Parameters
- $callback : string
-
Callback or URL for page.
- $parent : string|null = null
-
Parent screen ID.
Return values
mixed —get_plugin_page()
Get the plugin page slug.
public
static get_plugin_page(string $callback) : string
Parameters
- $callback : string
-
Callback.
Return values
string —get_post_types()
Returns an array of registered post types.
public
static get_post_types() : mixed
Return values
mixed —get_screen_ids()
Returns an array of filtered screen ids.
public
static get_screen_ids() : mixed
Return values
mixed —get_taxonomies()
Returns an array of registered post types.
public
static get_taxonomies() : mixed
Return values
mixed —init()
Init.
public
init() : mixed
Return values
mixed —instance()
Get class instance.
public
final static instance() : mixed
Return values
mixed —is_woocommerce_core_taxonomy()
Check if a given taxonomy is a WooCommerce core related taxonomy.
public
static is_woocommerce_core_taxonomy(string $taxonomy) : bool
Parameters
- $taxonomy : string
-
Taxonomy.
Return values
bool —is_woocommerce_page()
Check if we're on a WooCommerce page
public
static is_woocommerce_page() : bool
Return values
bool —register_post_type()
Register post type for use in WooCommerce Navigation screens.
public
static register_post_type(string $post_type) : mixed
Parameters
- $post_type : string
-
Post type to add.
Return values
mixed —register_taxonomy()
Register taxonomy for use in WooCommerce Navigation screens.
public
static register_taxonomy(string $taxonomy) : mixed
Parameters
- $taxonomy : string
-
Taxonomy to add.