'capability_here'
* To add a page to the network admin (wp-admin/network), use: 'network_admin_menu' => 'capability_here'
* To add a page to the user (wp-admin/user) admin, use: 'user_admin_menu' => 'capability_here'
*
* @since 2.0.0
* @var array
*/
protected $supported_panels = array(
'network_admin_menu' => 'capability_here',
);
/**
* Allow child classes to register widgets, if they need them.
*
* @since 1.8.2
* @return void
*/
public function register_widgets() {
add_meta_box(
'wp-ultimo-debug-pages',
__('All Registered Pages', 'wp-ultimo'),
array($this, 'render_debug_pages'),
get_current_screen()->id,
'normal',
null
);
}
/**
* Renders the list of WP Multisite WaaS registered pages.
*
* @since 2.0.0
* @return void
*/
public function render_debug_pages() {
$pages = Debug::get_instance()->get_pages();
echo '
';
foreach ($pages as $page_id => $url) {
printf(
'
-
%s
',
$url,
$page_id
);
}
echo '
';
}
/**
* Returns the title of the page.
*
* @since 2.0.0
* @return string Title of the page.
*/
public function get_title() {
return __('Registered Pages', 'wp-ultimo');
}
/**
* Returns the title of menu for this page.
*
* @since 2.0.0
* @return string Menu label of the page.
*/
public function get_menu_title() {
return __('Registered Pages', 'wp-ultimo');
}
/**
* Allows admins to rename the sub-menu (first item) for a top-level page.
*
* @since 2.0.0
* @return string False to use the title menu or string with sub-menu title.
*/
public function get_submenu_title() {
return __('Registered Pages', 'wp-ultimo');
}
/**
* Every child class should implement the output method to display the contents of the page.
*
* @since 1.8.2
* @return void
*/
public function output() {
wu_get_template(
'base/dash',
array(
'page' => $this,
'screen' => get_current_screen(),
'has_full_position' => false,
)
);
}
}