Pages::connect_page( array $options = array() )
Connect an existing page to wp-admin.
Contents
Parameters
- $options
-
(array) (Optional) Array describing the page.
- 'id'
(string) Id to reference the page. - 'title'
(string|array) Page title. Used in menus and breadcrumbs. - 'parent'
(string|null) Parent ID. Null for new top level page. - 'path'
(string) Path for this page. E.g. admin.php?page=wc-settings&tab=checkout - 'capability'
(string) Capability needed to access the page. - 'icon'
(string) Icon. Dashicons helper class, base64-encoded SVG, or 'none'. - 'position'
(int) Menu item position.
Default value: array()
- 'id'
Source
File: src/Tribe/Admin/Pages.php
public function connect_page( $options = [] ) { if ( ! is_array( $options['title'] ) ) { $options['title'] = array( $options['title'] ); } /** * Filter the options when connecting or registering a page. * * @param array $options { * Array describing the page. * * @type string id Id to reference the page. * @type string|array title Page title. Used in menus and breadcrumbs. * @type string|null parent Parent ID. Null for new top level page. * @type string screen_id The screen ID that represents the connected page. (Not required for registering). * @type string path Path for this page. E.g. admin.php?page=wc-settings&tab=checkout * @type string capability Capability needed to access the page. * @type string icon Icon. Dashicons helper class, base64-encoded SVG, or 'none'. * @type int position Menu item position. * @type boolean js_page If this is a JS-powered page. * } */ $options = apply_filters( 'tec_admin_pages_connect_page_options', $options ); $this->pages[ $options['id'] ] = $options; }
Changelog
Version | Description |
---|---|
4.15.0 | Introduced. |