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


PHP MS_Model_Membership::have_paid_membership方法代码示例

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


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

示例1: get_default_menu_pages

 /**
  * Returns the default admin menu items for Membership2.
  * Helper function used by add_menu_pages
  *
  * @since  1.0.0
  * @return array
  */
 private function get_default_menu_pages()
 {
     $show_billing = false;
     $pages = array('memberships' => array('title' => __('Memberships', 'membership2'), 'slug' => ''), 'protected-content' => array('title' => __('Protection Rules', 'membership2'), 'slug' => 'protection'), 'members' => array('title' => __('All Members', 'membership2'), 'slug' => 'members'), 'add-member' => array('title' => __('Add Member', 'membership2'), 'slug' => 'add-member'), 'billing' => false, 'addon' => array('title' => __('Add-ons', 'membership2'), 'slug' => 'addon'), 'settings' => array('title' => __('Settings', 'membership2'), 'slug' => 'settings'), 'help' => array('title' => __('Help', 'membership2'), 'slug' => 'help'));
     $show_billing = MS_Model_Membership::have_paid_membership();
     if ($show_billing) {
         $bill_count = MS_Model_Invoice::get_unpaid_invoice_count(null, true);
         if ($bill_count > 0) {
             $msg = '%1$s <span class="awaiting-mod count-%3$s"><span class="pending-count"><i class="hidden">(</i>%2$s<i class="hidden">)</i></span></span>';
         } else {
             $msg = '%1$s';
         }
         $pages['billing'] = array('title' => sprintf($msg, __('Billing', 'membership2'), $bill_count, sanitize_html_class($bill_count, '0')), 'slug' => 'billing');
         /*
          * This condition checks if the site has configured some payment
          * gateways - if not then users cannot sign up for a membership.
          * Show a notice if no payment gateway is configured/activated.
          */
         $gateways = MS_Model_Gateway::get_gateways(true);
         $payment_possible = false;
         foreach ($gateways as $key => $gateway) {
             if ('free' == $key) {
                 continue;
             }
             $payment_possible = true;
             break;
         }
         if (!$payment_possible) {
             lib3()->ui->admin_message(sprintf(__('Oops, looks like you did not activate a payment gateway yet.<br />You need to set up and activate at least one gateway, otherwise your members cannot sign up to a paid membership.<br />%sFix this now &raquo;%s', 'membership2'), '<a href="' . self::get_admin_url('settings', array('tab' => MS_Controller_Settings::TAB_PAYMENT)) . '">', '</a>'), 'err');
         }
     }
     return $pages;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:40,代码来源:class-ms-controller-plugin.php


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