예제 #1
0
 function grve_promo_shortcode($atts, $content)
 {
     $output = $button = $retina_data = $el_class = '';
     extract(shortcode_atts(array('image' => '', 'retina_image' => '', 'align' => 'left', 'button_text' => '', 'button_link' => '', 'button_type' => 'simple', 'button_size' => 'medium', 'button_color' => 'primary-1', 'button_shape' => 'square', 'button_class' => '', 'margin_bottom' => '', 'el_class' => ''), $atts));
     //Button
     $button = grve_osmosis_vce_get_button($button_text, $button_link, $button_type, $button_size, $button_color, $button_shape, $button_class);
     $image_string = '';
     if (!empty($image)) {
         $id = preg_replace('/[^\\d]/', '', $image);
         $thumb_src = wp_get_attachment_image_src($id, 'full');
         $image_dimensions = 'width="' . $thumb_src[1] . '" height="' . $thumb_src[2] . '"';
         if (!empty($retina_image)) {
             $img_retina_id = preg_replace('/[^\\d]/', '', $retina_image);
             $img_retina_src = wp_get_attachment_image_src($img_retina_id, 'full');
             $retina_data = ' data-at2x="' . esc_attr($img_retina_src[0]) . '"';
         }
         $alt = get_post_meta($id, '_wp_attachment_image_alt', true);
         $alt = !empty($alt) ? esc_attr($alt) : '';
         $image_string .= '<img class="grve-partner-logo" src="' . esc_url($thumb_src[0]) . '" alt="' . $alt . '" ' . $image_dimensions . $retina_data . '>';
     }
     $output .= '<div class="grve-element grve-partner-advanced grve-align-' . $align . ' ' . esc_attr($el_class) . '">';
     $output .= $image_string;
     $output .= '  <div class="grve-partner-content">';
     $output .= '    <p class="grve-leader-text">' . $content . '</p>';
     $output .= $button;
     $output .= '  </div>';
     $output .= '</div>';
     return $output;
 }
예제 #2
0
 function grve_slogan_shortcode($atts, $content)
 {
     $output = $data = $el_class = $text_style_class = '';
     extract(shortcode_atts(array('title' => '', 'heading' => 'h1', 'line_type' => 'no-line', 'subtitle' => '', 'button_text' => '', 'button_link' => '', 'button_type' => 'simple', 'button_size' => 'medium', 'button_color' => 'primary-1', 'button_shape' => 'square', 'button_class' => '', 'button2_text' => '', 'button2_link' => '', 'button2_type' => 'simple', 'button2_size' => 'medium', 'button2_color' => 'primary-1', 'button2_shape' => 'square', 'button2_class' => '', 'text_style' => 'none', 'align' => 'left', 'animation' => '', 'animation_delay' => '200', 'margin_bottom' => '', 'el_class' => ''), $atts));
     //Title
     if (!empty($title)) {
         //Title Classes
         $title_classes = array('grve-slogan-title');
         array_push($title_classes, 'grve-align-' . $align);
         array_push($title_classes, 'grve-title-' . $line_type);
         $title_class_string = implode(' ', $title_classes);
     }
     //Slogan
     $slogan_classes = array('grve-element', 'grve-slogan', 'grve-align-' . $align);
     if (!empty($animation)) {
         array_push($slogan_classes, 'grve-animated-item');
         array_push($slogan_classes, $animation);
         $data = ' data-delay="' . esc_attr($animation_delay) . '"';
     }
     if (!empty($el_class)) {
         array_push($slogan_classes, $el_class);
     }
     $slogan_class_string = implode(' ', $slogan_classes);
     // Paragraph
     if ('none' != $text_style) {
         $text_style_class = 'grve-' . $text_style;
     }
     //First Button
     $button1 = grve_osmosis_vce_get_button($button_text, $button_link, $button_type, $button_size, $button_color, $button_shape, $button_class);
     //Second Button
     $button2 = grve_osmosis_vce_get_button($button2_text, $button2_link, $button2_type, $button2_size, $button2_color, $button2_shape, $button2_class);
     $style = grve_osmosis_vce_build_margin_bottom_style($margin_bottom);
     $output .= '<div class="' . esc_attr($slogan_class_string) . '" style="' . $style . '"' . $data . '>';
     if (!empty($subtitle)) {
         $output .= '<div class="grve-subtitle">' . $subtitle . '</div>';
     }
     if (!empty($title)) {
         $output .= '<' . $heading . ' class="' . esc_attr($title_class_string) . '"><span>' . $title . '</span></' . $heading . '>';
     }
     $output .= '  <p class="' . esc_attr($text_style_class) . '">' . $content . '</p>';
     $output .= $button1;
     $output .= $button2;
     $output .= '</div>';
     return $output;
 }
