本文整理汇总了PHP中rcp_currency_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP rcp_currency_filter函数的具体用法?PHP rcp_currency_filter怎么用?PHP rcp_currency_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rcp_currency_filter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rcp_admin_scripts
function rcp_admin_scripts($hook)
{
global $rcp_options, $rcp_members_page, $rcp_subscriptions_page, $rcp_discounts_page, $rcp_payments_page, $rcp_reports_page, $rcp_settings_page, $rcp_export_page, $rcp_help_page;
$pages = array($rcp_members_page, $rcp_subscriptions_page, $rcp_discounts_page, $rcp_payments_page, $rcp_reports_page, $rcp_settings_page, $rcp_export_page, $rcp_help_page);
if (in_array($hook, $pages)) {
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('bbq', RCP_PLUGIN_URL . 'includes/js/jquery.ba-bbq.min.js');
wp_enqueue_script('rcp-admin-scripts', RCP_PLUGIN_URL . 'includes/js/admin-scripts.js', array('jquery'), RCP_PLUGIN_VERSION);
}
if ($rcp_reports_page == $hook) {
wp_enqueue_script('jquery-flot', RCP_PLUGIN_URL . 'includes/js/jquery.flot.min.js');
}
if ($hook == $rcp_help_page) {
wp_enqueue_style('jquery-snippet', RCP_PLUGIN_URL . 'includes/css/jquery.snippet.min.css');
wp_enqueue_script('jquery-snippet', RCP_PLUGIN_URL . 'includes/js/jquery.snippet.min.js');
}
if (in_array($hook, $pages)) {
wp_localize_script('rcp-admin-scripts', 'rcp_vars', array('rcp_member_nonce' => wp_create_nonce('rcp_member_nonce'), 'deactivate_user' => __('Are you sure you wish to cancel this member\'s subscription?', 'rcp'), 'delete_subscription' => __('If you delete this subscription, all members registered with this level will be canceled. Proceed?', 'rcp'), 'delete_payment' => __('Are you sure you want to delete this payment? This action is irreversible. Proceed?', 'rcp'), 'missing_username' => __('You must choose a username', 'rcp'), 'currency_sign' => rcp_currency_filter(''), 'currency_pos' => isset($rcp_options['currency_position']) ? $rcp_options['currency_position'] : 'before', 'use_as_logo' => __('Use as Logo', 'rcp'), 'choose_logo' => __('Choose a Logo', 'rcp')));
}
}
示例2: esc_attr
<option value="<?php echo esc_attr( $key ); ?>" data-supports-recurring="<?php echo esc_attr( $recurring ); ?>"><?php echo esc_html( $gateway ); ?></option>
<?php endforeach; ?>
</select>
<label for="rcp_gateway"><?php _e( 'Choose Your Payment Method', 'rcp' ); ?></label>
</p>
</fieldset>
<?php else: ?>
<?php foreach( $gateways as $key => $gateway ) : $recurring = rcp_gateway_supports( $key, 'recurring' ) ? 'yes' : 'no'; ?>
<input type="hidden" name="rcp_gateway" value="<?php echo esc_attr( $key ); ?>" data-supports-recurring="<?php echo esc_attr( $recurring ); ?>"/>
<?php endforeach; ?>
<?php endif; ?>
</div>
<fieldset class="rcp_level_details_fieldset">
<p id="rcp_level_details_wrap" class="rcp_level" rel="<?php echo esc_attr( $level->price ); ?>">
<span class="rcp_price"><?php echo rcp_currency_filter( $level->price ); ?></span>
<span class="rcp_sep"> / </span>
<span class="rcp_duration"><?php echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit( $level->duration_unit, $level->duration ) : __( 'unlimited', 'rcp' ); ?></span>
</p>
</fieldset>
<?php endif; ?>
<?php do_action( 'rcp_before_registration_submit_field' ); ?>
<p id="rcp_submit_wrap">
<input type="hidden" name="rcp_level" value="<?php echo absint( $rcp_level ); ?>"/>
<input type="hidden" name="rcp_register_nonce" value="<?php echo wp_create_nonce('rcp-register-nonce' ); ?>"/>
<input type="submit" name="rcp_submit_registration" id="rcp_submit" value="<?php echo apply_filters ( 'rcp_registration_register_button', __( 'Register', 'rcp' ) ); ?>"/>
</p>
</form>
示例3: rcp_generate_pdf_invoice
//.........这里部分代码省略.........
if (!empty($rcp_options['invoice_email'])) {
$pdf->SetTextColor(41, 102, 152);
$pdf->Cell(0, $pdf->calculate_line_height($rcp_options['invoice_email']), $rcp_options['invoice_email'], 0, 2, 'L', false);
}
$pdf->SetTextColor(50, 50, 50);
$pdf->Ln(12);
$pdf->Ln();
$pdf->SetXY(60, 60);
$pdf->SetFont($font, 'B', 10);
$pdf->Cell(0, 6, __('To', 'rcp'), 0, 2, 'L', false);
$pdf->SetFont($font, '', 10);
$pdf->Cell(0, $pdf->calculate_line_height($userdata->display_name), $userdata->display_name, 0, 2, 'L', false);
$pdf->SetTextColor(41, 102, 152);
$pdf->Cell(0, 6, $userdata->user_email, 0, 2, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Ln(5);
$pdf->SetX(60);
$pdf->SetTextColor(110, 110, 110);
$pdf->Cell(30, 6, __('Invoice Date', 'rcp'), 0, 0, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Cell(0, 6, $payment_date, 0, 2, 'L', false);
$pdf->SetX(60);
$pdf->SetTextColor(110, 110, 110);
$pdf->Cell(30, 6, __('Invoice ID', 'rcp'), 0, 0, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Cell(0, 6, '#' . $payment->id, 0, 2, 'L', false);
$pdf->SetX(60);
$pdf->SetTextColor(110, 110, 110);
$pdf->Cell(30, 6, __('Subscription Key', 'rcp'), 0, 0, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Cell(0, 6, $payment->subscription_key, 0, 2, 'L', false);
$pdf->SetX(60);
$pdf->SetX(60);
$pdf->SetTextColor(110, 110, 110);
$pdf->Cell(30, 6, __('Payment Method', 'rcp'), 0, 0, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Cell(0, 6, $payment->payment_type, 0, 2, 'L', false);
$pdf->SetX(60);
$pdf->SetTextColor(110, 110, 110);
$pdf->Cell(30, 6, __('Transaction ID', 'rcp'), 0, 0, 'L', false);
$pdf->SetTextColor(50, 50, 50);
$pdf->Cell(0, 6, $payment->transaction_id, 0, 2, 'L', false);
$pdf->Ln(5);
$pdf->SetX(61);
$pdf->SetFillColor(224, 224, 224);
$pdf->SetDrawColor(209, 209, 209);
$pdf->SetFont($font, 'B', 10);
$pdf->Cell(140, 8, __('Invoice Items', 'rcp'), 1, 2, 'C', true);
$pdf->Ln(0.2);
$pdf->SetX(61);
$pdf->SetDrawColor(194, 221, 231);
$pdf->SetFillColor(238, 238, 238);
$pdf->SetFont($font, '', 9);
$pdf->Cell(102, 7, __('Subscription', 'rcp'), 'BL', 0, 'C', false);
$pdf->Cell(38, 7, __('Amount', 'rcp'), 'BR', 0, 'C', false);
$pdf->Ln(0.2);
$pdf->Ln();
$pdf->SetX(61);
$pdf->SetDrawColor(238, 238, 238);
$pdf->SetX(61);
$pdf->SetFont($font, '', 10);
$amount = utf8_encode(html_entity_decode(rcp_currency_filter($payment->amount), ENT_COMPAT, 'UTF-8'));
if (function_exists('iconv')) {
// Ensure characters like euro; are properly converted. See GithuB issue #472 and #1570
$amount = iconv('UTF-8', 'windows-1252', $amount);
}
$pdf->Cell(102, 8, html_entity_decode($payment->subscription), 'B', 0, 'L', false);
$pdf->SetFillColor(250, 250, 250);
$pdf->Cell(38, 8, $amount, 'B', 2, 'R', true);
$pdf->Ln(5);
$pdf->SetX(61);
$pdf->SetFillColor(224, 224, 224);
$pdf->SetDrawColor(209, 209, 209);
$pdf->SetFont($font, 'B', 10);
$pdf->Cell(140, 8, __('Invoice Totals', 'rcp'), 1, 2, 'C', true);
$pdf->Ln(0.2);
$pdf->SetDrawColor(238, 238, 238);
$pdf->SetFillColor(250, 250, 250);
$pdf->SetX(61);
$pdf->SetFont($font, 'B', 11);
$pdf->Cell(102, 10, __('Total', 'rcp'), 'B', 0, 'L', false);
$pdf->Cell(38, 10, $amount, 'B', 2, 'R', true);
$pdf->Ln(10);
if (!empty($rcp_options['invoice_notes'])) {
$pdf->SetX(60);
$pdf->SetFont($font, '', 13);
$pdf->Cell(0, 6, __('Additional Notes', 'rcp'), 0, 2, 'L', false);
$pdf->Ln(2);
$pdf->SetX(60);
$pdf->SetFont($font, '', 10);
$pdf->MultiCell(0, 6, $rcp_options['invoice_notes'], 0, 'L', false);
}
if (wp_is_mobile()) {
$pdf->Output(apply_filters('rcp_invoice_filename_prefix', 'Invoice-') . $payment->id . '.pdf', 'I');
} else {
$pdf->Output(apply_filters('rcp_invoice_filename_prefix', 'Invoice-') . $payment->id . '.pdf', 'D');
}
die;
// Stop the rest of the page from processsing and being sent to the browser
}
示例4: esc_attr
echo esc_attr(absint($level->id));
?>
" <?php
if ($level->duration == 0) {
echo 'data-duration="forever"';
}
?>
/>
<span class="rcp_subscription_level_name"><?php
echo rcp_get_subscription_name($level->id);
?>
</span><span class="rcp_separator"> - </span><span class="rcp_price" rel="<?php
echo esc_attr($level->price);
?>
"><?php
echo $level->price > 0 ? rcp_currency_filter($level->price) : __('free', 'rcp');
?>
<span class="rcp_separator"> - </span></span>
<span class="rcp_level_duration"><?php
echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'rcp');
?>
</span>
<div class="rcp_level_description"> <?php
echo rcp_get_subscription_description($level->id);
?>
</div>
</li>
<?php
}
?>
<?php
示例5: foreach
// Fees
?>
<?php
if (rcp_get_registration()->get_fees()) {
foreach (rcp_get_registration()->get_fees() as $fee) {
$sign = $fee['amount'] < 0 ? '-' : '';
$fee['amount'] = abs($fee['amount']);
$fee['amount'] = number_format($fee['amount'], rcp_currency_decimal_filter());
?>
<tr class="rcp-fee">
<td><?php
echo esc_html($fee['description']);
?>
</td>
<td><?php
echo esc_html($sign . rcp_currency_filter($fee['amount']));
?>
</td>
</tr>
<?php
}
}
?>
<?php
}
?>
<?php
}
?>
示例6: rcp_print_user_payments
function rcp_print_user_payments( $user_id ) {
$payments = new RCP_Payments;
$user_payments = $payments->get_payments( array( 'user_id' => $user_id ) );
$payments_list = '';
if( $user_payments ) :
foreach( $user_payments as $payment ) :
$transaction_id = ! empty( $payment->transaction_id ) ? $payment->transaction_id : '';
$payments_list .= '<ul class="rcp_payment_details">';
$payments_list .= '<li>' . __( 'Date', 'rcp' ) . ': ' . $payment->date . '</li>';
$payments_list .= '<li>' . __( 'Subscription', 'rcp' ) . ': ' . $payment->subscription . '</li>';
$payments_list .= '<li>' . __( 'Payment Type', 'rcp' ) . ': ' . $payment->payment_type . '</li>';
$payments_list .= '<li>' . __( 'Subscription Key', 'rcp' ) . ': ' . $payment->subscription_key . '</li>';
$payments_list .= '<li>' . __( 'Transaction ID', 'rcp' ) . ': ' . $transaction_id . '</li>';
if( $payment->amount != '' ) {
$payments_list .= '<li>' . __( 'Amount', 'rcp' ) . ': ' . rcp_currency_filter( $payment->amount ) . '</li>';
} else {
$payments_list .= '<li>' . __( 'Amount', 'rcp' ) . ': ' . rcp_currency_filter( $payment->amount2 ) . '</li>';
}
$payments_list .= '</ul>';
endforeach;
else :
$payments_list = '<p class="rcp-no-payments">' . __( 'No payments recorded', 'rcp' ) . '</p>';
endif;
return $payments_list;
}
示例7: rcp_filter_email_tags
function rcp_filter_email_tags($message, $user_id, $display_name)
{
$user = get_userdata($user_id);
$site_name = stripslashes_deep(html_entity_decode(get_bloginfo('name'), ENT_COMPAT, 'UTF-8'));
$rcp_payments = new RCP_Payments();
$message = str_replace('%blogname%', $site_name, $message);
$message = str_replace('%username%', $user->user_login, $message);
$message = str_replace('%useremail%', $user->user_email, $message);
$message = str_replace('%firstname%', html_entity_decode($user->user_firstname, ENT_COMPAT, 'UTF-8'), $message);
$message = str_replace('%lastname%', html_entity_decode($user->user_lastname, ENT_COMPAT, 'UTF-8'), $message);
$message = str_replace('%displayname%', html_entity_decode($display_name, ENT_COMPAT, 'UTF-8'), $message);
$message = str_replace('%expiration%', rcp_get_expiration_date($user_id), $message);
$message = str_replace('%subscription_name%', html_entity_decode(rcp_get_subscription($user_id), ENT_COMPAT, 'UTF-8'), $message);
$message = str_replace('%subscription_key%', rcp_get_subscription_key($user_id), $message);
$message = str_replace('%amount%', html_entity_decode(rcp_currency_filter($rcp_payments->last_payment_of_user($user_id)), ENT_COMPAT, 'UTF-8'), $message);
return apply_filters('rcp_email_tags', $message, $user_id);
}
示例8: rcp_member_levels_page
//.........这里部分代码省略.........
?>
"><?php
echo stripslashes($level->description);
?>
</td>
<td class="rcp-sub-level-col" data-colname="<?php
_e('Access Level', 'rcp');
?>
"><?php
echo $level->level != '' ? $level->level : __('none', 'rcp');
?>
</td>
<td class="rcp-sub-duration-col" data-colname="<?php
_e('Duration', 'rcp');
?>
">
<?php
if ($level->duration > 0) {
echo $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration);
} else {
echo __('unlimited', 'rcp');
}
?>
</td>
<td class="rcp-sub-price-col" data-colname="<?php
_e('Price', 'rcp');
?>
">
<?php
$price = rcp_get_subscription_price($level->id);
if (!$price) {
echo __('Free', 'rcp');
} else {
echo rcp_currency_filter($price);
}
?>
</td>
<td class="rcp-sub-subs-col" data-colname="<?php
_e('Subscribers', 'rcp');
?>
">
<?php
if ($price || $level->duration > 0) {
echo rcp_get_subscription_member_count($level->id, 'active');
} else {
echo rcp_get_subscription_member_count($level->id, 'free');
}
?>
</td>
<?php
do_action('rcp_levels_page_table_column', $level->id);
?>
<td class="rcp-sub-order-col"><a href="#" class="dragHandle"></a></td>
</tr>
<?php
$i++;
}
} else {
?>
<tr><td colspan="9"><?php
_e('No subscription levels added yet.', 'rcp');
?>
</td></tr>
<?php
}
?>
示例9: do_action
</fieldset>
<?php } ?>
<?php do_action( 'rcp_before_subscription_form_fields' ); ?>
<fieldset class="rcp_subscription_fieldset">
<?php $levels = rcp_get_subscription_levels( 'active' );
if( $levels ) : ?>
<p class="rcp_subscription_message"><?php echo apply_filters ( 'rcp_registration_choose_subscription', __( 'Choose your subscription level', 'rcp' ) ); ?></p>
<ul id="rcp_subscription_levels">
<?php foreach( $levels as $key => $level ) : ?>
<?php if( rcp_show_subscription_level( $level->id ) ) : ?>
<li id="rcp_subscription_level_<?php echo $level->id; ?>" class="rcp_subscription_level">
<input type="radio" class="required rcp_level" <?php if( $key == 0 || ( isset( $_GET['level'] ) && $_GET['level'] == $key ) ) { echo 'checked="checked"'; } ?> name="rcp_level" rel="<?php echo esc_attr( $level->price ); ?>" value="<?php echo esc_attr( absint( $level->id ) ); ?>" <?php if( $level->duration == 0 ) { echo 'data-duration="forever"'; } ?>/>
<span class="rcp_subscription_level_name"><?php echo rcp_get_subscription_name( $level->id ); ?></span><span class="rcp_separator"> - </span><span class="rcp_price" rel="<?php echo esc_attr( $level->price ); ?>"><?php echo $level->price > 0 ? rcp_currency_filter( $level->price ) : __( 'free', 'rcp' ); ?><span class="rcp_separator"> - </span></span>
<span class="rcp_level_duration"><?php echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit( $level->duration_unit, $level->duration ) : __( 'unlimited', 'rcp' ); ?></span>
<div class="rcp_level_description"> <?php echo rcp_get_subscription_description( $level->id ); ?></div>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php else : ?>
<p><strong><?php _e( 'You have not created any subscription levels yet', 'rcp' ); ?></strong></p>
<?php endif; ?>
</fieldset>
<?php if( rcp_has_discounts() ) : ?>
<fieldset class="rcp_discounts_fieldset">
<p id="rcp_discount_code_wrap">
<label for="rcp_discount_code">
示例10: rcp_discount_sign_filter
function rcp_discount_sign_filter($amount, $type)
{
$discount = '';
if ($type == '%') {
$discount = $amount . '%';
} elseif ($type == 'flat') {
$discount = rcp_currency_filter($amount);
}
return $discount;
}
示例11: rcp_member_levels_page
//.........这里部分代码省略.........
">
<td class="rcp-sub-order-col"><a href="#" class="dragHandle"></a></td>
<td class="rcp-sub-id-col"><?php
echo $level->id;
?>
</td>
<td class="rcp-sub-name-col"><?php
echo stripslashes($level->name);
?>
</td>
<td class="rcp-sub-desc-col"><?php
echo stripslashes($level->description);
?>
</td>
<td class="rcp-sub-level-col"><?php
echo $level->level != '' ? $level->level : __('none', 'rcp');
?>
</td>
<td class="rcp-sub-duration-col">
<?php
if ($level->duration > 0) {
echo $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration);
} else {
echo __('unlimited', 'rcp');
}
?>
</td>
<td class="rcp-sub-price-col">
<?php
$price = rcp_get_subscription_price($level->id);
if (!$price) {
echo __('Free', 'rcp');
} else {
echo rcp_currency_filter($price);
}
?>
</td>
<td class="rcp-sub-subs-col">
<?php
if ($price || $level->duration > 0) {
echo rcp_count_members($level->id, 'active');
} else {
echo rcp_count_members($level->id, 'free');
}
?>
</td>
<?php
do_action('rcp_levels_page_table_column', $level->id);
?>
<?php
if (current_user_can('rcp_manage_levels')) {
?>
<td class="rcp-sub-actions-col">
<a href="<?php
echo esc_url(add_query_arg('edit_subscription', $level->id, $page));
?>
"><?php
_e('Edit', 'rcp');
?>
</a> |
<?php
if ($level->status != 'inactive') {
?>
<a href="<?php
echo esc_url(add_query_arg('deactivate_subscription', $level->id, $page));
?>
示例12: rcp_earnings_graph
//.........这里部分代码省略.........
?>
,
],
yaxis: 2,
label: "<?php
_e('Earnings', 'rcp');
?>
",
id: 'sales'
}],
{
series: {
lines: { show: true },
points: { show: true }
},
grid: {
show: true,
aboveData: false,
color: '#ccc',
backgroundColor: '#fff',
borderWidth: 2,
borderColor: '#ccc',
clickable: false,
hoverable: true
},
xaxis: {
mode: "time",
timeFormat: "<?php
echo $time_format;
?>
",
minTickSize: [1, "<?php
echo $tick_size;
?>
"]
},
yaxis: {
min: 0,
minTickSize: 1,
tickDecimals: 0
}
});
function rcp_flot_tooltip(x, y, contents) {
$('<div id="rcp-flot-tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 5,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
var previousPoint = null;
$("#rcp_earnings_graph").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#rcp-flot-tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
if( rcp_vars.currency_pos == 'before' ) {
rcp_flot_tooltip( item.pageX, item.pageY, item.series.label + ' ' + rcp_vars.currency_sign + y );
} else {
rcp_flot_tooltip( item.pageX, item.pageY, item.series.label + ' ' + y + rcp_vars.currency_sign );
}
}
} else {
$("#rcp-flot-tooltip").remove();
previousPoint = null;
}
});
});
</script>
<h2><?php
_e('Earnings Report', 'rcp');
?>
</h2>
<div class="metabox-holder" style="padding-top: 0;">
<div class="postbox">
<div class="inside">
<?php
rcp_reports_graph_controls();
?>
<div id="rcp_earnings_graph" style="height: 300px;"></div>
<p class="rcp_graph_totals"><strong><?php
_e('Total earnings for period shown: ', 'rcp');
echo rcp_currency_filter(number_format_i18n($earnings, 2));
?>
</strong></p>
</div>
</div>
</div>
<?php
echo ob_get_clean();
}
示例13: _e
</tbody>
</table>
<table class="rcp-table" id="rcp-payment-history">
<thead>
<tr>
<th><?php _e( 'Invoice #', 'rcp' ); ?></th>
<th><?php _e( 'Subscription', 'rcp' ); ?></th>
<th><?php _e( 'Payment Method', 'rcp' ); ?></th>
<th><?php _e( 'Amount', 'rcp' ); ?></th>
<th><?php _e( 'Date', 'rcp' ); ?></th>
<th><?php _e( 'Actions', 'rcp' ); ?></th>
</tr>
</thead>
<tbody>
<?php if( rcp_get_user_payments() ) : ?>
<?php foreach( rcp_get_user_payments() as $payment ) : ?>
<tr>
<td><?php echo $payment->id; ?></td>
<td><?php echo $payment->subscription; ?></td>
<td><?php echo $payment->payment_type; ?></td>
<td><?php echo rcp_currency_filter( $payment->amount ); ?></td>
<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->date ) ); ?></td>
<td><a href="<?php echo rcp_get_pdf_download_url( $payment->id ); ?>"><?php _e( 'PDF Receipt', 'rcp' ); ?></td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr><td colspan="6"><?php _e( 'You have not made any payments.', 'rcp' ); ?></td></tr>
<?php endif; ?>
</tbody>
</table>
<?php do_action( 'rcp_subscription_details_bottom' );
示例14: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
if ($this->get_cached_widget($args)) {
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$description = $instance['description'];
$levels = rcp_get_subscription_levels('active');
if (!$levels) {
return;
}
$content = ob_get_clean();
echo $before_widget;
?>
<div class="container">
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<?php
if ($description) {
?>
<p class="homepage-widget-description"><?php
echo $description;
?>
</p>
<?php
}
?>
<div class="job-packages row">
<?php
foreach ($levels as $key => $level) {
?>
<?php
if (rcp_show_subscription_level($level->id)) {
?>
<div class="col-lg-4 col-md-6 col-sm-12 pricing-table-widget-wrapper">
<div class="pricing-table-widget rcp_subscription_level rcp_subscription_level_fake" data-href="<?php
echo esc_url(get_permalink(jobify_find_page_with_shortcode(array('register_form'))));
?>
">
<div class="pricing-table-widget-title">
<span class="rcp_subscription_level_name"><?php
echo stripslashes($level->name);
?>
</span>
</div>
<div class="pricing-table-widget-description">
<h2>
<span class="rcp_price" rel="<?php
echo esc_attr($level->price);
?>
">
<?php
if ($level->fee) {
?>
<?php
$adjusted_price = $level->price + $level->fee;
?>
<?php
echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify');
?>
</h2>
<small>
<?php
$promo_duration = sprintf(_n('%2$s', '%1$s %2$ss', $level->duration, 'jobify'), $level->duration, $level->duration_unit);
?>
<?php
printf(__('* %s after first %s', 'jobify'), rcp_currency_filter($level->price), $promo_duration);
?>
</small>
<?php
} else {
?>
<?php
$adjusted_price = $level->price;
?>
<?php
echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify');
?>
</h2>
//.........这里部分代码省略.........
示例15: sprintf
<small>
<?php
$promo_duration = sprintf(_n('%2$s', '%1$s %2$ss', $level->duration, 'jobify'), $level->duration, $level->duration_unit);
?>
<?php
printf(__('* %s after first %s', 'jobify'), rcp_currency_filter($level->price), $promo_duration);
?>
</small>
<?php
} else {
?>
<?php
$adjusted_price = $level->price;
?>
<?php
echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify');
?>
</h2>
<?php
}
?>
</span>
</h2>
<p><span class="rcp_level_duration"><?php
echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'jobify');
?>
</span></p>
<?php
echo wpautop(wp_kses(stripslashes($level->description), rcp_allowed_html_tags()));