protected function content($atts, $content = null) { extract(shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'alignment' => 'left', 'style' => '', 'border_color' => '', 'img_link_large' => false, 'link' => '', 'team_name' => '', 'team_job' => '', 'team_socials' => '', 'website_link' => '', 'email_link' => '', 'facebook_link' => '', 'twitter_link' => '', 'pinterest_link' => '', 'linkedin_link' => '', 'google_link' => '', 'dribbble_link' => '', 'youtube_link' => '', 'vimeo_link' => '', 'rss_link' => '', 'github_link' => '', 'delicious_link' => '', 'flickr_link' => '', 'lastfm_link' => '', 'tumblr_link' => '', 'deviantart_link' => '', 'skype_link' => '', 'instagram_link' => '', 'stumbleupon_link' => '', 'behance_link' => '', 'soundcloud_link' => '', 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_team_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } $style = $style != '' ? $style : ''; $el_style = ''; $img_size = esc_html($img_size); if ($border_color != '') { if ($style == 'vc_box_border' || $style == 'vc_box_border_circle') { $el_style = 'background-color:' . esc_attr($border_color) . ';'; } if ($style == 'vc_box_outline' || $style == 'vc_box_outline_circle') { $el_style = 'border-color:' . esc_attr($border_color) . ';'; } } $img_id = preg_replace('/[^\\d]/', '', $image); if ($border_color != '' && ($style == 'vc_box_border' || $style == 'vc_box_border_circle' || $style == 'vc_box_outline' || $style == 'vc_box_outline_circle')) { $img = wt_wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style, 'style' => $el_style)); } else { $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style)); } if ($img == NULL) { $img['thumbnail'] = '<img class="' . $style . '" src="' . $this->assetUrl('vc/no_image.png') . '" />'; } //' <small>'.__('This is image placeholder, edit your page to replace it.', 'wt_vcsc').'</small>'; // parse link $link = $link == '||' ? '' : $link; $link = vc_build_link($link); $a_href = $link['url']; $a_title = $link['title']; $a_title_output = $a_title != '' ? ' title="' . esc_attr($a_title) . '"' : ''; $a_target = $link['target']; $a_target_output = $a_target != '' ? ' target="' . $a_target . '"' : ''; $link_to = ''; $a_class = ''; if ($img_link_large == true) { $link_to = wp_get_attachment_image_src($img_id, 'large'); $link_to = $link_to[0]; wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $a_class = ' class="prettyphoto"'; $a_target_output = ''; } else { if (!empty($a_href)) { $link_to = esc_url($a_href); } } if (!empty($link_to) && !preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) { $link_to = 'http://' . $link_to; } $img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail']; $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . $a_title_output . $a_target_output . '>' . $img_output . '</a>' : $img_output; trim($team_name) == false ? $team_name = esc_html($team_name) : ''; trim($team_job) == false ? $team_job = esc_html($team_job) : ''; $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= ' wt_align_' . $alignment; $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content $team_soc_output = ''; if ($team_socials != '') { $team_socials = array_map('trim', explode(',', $team_socials)); if (is_array($team_socials) && !empty($team_socials)) { $team_soc_output .= "\n\t\t\t" . '<ul class="wt_team_social">'; foreach ($team_socials as $index => $icon) { $icon_link = $icon . '_link'; switch ($icon) { case 'website': $icon_output = '<i class="entypo-link"></i>'; break; case 'email': $icon_output = '<i class="fa-envelope"></i>'; break; case 'facebook': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'twitter': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'pinterest': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'linkedin': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'google': $icon_output = '<i class="entypo-gplus"></i>'; break; case 'dribbble': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'youtube': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'vimeo': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'rss': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'github': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'delicious': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'flickr': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; //case 'forrst' : $icon_output = '<i class="fa-'.$icon.'"></i>'; break; //case 'forrst' : $icon_output = '<i class="fa-'.$icon.'"></i>'; break; case 'lastfm': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'tumblr': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'deviantart': $icon_output = '<i class="fa-' . $icon . '"></i>'; break; case 'skype': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'instagram': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'stumbleupon': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'behance': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; case 'soundcloud': $icon_output = '<i class="entypo-' . $icon . '"></i>'; break; } if (${$icon_link} == false) { // if there is not set the social link, put '#' as a placeholder $team_soc_output .= "\n\t\t\t\t" . '<li>'; $team_soc_output .= "\n\t\t\t\t\t" . '<a href="#" title="' . $icon . '" target="_blank">' . $icon_output . '</a>'; $team_soc_output .= "\n\t\t\t\t" . '</li>'; } else { $team_soc_output .= "\n\t\t\t\t" . '<li>'; $team_soc_output .= "\n\t\t\t\t\t" . '<a href="' . esc_url(${$icon_link}) . '" title="' . $icon . '" target="_blank">' . $icon_output . '</a>'; $team_soc_output .= "\n\t\t\t\t" . '</li>'; } } $team_soc_output .= "\n\t\t\t" . '</ul>'; } } $output = '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; $output .= "\n\t" . '<div class="wt_view">'; $output .= "\n\t\t" . $image_string; $output .= "\n\t\t" . '<div class="wt_team_content">'; $output .= "\n\t\t" . '<div class="wt_team_description">'; $output .= "\n\t\t\t" . $content; $output .= $team_soc_output; $output .= "\n\t\t" . '</div>'; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div>'; $output .= "\n\t" . '<div class="wt_team_info">'; $output .= "\n\t\t" . '<h5 class="wt_team_title">' . $team_name . '</h5>'; $output .= "\n\t\t" . '<span class="wt_team_job">' . $team_job . '</span>'; $output .= "\n\t" . '</div>'; $output .= '</div>'; return $output; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'style' => '', 'border_color' => '', 'img_link_large' => false, 'link' => '', 'name' => '', 'name_link' => '', 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_testimonial_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } $style = $style != '' ? $style : ''; $el_style = ''; $img_size = esc_html($img_size); if ($border_color != '') { if ($style == 'vc_box_border' || $style == 'vc_box_border_circle') { $el_style = 'background-color:' . esc_attr($border_color) . ';'; } if ($style == 'vc_box_outline' || $style == 'vc_box_outline_circle') { $el_style = 'border-color:' . esc_attr($border_color) . ';'; } } $img_id = preg_replace('/[^\\d]/', '', $image); if ($border_color != '' && ($style == 'vc_box_border' || $style == 'vc_box_border_circle' || $style == 'vc_box_outline' || $style == 'vc_box_outline_circle')) { $img = wt_wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style, 'style' => $el_style)); } else { $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style)); } // parse name link $name_link = $name_link == '||' ? '' : $name_link; $name_link = vc_build_link($name_link); $a_name_href = $name_link['url']; $a_name_title = $name_link['title']; $a_name_title_output = $a_name_title != '' ? ' title="' . esc_attr($a_name_title) . '"' : ''; $a_name_target = $name_link['target']; $a_name_target_output = $a_name_target != '' ? ' target="' . $a_name_target . '"' : ''; $name_link_to = ''; if (!empty($a_name_href)) { $name_link_to = esc_url($a_name_href); } // parse image link $link = $link == '||' ? '' : $link; $link = vc_build_link($link); $a_href = $link['url']; $a_title = $link['title']; $a_title_output = $a_title != '' ? ' title="' . esc_attr($a_title) . '"' : ''; $a_target = $link['target']; $a_target_output = $a_target != '' ? ' target="' . $a_target . '"' : ''; $link_to = ''; $a_class = ''; if ($img_link_large == true) { $link_to = wp_get_attachment_image_src($img_id, 'large'); $link_to = $link_to[0]; wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $a_class = ' class="prettyphoto"'; $a_target_output = ''; } else { if (!empty($a_href)) { $link_to = esc_url($a_href); } } if (!empty($link_to) && !preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) { $link_to = 'http://' . $link_to; } $img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail']; $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . $a_title_output . $a_target_output . '>' . $img_output . '</a>' : $img_output; //trim($name) == false ? $name = esc_html( $name ) : ''; trim($name) == false ? $name = $name : ''; $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $name_string = !empty($name_link_to) ? '<a href="' . $name_link_to . '"' . $a_name_title_output . $a_name_target_output . '>' . $name . '</a>' : $name; $content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content $output = '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; $output .= "\n\t" . '<div class="wt_testimonial_content">'; $output .= "\n\t\t" . $content; $output .= "\n\t" . '</div>'; $output .= "\n\t" . '<div class="wt_testimonial_bottom clearfix">'; $output .= "\n\t\t" . '<div class="wt_testimonial_avatar">'; $output .= "\n\t\t\t" . $image_string; $output .= "\n\t\t" . '</div>'; $output .= "\n\t\t" . '<div class="wt_testimonial_meta">'; $output .= "\n\t\t\t" . '<p class="wt_testimonial_author">' . $name_string . '</p>'; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div>'; $output .= '</div>'; return $output; }
protected function content($atts, $content = null) { extract(shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'style' => '', 'border_color' => '', 'icon' => '', 'icon_type' => '', 'icon_style' => '', 'default_icon' => '', 'border_style' => '', 'icon_background' => '', 'icon_color' => '', 'icon_size' => 32, 'alignment' => 'left', 'empty_space' => '', 'title' => '', 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts)); $sc_class = 'wt_service_box_sc'; $id = mt_rand(9999, 99999); if (trim($el_id) != false) { $el_id = esc_attr(trim($el_id)); } else { $el_id = $sc_class . '-' . $id; } $style = $style != '' ? $style : ''; $el_style = ''; $inline_style = ''; $img_output = ''; // Service Image Output if ($border_color != '') { if ($style == 'vc_box_border' || $style == 'vc_box_border_circle') { $el_style = 'background-color:' . esc_attr($border_color) . ';'; } if ($style == 'vc_box_outline' || $style == 'vc_box_outline_circle') { $el_style = 'border-color:' . esc_attr($border_color) . ';'; } } $img_id = preg_replace('/[^\\d]/', '', $image); if ($border_color != '' && ($style == 'vc_box_border' || $style == 'vc_box_border_circle' || $style == 'vc_box_outline' || $style == 'vc_box_outline_circle')) { $img = wt_wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style, 'style' => $el_style)); } else { $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style)); } $img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail']; // Service Icon Output if ($default_icon == 'yes') { $icon_default = ' wt_icon_default'; } else { $icon_default = ''; } if ($icon_background != '') { $icon_background = 'background: ' . $icon_background . ';'; } if ($icon_color != '') { if ($icon_type != 'wt_icon_type_3') { $icon_color = 'color: ' . $icon_color . ';'; } else { $icon_color = 'color: ' . $icon_color . ';' . 'border-color: ' . $icon_color . ';'; } } if ($icon_background != '' || $icon_color != '') { $inline_style = ' style="' . $icon_color . $icon_background . '"'; } if ($icon_type != 'wt_icon_type_3') { $border_style = ''; // Add border style only for type_3 icons } else { $border_style = ' wt_icon_border_' . $border_style; } $icon = esc_html($icon); $title = esc_html($title); if ($icon_type != 'wt_icon_type_2' && $icon_type != 'wt_icon_type_3') { $icon_style = ''; // Add icon style (rounded, squared and circle) ony for type2 and type3 icons } else { $icon_style = ' ' . $icon_style; } $icon_type = ' ' . $icon_type; $icon_size = ' wt_icon_' . $icon_size; if ($icon != '') { $icon_out = '<i class="' . $icon . '"></i>'; } else { $icon_out = ''; } if ($empty_space == 'yes') { $empty_space = ' wt_overflow_hidden'; } else { $empty_space = ''; } if ($title != '') { $title_out = '<h4>' . $title . '</h4>'; } else { $title_out = ''; } $el_class = esc_attr($this->getExtraClass($el_class)); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= ' wt_align_' . $alignment; $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type); $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay); $content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content $output = '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>'; if ($icon_out != '') { $output .= "\n\t" . '<div class="wt_icon' . $icon_type . $icon_style . $border_style . $icon_size . $icon_default . '"' . $inline_style . '>'; $output .= $icon_out; $output .= "\n\t" . '</div>'; } if ($img_output != '') { $output .= "\n\t" . '<div class="wt_service_img">'; $output .= $img_output; $output .= "\n\t" . '</div>'; } $output .= '<div class="wt_service_details' . $empty_space . '">'; $output .= "\n\t" . $title_out; $output .= "\n\t" . $content; $output .= '</div>'; $output .= '</div>'; return $output; }