Automattic\WooCommerce\Admin\Features\Navigation
Screen::add_screen()
Adds a screen ID to the list of screens that use the navigtion. Finds the parent if none is given to grab the correct screen ID.
Method of the class: Screen{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = Screen::add_screen( $callback, $parent );
- $callback(string) (required)
- Callback or URL for page.
- $parent(string|null)
- Parent screen ID.
Default: null
Screen::add_screen() Screen::add screen code WC 8.7.0
public static function add_screen( $callback, $parent = null ) { global $submenu; $plugin_page = self::get_plugin_page( $callback ); if ( ! $parent ) { $parent = Menu::get_parent_key( $callback ); } $screen_id = get_plugin_page_hookname( $plugin_page, $parent ); // This screen has already been added. if ( in_array( $screen_id, self::$screen_ids, true ) ) { return; } self::$screen_ids[] = $screen_id; }