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


PHP SwpmUtils::get_paid_member_info方法代码示例

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


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

示例1: regigstration_ui

 public function regigstration_ui($level)
 {
     //Trigger the filter to override the registration form (the form builder addon uses this filter)
     $form = apply_filters('swpm_registration_form_override', '', $level);
     //The $level value could be empty also so the code handling the filter need to check for it.
     if (!empty($form)) {
         //An addon has overridden the registration form. So use that one.
         return $form;
     }
     $settings_configs = SwpmSettings::get_instance();
     $joinuspage_url = $settings_configs->get_value('join-us-page-url');
     $membership_level = '';
     global $wpdb;
     if (SwpmUtils::is_paid_registration()) {
         //Lets check if this is a registration for paid membership
         $member = SwpmUtils::get_paid_member_info();
         if (empty($member)) {
             SwpmUtils::e('Error! Invalid Request. Could not find a match for the given security code and the user ID.');
         } else {
             $membership_level = $member->membership_level;
         }
     } else {
         if (!empty($level)) {
             //Membership level is specified in the shortcode (level specific registration form).
             $member = SwpmTransfer::$default_fields;
             $membership_level = absint($level);
         }
     }
     //Check if free membership registration is disalbed on the site
     if (empty($membership_level)) {
         $joinuspage_link = '<a href="' . $joinuspage_url . '">Join us</a>';
         $free_rego_disabled_msg = '<p>';
         $free_rego_disabled_msg .= SwpmUtils::_('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.');
         $free_rego_disabled_msg .= '</p><p>';
         $free_rego_disabled_msg .= SwpmUtils::_('You will receive a unique link via email after the payment. You will be able to use that link to complete the premium membership registration.');
         $free_rego_disabled_msg .= '</p>';
         return $free_rego_disabled_msg;
     }
     //Handle the registration form in core plugin
     $mebership_info = SwpmPermission::get_instance($membership_level);
     $membership_level = $mebership_info->get('id');
     if (empty($membership_level)) {
         return "Error! Failed to retrieve membership level ID from the membership info object.";
     }
     $level_identifier = md5($membership_level);
     $membership_level_alias = $mebership_info->get('alias');
     $swpm_registration_submit = filter_input(INPUT_POST, 'swpm_registration_submit');
     if (!empty($swpm_registration_submit)) {
         $member = array_map('sanitize_text_field', $_POST);
     }
     ob_start();
     extract((array) $member, EXTR_SKIP);
     include SIMPLE_WP_MEMBERSHIP_PATH . 'views/add.php';
     return ob_get_clean();
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:55,代码来源:class.swpm-front-registration.php

示例2: regigstration_ui

 public function regigstration_ui($level)
 {
     $form = apply_filters('swpm_registration_form_override', '', $level);
     if (!empty($form)) {
         return $form;
     }
     $settings_configs = SwpmSettings::get_instance();
     $joinuspage_url = $settings_configs->get_value('join-us-page-url');
     $membership_level = '';
     global $wpdb;
     if (SwpmUtils::is_paid_registration()) {
         //Lets check if this is a registration for paid membership
         $member = SwpmUtils::get_paid_member_info();
         if (empty($member)) {
             SwpmUtils::e('Error! Invalid Request. Could not find a match for the given security code and the user ID.');
         } else {
             $membership_level = $member->membership_level;
         }
     } else {
         if (!empty($level)) {
             $member = SwpmTransfer::$default_fields;
             $membership_level = absint($level);
         }
     }
     if (empty($membership_level)) {
         $joinuspage_link = '<a href="' . $joinuspage_url . '">Join us</a>';
         echo '<p>';
         SwpmUtils::e('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.');
         echo '</p><p>';
         SwpmUtils::e('You will receive a unique link via email after the payment. You will be able to use that link to complete the premium membership registration.');
         echo '</p>';
         return;
     }
     $mebership_info = SwpmPermission::get_instance($membership_level);
     $membership_level = $mebership_info->get('id');
     if (empty($membership_level)) {
         return "Membership Level Not Found.";
     }
     $level_identifier = md5($membership_level);
     $membership_level_alias = $mebership_info->get('alias');
     $swpm_registration_submit = filter_input(INPUT_POST, 'swpm_registration_submit');
     if (!empty($swpm_registration_submit)) {
         $member = $_POST;
     }
     ob_start();
     extract((array) $member, EXTR_SKIP);
     include SIMPLE_WP_MEMBERSHIP_PATH . 'views/add.php';
     return ob_get_clean();
 }
开发者ID:andrewfieldwmg,项目名称:greenschoolsproject,代码行数:49,代码来源:class.swpm-front-registration.php


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