本文整理汇总了PHP中MS_Controller_Plugin::is_page方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Controller_Plugin::is_page方法的具体用法?PHP MS_Controller_Plugin::is_page怎么用?PHP MS_Controller_Plugin::is_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MS_Controller_Plugin
的用法示例。
在下文中一共展示了MS_Controller_Plugin::is_page方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_active_tab
/**
* Get the current active settings page/tab.
*
* @since 1.0.0
*/
public function get_active_tab()
{
if (null === $this->active_tab) {
if (!MS_Controller_Plugin::is_page('settings')) {
$this->active_tab = '';
} else {
$tabs = $this->get_tabs();
reset($tabs);
$first_key = key($tabs);
// Setup navigation tabs.
lib3()->array->equip_get('tab');
$active_tab = sanitize_html_class($_GET['tab'], $first_key);
if (!array_key_exists($active_tab, $tabs)) {
$new_url = esc_url_raw(add_query_arg(array('tab' => $first_key)));
wp_safe_redirect($new_url);
exit;
} else {
$this->active_tab = apply_filters('ms_controller_settings_get_active_tab', $active_tab);
}
}
}
return apply_filters('ms_controller_settings_get_active_tab', $this->active_tab, $this);
}
示例2: route_submenu_request
/**
* Handles all sub-menu clicks. We check if the menu item of our add-on was
* clicked and if it was we display the correct page.
*
* The $handler value is ONLY changed when the current menu is displayed.
* If another menu item was clicked then don't do anythign here!
*
* @since 1.0.0
* @param array $handler {
* Menu-item handling information.
*
* 0 .. any|network|site The admin-area that can handle our menu item.
* 1 .. callable A callback to handle the menu item.
* @return array Menu-item handling information.
*/
public function route_submenu_request($handler)
{
if (MS_Controller_Plugin::is_page(self::SLUG)) {
$handler = array('network', array($this, 'admin_coupon'));
}
return $handler;
}