Пример #1
0
function et_pb_pricing_table($atts, $content = null)
{
    global $et_pb_pricing_tables_num;
    extract(shortcode_atts(array('featured' => 'off', 'title' => '', 'subtitle' => '', 'currency' => '', 'per' => '', 'sum' => '', 'button_url' => '', 'button_text' => ''), $atts));
    $et_pb_pricing_tables_num++;
    if ('' !== $button_url && '' !== $button_text) {
        $button_text = sprintf('<a class="et_pb_pricing_table_button" href="%1$s">%2$s</a>', esc_url($button_url), esc_html($button_text));
    }
    $output = sprintf('<div class="et_pb_pricing_table%1$s">
			<div class="et_pb_pricing_heading">
				%2$s
				%3$s
			</div> <!-- .et_pb_pricing_heading -->
			<div class="et_pb_pricing_content_top">
				<span class="et_pb_et_price">%6$s%7$s%8$s</span>
			</div> <!-- .et_pb_pricing_content_top -->
			<div class="et_pb_pricing_content">
				<ul class="et_pb_pricing">
					%4$s
				</ul>
			</div> <!-- .et_pb_pricing_content -->
			%5$s
		</div>', 'off' !== $featured ? ' et_pb_featured_table' : '', '' !== $title ? sprintf('<h2 class="et_pb_pricing_title">%1$s</h2>', esc_html($title)) : '', '' !== $subtitle ? sprintf('<span class="et_pb_best_value">%1$s</span>', esc_html($subtitle)) : '', do_shortcode(et_pb_fix_shortcodes(et_pb_extract_items($content))), $button_text, '' !== $currency ? sprintf('<span class="et_pb_dollar_sign">%1$s</span>', esc_html($currency)) : '', '' !== $sum ? sprintf('<span class="et_pb_sum">%1$s</span>', esc_html($sum)) : '', '' !== $per ? sprintf('/%1$s', esc_html($per)) : '');
    return $output;
}
Пример #2
0
    function shortcode_callback($atts, $content = null, $function_name)
    {
        global $et_pb_pricing_tables_num, $et_pb_pricing_tables_icon;
        $featured = $this->shortcode_atts['featured'];
        $title = $this->shortcode_atts['title'];
        $subtitle = $this->shortcode_atts['subtitle'];
        $currency = $this->shortcode_atts['currency'];
        $per = $this->shortcode_atts['per'];
        $sum = $this->shortcode_atts['sum'];
        $button_url = $this->shortcode_atts['button_url'];
        $button_text = $this->shortcode_atts['button_text'];
        $button_custom = $this->shortcode_atts['custom_button'];
        $custom_icon = $this->shortcode_atts['button_icon'];
        $et_pb_pricing_tables_num++;
        $module_class = ET_Builder_Element::add_module_order_class('', $function_name);
        $custom_table_icon = 'on' === $button_custom && '' !== $custom_icon ? $custom_icon : $et_pb_pricing_tables_icon;
        if ('' !== $button_url && '' !== $button_text) {
            $button_text = sprintf('<a class="et_pb_pricing_table_button et_pb_button%4$s" href="%1$s"%3$s>%2$s</a>', esc_url($button_url), esc_html($button_text), '' !== $custom_table_icon ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($custom_table_icon))) : '', '' !== $custom_table_icon ? ' et_pb_custom_button_icon' : '');
        }
        $output = sprintf('<div class="et_pb_pricing_table%1$s%9$s">
				<div class="et_pb_pricing_heading">
					%2$s
					%3$s
				</div> <!-- .et_pb_pricing_heading -->
				<div class="et_pb_pricing_content_top">
					<span class="et_pb_et_price">%6$s%7$s%8$s</span>
				</div> <!-- .et_pb_pricing_content_top -->
				<div class="et_pb_pricing_content">
					<ul class="et_pb_pricing">
						%4$s
					</ul>
				</div> <!-- .et_pb_pricing_content -->
				%5$s
			</div>', 'off' !== $featured ? ' et_pb_featured_table' : '', '' !== $title ? sprintf('<h2 class="et_pb_pricing_title">%1$s</h2>', esc_html($title)) : '', '' !== $subtitle ? sprintf('<span class="et_pb_best_value">%1$s</span>', esc_html($subtitle)) : '', do_shortcode(et_pb_fix_shortcodes(et_pb_extract_items($content))), $button_text, '' !== $currency ? sprintf('<span class="et_pb_dollar_sign">%1$s</span>', esc_html($currency)) : '', '' !== $sum ? sprintf('<span class="et_pb_sum">%1$s</span>', esc_html($sum)) : '', '' !== $per ? sprintf('<span class="et_pb_frequency">/%1$s</span>', esc_html($per)) : '', esc_attr($module_class));
        return $output;
    }