예제 #3
0
 function grve_pricing_table_shortcode($atts, $content)
 {
     $output = $data = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'price' => '', 'interval' => '', 'feature' => '', 'values' => '', 'button_text' => '', 'button_link' => '', 'button_type' => 'simple', 'button_size' => 'medium', 'button_color' => 'primary-1', 'button_shape' => 'square', 'button_class' => '', 'bg_color' => '', 'animation' => '', 'animation_delay' => '200', 'margin_bottom' => '', 'el_class' => ''), $atts));
     $button = grve_osmosis_vce_get_button($button_text, $button_link, $button_type, $button_size, $button_color, $button_shape, $button_class);
     //Pricing Table Classes
     $pricing_classes = array('grve-element', 'grve-pricing-table');
     if ('yes' == $feature) {
         array_push($pricing_classes, 'grve-pricing-feature');
     }
     if (!empty($animation)) {
         array_push($pricing_classes, 'grve-animated-item');
         array_push($pricing_classes, $animation);
         $data = ' data-delay="' . esc_attr($animation_delay) . '"';
     }
     if (!empty($el_class)) {
         array_push($pricing_classes, $el_class);
     }
     $pricing_class_string = implode(' ', $pricing_classes);
     //Pricing Lines
     $pricing_lines = explode(",", $values);
     $pricing_lines_data = array();
     foreach ($pricing_lines as $line) {
         $new_line = array();
         $data_line = explode("|", $line);
         $new_line['value1'] = isset($data_line[0]) && !empty($data_line[0]) ? $data_line[0] : '';
         $new_line['value2'] = isset($data_line[1]) && !empty($data_line[1]) ? $data_line[1] : '';
         $pricing_lines_data[] = $new_line;
     }
     $style = grve_osmosis_vce_build_margin_bottom_style($margin_bottom);
     $output .= '<div class="' . $pricing_class_string . '" style="' . $style . '"' . $data . '>';
     $output .= '  <div class="grve-pricing-header">';
     $output .= '    <h6 class="grve-pricing-title">' . $title . '</h6>';
     $output .= '    <h4 class="grve-price">' . $price . ' <span>' . $interval . '</span></h4>';
     $output .= '  </div>';
     $output .= '  <ul>';
     foreach ($pricing_lines_data as $line) {
         $output .= '<li><strong>' . $line['value1'] . ' </strong>' . $line['value2'] . '</li>';
     }
     $output .= '  </ul>';
     $output .= $button;
     $output .= '</div>';
     return $output;
 }
예제 #4
0
 function grve_calout_shortcode($atts, $content)
 {
     $output = $button = $data = $class_leader = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'button_text' => '', 'button_link' => '', 'button_type' => 'simple', 'btn_position' => 'btn-right', 'button_size' => 'medium', 'button_color' => 'primary-1', 'button_shape' => 'square', 'button_class' => '', 'leader_text' => '', 'animation' => '', 'animation_delay' => '200', 'margin_bottom' => '', 'el_class' => ''), $atts));
     if ('yes' == $leader_text) {
         $class_leader = 'grve-leader-text';
     }
     //Button
     $button = grve_osmosis_vce_get_button($button_text, $button_link, $button_type, $button_size, $button_color, $button_shape, $button_class);
     $callout_classes = array('grve-element', 'grve-callout');
     if (!empty($animation)) {
         array_push($callout_classes, 'grve-animated-item');
         array_push($callout_classes, $animation);
         $data = ' data-delay="' . esc_attr($animation_delay) . '"';
     }
     if (!empty($el_class)) {
         array_push($callout_classes, $el_class);
     }
     array_push($callout_classes, 'grve-' . $btn_position);
     $callout_class_string = implode(' ', $callout_classes);
     $style = grve_osmosis_vce_build_margin_bottom_style($margin_bottom);
     $output .= '<div class="' . esc_attr($callout_class_string) . '" style="' . $style . '">';
     $output .= '  <div class="grve-callout-wrapper">';
     if (!empty($title)) {
         $output .= '    <h5 class="grve-callout-content">' . $title . '</h5>';
     }
     if (!empty($content)) {
         $output .= '    <p class="' . esc_attr($class_leader) . '">' . $content . '</p>';
     }
     $output .= '  </div>';
     $output .= '  <div class="grve-button-wrapper">';
     $output .= $button;
     $output .= '  </div>';
     $output .= '</div>';
     return $output;
 }