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


PHP MS_Model_Membership::get_custom_data方法代码示例

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


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

示例1: get_type

 /**
  * Returns the sanitized reward type for display or calculation.
  *
  * (1) inv .. Percentage based on actually paid amount.
  * (2) mem .. Percentage based on current membership price setting.
  * (3) abs .. Absolute value (in USD/etc).
  *
  * @since  1.0.0
  * @param  MS_Model_Membership $membership
  * @return string A valid reward type: inv/mem/abs
  */
 protected function get_type($membership)
 {
     $available_types = array('inv', 'mem', 'abs');
     $type = $membership->get_custom_data('aff_reward_type');
     if (!in_array($type, $available_types)) {
         $type = 'abs';
     }
     return $type;
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:20,代码来源:membership2.php

示例2: membership_option

 /**
  * Displays a flag in the payment options page to enable/disable invitation
  * codes for a specific membership.
  *
  * @since  1.0.1.0
  * @param  MS_View $view The view that called the action.
  * @param  MS_Model_Membership $membership Membership being edited.
  */
 public function membership_option($view, $membership)
 {
     $action = MS_Controller_Membership::AJAX_ACTION_SET_CUSTOM_FIELD;
     $nonce = wp_create_nonce($action);
     $fields = array(array('type' => MS_Helper_Html::TYPE_HTML_SEPARATOR), array('id' => 'no_invitation', 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER, 'title' => __('Does this Membership require an Invitation code?', 'membership2'), 'value' => lib3()->is_true($membership->get_custom_data('no_invitation')), 'before' => sprintf('%s <i class="wpmui-fa wpmui-fa-lock"></i>', __('Yes', 'membership2')), 'after' => sprintf('<i class="wpmui-fa wpmui-fa-unlock"></i> %s', __('No (public membership)', 'membership2')), 'class' => 'reverse', 'ajax_data' => array('action' => $action, '_wpnonce' => $nonce, 'membership_id' => $membership->id, 'field' => 'no_invitation')));
     foreach ($fields as $field) {
         MS_Helper_Html::html_element($field);
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:17,代码来源:class-ms-addon-invitation.php


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