本文整理汇总了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();
}
示例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();
}