WooCommerce Code Reference

Screen

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

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

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

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.

Return values
mixed