当前位置: 首页>>代码示例>>PHP>>正文


PHP MS_Plugin::is_wizard方法代码示例

本文整理汇总了PHP中MS_Plugin::is_wizard方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Plugin::is_wizard方法的具体用法?PHP MS_Plugin::is_wizard怎么用?PHP MS_Plugin::is_wizard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MS_Plugin的用法示例。


在下文中一共展示了MS_Plugin::is_wizard方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_unprotected_node

 /**
  * Add 'Unprotected' node.
  *
  * @since  1.0.0
  *
  */
 private function add_unprotected_node()
 {
     global $wp_admin_bar;
     if (MS_Plugin::is_enabled()) {
         return;
     }
     if (MS_Plugin::is_wizard()) {
         return;
     }
     $link_url = MS_Controller_Plugin::get_admin_url('settings');
     $wp_admin_bar->add_node(apply_filters('ms_controller_adminbar_add_unprotected_node', array('id' => 'ms-unprotected', 'title' => __('Content Protection is disabled', 'membership2'), 'href' => $link_url, 'meta' => array('class' => 'ms-unprotected', 'title' => __('Content of this site is unprotected', 'membership2'), 'tabindex' => '1'))));
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:18,代码来源:class-ms-controller-adminbar.php

示例2: wizard_tracker

 /**
  * Track wizard step.
  *
  * Save current step.
  *
  * since 1.0.0
  *
  * @param string $step Optional. The step to save. Default to current step.
  * @param boolean $end_wizard Optional. Whether end the wizard mode.
  * @return string The current step.
  */
 public function wizard_tracker($step = null, $end_wizard = false)
 {
     $settings = MS_Plugin::instance()->settings;
     if (empty($step)) {
         $step = $this->get_step();
     }
     if (MS_Plugin::is_wizard()) {
         $settings->wizard_step = $step;
         if ($end_wizard) {
             $settings->initial_setup = false;
         }
         $settings->save();
     }
     do_action('ms_controller_membership_wizard_tracker', $step, $end_wizard, $settings, $this);
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:26,代码来源:class-ms-controller-membership.php

示例3: route_submenu_request

 /**
  * Handles all menu-items and calls the correct callback function.
  *
  * We introduce this routing function to monitor all menu-item calls so we
  * can make sure that network-wide protection loads the correct blog or
  * admin-area before displaing the page.
  *
  * This function will only handle submenu items of the Membership2 menu!
  *
  * @since  1.0.0
  */
 public function route_submenu_request()
 {
     global $submenu;
     $handler = null;
     $handle_it = false;
     if (!isset($_GET['page'])) {
         return;
     }
     if ($_GET['page'] === self::$base_slug) {
         $handle_it = true;
     } elseif (isset($submenu[self::$base_slug])) {
         foreach ($submenu[self::$base_slug] as $item) {
             if ($_GET['page'] === $item[2]) {
                 $handle_it = true;
                 break;
             }
         }
     }
     if (!$handle_it) {
         return;
     }
     if (MS_Plugin::is_wizard()) {
         $step_add = MS_Controller_Membership::STEP_ADD_NEW == MS_Plugin::instance()->settings->wizard_step;
         if (!$step_add || self::is_page('setup')) {
             $handler = array('any', array($this->controllers['membership'], 'admin_page_router'));
         } else {
             $handler = array('site', array($this->controllers['protection'], 'admin_page'));
         }
     } else {
         if (self::is_page('')) {
             $handler = array('network', array($this->controllers['membership'], 'admin_page_router'));
         } elseif (self::is_page('protection')) {
             $handler = array('site', array($this->controllers['protection'], 'admin_page'));
         } elseif (self::is_page('members')) {
             $handler = array('network', array($this->controllers['member'], 'admin_page'));
         } elseif (self::is_page('add-member')) {
             $handler = array('network', array($this->controllers['member'], 'admin_page_editor'));
         } elseif (self::is_page('addon')) {
             $handler = array('network', array($this->controllers['addon'], 'admin_page'));
         } elseif (self::is_page('settings')) {
             $handler = array('network', array($this->controllers['settings'], 'admin_page'));
         } elseif (self::is_page('help')) {
             $handler = array('any', array($this->controllers['help'], 'admin_page'));
         } elseif (self::is_page('billing')) {
             $handler = array('network', array($this->controllers['billing'], 'admin_page'));
         }
     }
     /**
      * Filter that allows Add-ons to add their own sub-menu handlers.
      *
      * @since  1.0.0
      */
     $handler = apply_filters('ms_route_submenu_request', $handler, $this);
     // Provide a fallback handler in case we could not identify the handler.
     if (!$handler) {
         $handler = array('network', array($this->controllers['membership'], 'membership_admin_page_router'));
     }
     // Handle the target attribute specified in $handler[0]
     if (MS_Plugin::is_network_wide() && 'any' != $handler[0]) {
         $redirect = false;
         $admin_script = 'admin.php?' . $_SERVER['QUERY_STRING'];
         if ('network' == $handler[0] && !is_network_admin()) {
             $redirect = network_admin_url($admin_script);
         } elseif ('site' == $handler[0] && is_network_admin()) {
             $redirect = admin_url($admin_script);
         }
         if ($redirect) {
             if (headers_sent()) {
                 echo '<script>location.href=' . json_encode($redirect) . ';</script>';
             } else {
                 wp_safe_redirect($redirect);
             }
             exit;
         }
     }
     $this->menu_handler = $handler;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:88,代码来源:class-ms-controller-plugin.php


注:本文中的MS_Plugin::is_wizard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。