示例#1
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode_full($atts = null, $content = null)
 {
     extract(shortcode_atts($this->config['params'], $atts));
     $content_class = !empty($image_file) ? 'carousel-caption' : 'carousel-content';
     $img = !empty($image_file) ? "<img width='{WIDTH}' height='{HEIGHT}' src='{$image_file}' alt='{$alt}' style='height : {HEIGHT}px;'>" : '';
     // remove image shortcode in content
     $content = WR_Pb_Helper_Shortcode::remove_wr_shortcodes($content, 'wr_image');
     $inner_content = WR_Pb_Helper_Shortcode::remove_autop($content);
     WR_Pb_Helper_Functions::heading_icon($heading, $icon, true);
     $heading = trim($heading);
     $inner_content = trim($inner_content);
     if (empty($heading) && empty($inner_content)) {
         $html_content = "";
     } else {
         $html_content = "<div class='{$content_class}'>";
         $html_content .= !empty($heading) ? "<h4><i class='{$icon}'></i>{$heading}</h4>" : '';
         $html_content .= !empty($inner_content) ? "<p>{$inner_content}</p>" : '';
         $html_content .= "</div>";
     }
     return "<div class='{active} item'>{$img}{$html_content}</div><!--seperate-->";
 }
示例#2
0
 /**
  * Get post excerpt (can't use WP excerpt function, because post content contains IGPB shortcodes)
  *
  * @param type $post_content
  *
  * @return type
  */
 static function post_excerpt($post_content)
 {
     $excerpt = WR_Pb_Helper_Shortcode::remove_wr_shortcodes($post_content);
     return strip_tags($excerpt);
 }