本文整理汇总了PHP中pmpro_translate_billing_period函数的典型用法代码示例。如果您正苦于以下问题:PHP pmpro_translate_billing_period函数的具体用法?PHP pmpro_translate_billing_period怎么用?PHP pmpro_translate_billing_period使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmpro_translate_billing_period函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _e
echo $level->name;
?>
</li>
<?php
if ($level->billing_amount > 0) {
?>
<li><strong><?php
_e("Membership Fee", "vibe");
?>
:</strong>
<?php
$level = $current_user->membership_level;
if ($current_user->membership_level->cycle_number > 1) {
printf(_x('%s every %d %s.', 'Recurring payment in cost text generation. E.g., $5 every 2 months.', 'vibe'), $pmpro_currency_symbol . $level->billing_amount, $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} elseif ($current_user->membership_level->cycle_number == 1) {
printf(_x('%s per %s.', 'Recurring payment in cost text generation. E.g. $5 every month.', 'vibe'), $pmpro_currency_symbol . $level->billing_amount, pmpro_translate_billing_period($level->cycle_period));
} else {
echo $pmpro_currency_symbol, $current_user->membership_level->billing_amount;
}
?>
</li>
<?php
}
?>
<?php
if ($level->billing_limit) {
?>
<li><strong><?php
_e("Duration", "vibe");
?>
示例2: __
if (pmpro_isLevelFree($level)) {
echo "<strong>" . __('Free', 'pmpro') . "</strong>";
} elseif ($level->billing_amount != '0.00') {
if ($level->billing_limit > 1) {
if ($level->cycle_number == '1') {
printf(_x('%s per %s for %d more %s.', 'Recurring payment in cost text generation. E.g. $5 every month for 2 more payments.', 'kleo_framework'), $pmpro_currency_symbol . $level->billing_amount, pmpro_translate_billing_period($level->cycle_period), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
} else {
printf(_x('%s every %d %s for %d more %s.', 'Recurring payment in cost text generation. E.g., $5 every 2 months for 2 more payments.', 'kleo_framework'), $pmpro_currency_symbol . $level->billing_amount, $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
}
} elseif ($level->billing_limit == 1) {
printf(_x('%s after %d %s.', 'Recurring payment in cost text generation. E.g. $5 after 2 months.', 'kleo_framework'), $pmpro_currency_symbol . $level->billing_amount, $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} else {
if ($level->cycle_number == '1') {
printf(_x('%s per %s.', 'Recurring payment in cost text generation. E.g. $5 every month.', 'kleo_framework'), $pmpro_currency_symbol . $level->billing_amount, pmpro_translate_billing_period($level->cycle_period));
} else {
printf(_x('%s every %d %s.', 'Recurring payment in cost text generation. E.g., $5 every 2 months.', 'kleo_framework'), $pmpro_currency_symbol . $level->billing_amount, $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
}
}
}
//trial
if (pmpro_isLevelTrial($level)) {
if ($level->trial_amount == '0.00') {
if ($level->trial_limit == '1') {
echo ' ' . _x('After your initial payment, your first payment is Free.', 'Trial payment in cost text generation.', 'pmpro');
} else {
printf(' ' . _x('After your initial payment, your first %d payments are Free.', 'Trial payment in cost text generation.', 'pmpro'), $level->trial_limit);
}
} else {
if ($level->trial_limit == '1') {
printf(' ' . _x('After your initial payment, your first payment will cost %s.', 'Trial payment in cost text generation.', 'pmpro'), $pmpro_currency_symbol . $level->trial_amount);
} else {
示例3: pmpro_getLevelExpiration
function pmpro_getLevelExpiration(&$level)
{
if ($level->expiration_number) {
$expiration_text = sprintf(__("Membership expires after %d %s.", "pmpro"), $level->expiration_number, pmpro_translate_billing_period($level->expiration_period, $level->expiration_number));
} else {
$expiration_text = "";
}
$expiration_text = apply_filters("pmpro_level_expiration_text", $expiration_text, $level);
return $expiration_text;
}
示例4: _e
echo $level->name;
?>
</li>
<?php
if ($level->billing_amount > 0) {
?>
<li><strong><?php
_e("Membership Fee", "pmpro");
?>
:</strong>
<?php
$level = $current_user->membership_level;
if ($current_user->membership_level->cycle_number > 1) {
printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} elseif ($current_user->membership_level->cycle_number == 1) {
printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
} else {
echo pmpro_formatPrice($current_user->membership_level->billing_amount);
}
?>
</li>
<?php
}
?>
<?php
if ($level->billing_limit) {
?>
<li><strong><?php
_e("Duration", "pmpro");
?>
示例5: _e
echo $current_user->membership_level->name;
?>
</li>
<?php
if ($current_user->membership_level->billing_amount > 0) {
?>
<li><strong><?php
_e("Membership Fee", "pmpro");
?>
:</strong>
<?php
$level = $current_user->membership_level;
if ($current_user->membership_level->cycle_number > 1) {
printf(__('%s every %d %s.', 'pmpro'), $pmpro_currency_symbol . $level->billing_amount, $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} elseif ($current_user->membership_level->cycle_number == 1) {
printf(__('%s per %s.', 'pmpro'), $pmpro_currency_symbol . $level->billing_amount, pmpro_translate_billing_period($level->cycle_period));
} else {
echo $pmpro_currency_symbol, $current_user->membership_level->billing_amount;
}
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->billing_limit) {
?>
<li><strong><?php
_e("Duration", "pmpro");
示例6: _e
if (!pmpro_isLevelRecurring($level)) {
?>
--
<?php
} else {
?>
<?php
echo $pmpro_currency_symbol;
echo $level->billing_amount;
?>
<?php
_e('every', 'pmpro');
?>
<?php
echo $level->cycle_number . ' ' . pmpro_translate_billing_period($level->cycle_period, $level->cycle_number);
?>
<?php
if ($level->billing_limit) {
?>
(<?php
_e('for', 'pmpro');
?>
<?php
echo $level->billing_limit;
?>
<?php
echo sornot($level->cycle_period, $level->billing_limit);
?>
)<?php
示例7: memberlite_getLevelCost
function memberlite_getLevelCost(&$level, $tags = true, $short = false)
{
$r = '<span class="pmpro_level-initialprice">';
//initial payment
if (!$short) {
$r .= sprintf(__('The price for membership is <strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment));
} elseif (pmpro_isLevelFree($level)) {
$r .= sprintf(__('<strong>FREE</strong>', 'pmpro'));
} else {
$r .= sprintf(__('<strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment));
}
$r .= '</span>';
//recurring part
if ($level->billing_amount != '0.00') {
if ($level->billing_limit > 1) {
if ($level->cycle_number == '1') {
$r .= sprintf(__(' and then <strong>%s per %s for %d more %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
} else {
$r .= sprintf(__(' and then <strong>%s every %d %s for %d more %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
}
} elseif ($level->billing_limit == 1) {
$r .= sprintf(__(' and then <strong>%s after %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} else {
if ($level->billing_amount === $level->initial_payment) {
if ($level->cycle_number == '1') {
if (!$short) {
$r = sprintf(__('The price for membership is <strong>%s per %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), pmpro_translate_billing_period($level->cycle_period));
} else {
$r = sprintf(__('<strong>%s/%s</strong>', 'pmpro'), pmpro_formatPrice($level->initial_payment), pmpro_translate_billing_period($level->cycle_period));
}
} else {
if (!$short) {
$r = sprintf(__('The price for membership is <strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} else {
$r = sprintf(__('<strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
}
}
} else {
$r .= '<span class="pmpro_level-subprice">';
if ($level->cycle_number == '1') {
if (!$short) {
$r .= sprintf(__(' and then <strong>%s per %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
} else {
$r .= sprintf(__(' then <strong>%s/%s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
}
} else {
$r .= sprintf(__(' and then <strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
}
$r .= '</span>';
}
}
} elseif (!pmpro_isLevelFree($level)) {
$r .= ".";
}
//add a space
$r .= ' ';
//trial part
if ($level->trial_limit) {
$r .= '<span class="pmpro_level-trialprice">';
if ($level->trial_amount == '0.00') {
if ($level->trial_limit == '1') {
$r .= ' ' . __('After your initial payment, your first payment is Free.', 'pmpro');
} else {
$r .= ' ' . sprintf(__('After your initial payment, your first %d payments are Free.', 'pmpro'), $level->trial_limit);
}
} else {
if ($level->trial_limit == '1') {
$r .= ' ' . sprintf(__('After your initial payment, your first payment will cost %s.', 'pmpro'), pmpro_formatPrice($level->trial_amount));
} else {
$r .= ' ' . sprintf(__('After your initial payment, your first %d payments will cost %s.', 'pmpro'), $level->trial_limit, pmpro_formatPrice($level->trial_amount));
}
}
$r .= '</span>';
}
//taxes part
$tax_state = pmpro_getOption("tax_state");
$tax_rate = pmpro_getOption("tax_rate");
if ($tax_state && $tax_rate && !pmpro_isLevelFree($level)) {
$r .= '<span class="pmpro_level-tax">';
$r .= sprintf(__('Customers in %s will be charged %s%% tax.', 'pmpro'), $tax_state, round($tax_rate * 100, 2));
$r .= '</span>';
}
if (!$tags) {
$r = strip_tags($r);
}
$r = apply_filters("pmpro_level_cost_text", $r, $level, $tags, $short);
//passing $tags and $short since v2.0
return $r;
}
示例8: pmpro_getLevelsExpiration
function pmpro_getLevelsExpiration(&$levels)
{
$expirystrings = array();
$ongoinglevelnum = 0;
if (!empty($levels) && !is_array($levels)) {
$levels = array($levels);
} elseif (empty($levels)) {
$levels = array();
}
foreach ($levels as $curlevel) {
if ($curlevel->expiration_number) {
$expirystrings[] = sprintf(__("%s membership expires after %d %s", "pmpro"), $curlevel->name, $curlevel->expiration_number, pmpro_translate_billing_period($curlevel->expiration_period, $curlevel->expiration_number));
} else {
$ongoinglevelnum++;
}
}
$expiration_text = "";
if (count($expirystrings) > 0) {
$laststanza = array_pop($expirystrings);
$expiration_text = implode(', ', $expirystrings);
if (count($expirystrings) > 0) {
$expiration_text .= ", and ";
}
$expiration_text .= $laststanza;
$expiration_text .= ". ";
if ($ongoinglevelnum > 0) {
$expiration_text .= "The remaining membership";
if ($ongoinglevelnum > 1) {
$expiration_text .= "s are";
} else {
$expiration_text .= " is";
}
$expiration_text .= " ongoing.";
}
}
/**
* Filter the levels expiration text. Note the s in levels. Similar to pmpro_levels_expiration_text
*/
$expiration_text = apply_filters("pmpro_levels_expiration_text", $expiration_text, $levels);
$expiration_text = apply_filters("pmpro_level_expiration_text", $expiration_text, $levels);
// Backwards compatible
return $expiration_text;
}
示例9: billing_content_func
function billing_content_func($atts)
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
//-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
if ($current_user->membership_level->ID) {
if ($pmpro_msg) {
?>
<div class="pmpro_message <?php
echo $pmpro_msgt;
?>
"><?php
echo $pmpro_msg;
?>
</div>
<?php
}
?>
<div class="row billing-content">
<div class="col-md-8 col-sm-8 col-sm-offset-3 col-md-offset-3">
<!-- BEGIN CONTENT-->
<div id="pmpro_account">
<div id="pmpro_account-membership" class="pmpro_box-first">
<?php
//wpex_logo();
?>
<!--
<div class="clear clearfix"></div>
<br/>
-->
<?php
$level = $current_user->membership_level->name;
?>
<p><?php
_e("Membership status: <strong>" . $level . "</strong>", "pmpro");
?>
</p>
<?php
//die(var_dump($current_user));
?>
<ul>
<li><strong><?php
_e("Level", "pmpro");
?>
:</strong> <?php
echo $current_user->membership_level->name;
?>
</li>
<?php
if ($current_user->membership_level->billing_amount > 0) {
?>
<li><strong><?php
_e("Membership Fee", "pmpro");
?>
:</strong>
<?php
$level = $current_user->membership_level;
if ($current_user->membership_level->cycle_number > 1) {
printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} elseif ($current_user->membership_level->cycle_number == 1) {
printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
} else {
echo pmpro_formatPrice($current_user->membership_level->billing_amount);
}
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->billing_limit) {
?>
<li><strong><?php
_e("Duration", "pmpro");
?>
:</strong> <?php
echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->enddate) {
?>
<li><strong><?php
_e("Next billing date", "pmpro");
?>
:</strong> <?php
echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
?>
</li>
<?php
}
?>
//.........这里部分代码省略.........
示例10: billing_content_func
function billing_content_func($atts)
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
//-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
if ($current_user->membership_level->ID) {
if ($pmpro_msg) {
?>
<div class="pmpro_message <?php
echo $pmpro_msgt;
?>
"><?php
echo $pmpro_msg;
?>
</div>
<?php
}
?>
<div class="row">
<div class="col-md-8 col-sm-8 col-sm-offset-2 col-md-offset-2">
<!-- BEGIN CONTENT-->
<div id="pmpro_account">
<div id="pmpro_account-membership" class="pmpro_box">
<p><?php
_e("Your membership is <strong>active</strong>.", "pmpro");
?>
</p>
<ul>
<li><strong><?php
_e("Level", "pmpro");
?>
:</strong> <?php
echo $current_user->membership_level->name;
?>
</li>
<?php
if ($current_user->membership_level->billing_amount > 0) {
?>
<li><strong><?php
_e("Membership Fee", "pmpro");
?>
:</strong>
<?php
$level = $current_user->membership_level;
if ($current_user->membership_level->cycle_number > 1) {
printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} elseif ($current_user->membership_level->cycle_number == 1) {
printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
} else {
echo pmpro_formatPrice($current_user->membership_level->billing_amount);
}
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->billing_limit) {
?>
<li><strong><?php
_e("Duration", "pmpro");
?>
:</strong> <?php
echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->enddate) {
?>
<li><strong><?php
_e("Membership Expires", "pmpro");
?>
:</strong> <?php
echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
?>
</li>
<?php
}
?>
<?php
if ($current_user->membership_level->trial_limit == 1) {
printf(__("Your first payment will cost %s.", "pmpro"), pmpro_formatPrice($current_user->membership_level->trial_amount));
} elseif (!empty($current_user->membership_level->trial_limit)) {
printf(__("Your first %d payments will cost %s.", "pmpro"), $current_user->membership_level->trial_limit, pmpro_formatPrice($current_user->membership_level->trial_amount));
}
?>
</ul>
</div> <!-- end pmpro_account-membership -->
<div id="pmpro_account-profile" class="pmpro_box hide">
<?php
get_currentuserinfo();
//.........这里部分代码省略.........