function x_shortcode_icon($atts) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => '', 'icon_color' => '', 'icon_size' => '', 'bg_color' => '', 'bg_size' => '', 'bg_border_radius' => ''), $atts, 'x_icon')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-icon ' . esc_attr($class) : 'x-icon'; $style = $style != '' ? $style : ''; $type = $type != '' ? $type : ''; $icon_color = $icon_color != '' ? 'color: ' . $icon_color . ';' : ''; $icon_size = $icon_size != '' ? 'font-size: ' . $icon_size . ';' : ''; $bg_color = $bg_color != '' ? 'background-color: ' . $bg_color . ';' : ''; $bg_size = $bg_size != '' ? 'width: ' . $bg_size . '; height: ' . $bg_size . '; line-height: ' . $bg_size . ';' : ''; $bg_border_radius = $bg_border_radius != '' ? 'border-radius: ' . $bg_border_radius . ';' : ''; $styles = array($icon_color, $icon_size, $bg_color, $bg_size, $bg_border_radius, $style); $check = array_diff($styles, array('')); if (!empty($check)) { $styles_output = ''; foreach ($styles as $style) { $styles_output .= $style . ' '; } $style = ' style="' . trim($styles_output) . '"'; } $unicode = fa_unicode($type); $output = "<i {$id} class=\"{$class} x-icon-{$type}\"{$style} data-x-icon=\"&#x{$unicode};\" aria-hidden=\"true\"></i>"; return $output; }
function x_shortcode_creative_cta($atts) { // 1 extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'padding' => '', 'text' => '', 'font_size' => '', 'icon' => '', 'icon_size' => '', 'image' => '', 'image_width' => '', 'animation' => '', 'link' => '', 'color' => '', 'bg_color' => '', 'bg_color_hover' => ''), $atts, 'x_creative_cta')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-creative-cta ' . esc_attr($class) : 'x-creative-cta'; $style = $style != '' ? ' ' . $style : ''; $padding = $padding != '' ? $padding : '35px'; $text = $text != '' ? wp_specialchars_decode($text, ENT_QUOTES) : 'Place Your<br>Text Here'; $font_size = $font_size != '' ? $font_size : '36px'; $icon = $icon != '' ? $icon : ''; $icon_size = $icon_size != '' ? $icon_size : '36px'; $image = $image != '' ? $image : ''; $image_width = $image_width != '' ? $image_width : ''; $animation = $animation != '' ? ' ' . $animation : ''; $link = $link != '' ? $link : '#'; $color = $color != '' ? $color : '#ffffff'; $bg_color = $bg_color != '' ? $bg_color : '#ff2a13'; $bg_color_hover = $bg_color_hover != '' ? $bg_color_hover : '#d80f0f'; if ($animation != '') { if ($image != '') { $graphic = '<span class="graphic"><img style="margin: 0; width: ' . $image_width . ';" src="' . $image . '"></span>'; } else { if ($icon != '') { $graphic = '<span class="graphic"><i style="margin: 0; font-size: ' . $icon_size . ';" class="x-icon-' . $icon . '" data-x-icon="&#x' . fa_unicode($icon) . ';"></i></span>'; } } } else { $graphic = ''; } $js_params = array('animation' => $animation, 'bg_color' => $bg_color, 'bg_color_hover' => $bg_color_hover); $data = cs_generate_data_attributes('creative_cta', $js_params); $output = "<a {$id} class=\"{$class}{$animation}\" href=\"{$link}\" style=\"padding: {$padding}; color: {$color}; background-color: {$bg_color};{$style}\" {$data}>" . "<span class=\"text\" style=\"font-size: {$font_size};\">{$text}</span>" . $graphic . "</a>"; return $output; }
function x_shortcode_callout($atts) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => '', 'title' => '', 'message' => '', 'button_text' => '', 'button_icon' => '', 'circle' => '', 'href' => '', 'href_title' => '', 'target' => ''), $atts, 'x_callout')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-callout ' . esc_attr($class) : 'x-callout'; $style = $style != '' ? 'style="' . $style . '"' : ''; switch ($type) { case 'center': $type = ' center-text'; break; case 'right': $type = ' right-text'; break; default: $type = ''; } $title = $title != '' ? $title : 'Enter Your Text'; $message = $message != '' ? $message : 'Don\'t forget to enter in your text.'; $button_text = $button_text != '' ? $button_text : 'Enter Your Text'; $button_icon = $button_icon != '' ? $button_icon : ''; $href = $href != '' ? $href : '#'; $href_title = $href_title != '' ? $href_title : $button_text; $target = $target == 'blank' ? 'target="_blank"' : ''; if ($button_icon != '') { $unicode = fa_unicode($button_icon); $button_icon = '<i class="x-icon-' . $button_icon . '" data-x-icon="&#x' . $unicode . ';"></i>'; } if ($circle == 'true') { $button = "<div class=\"x-btn-circle-wrap mbn\"><a href=\"{$href}\" class=\"x-btn x-btn-x-large\" title=\"{$href_title}\" {$target}>{$button_icon}{$button_text}</a></div>"; } else { $button = "<a href=\"{$href}\" class=\"x-btn\" title=\"{$href_title}\" {$target}>{$button_icon}{$button_text}</a>"; } $output = "<div {$id} class=\"{$class}{$type}\" {$style}>" . "<h2 class=\"h-callout\">{$title}</h2>" . "<p class=\"p-callout\">{$message}</p>" . $button . '</div>'; return $output; }
function x_shortcode_feature_headline($atts, $content = null) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => '', 'level' => '', 'looks_like' => '', 'icon' => ''), $atts, 'x_feature_headline')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'h-feature-headline ' . esc_attr($class) : 'h-feature-headline'; $style = $style != '' ? 'style="' . $style . '"' : ''; switch ($type) { case 'right': $type = ' right-text'; break; case 'center': $type = ' center-text'; break; default: $type = ''; } $level = $level != '' ? $level : 'h2'; $looks_like = $looks_like != '' ? ' ' . $looks_like : ''; $icon = $icon != '' ? $icon : ''; if ($icon != '') { $unicode = fa_unicode($icon); $icon = '<i class="x-icon-' . $icon . '" data-x-icon="&#x' . $unicode . ';"></i>'; } $output = "<{$level} {$id} class=\"{$class}{$type}{$looks_like}\" {$style}><span>{$icon}" . do_shortcode($content) . "</span></{$level}>"; return $output; }
function x_shortcode_icon_list_item($atts, $content = null) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => '', 'icon_color' => '', 'href' => '', 'href_title' => '', 'href_target' => ''), $atts, 'x_icon_list_item')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-li-icon ' . esc_attr($class) : 'x-li-icon'; $style = $style != '' ? 'style="' . $style . '"' : ''; $type = $type != '' ? $type : ''; $icon_color = $icon_color != '' ? $icon_color : ''; $href = $href != '' ? $href : '#'; $href_title = $href_title != '' ? ' title="' . $href_title . '"' : ''; $href_target = $href_target == 'blank' ? ' target="_blank"' : ''; if ($icon_color != '') { $icon_style = ' style="color: ' . $icon_color . ';"'; } else { $icon_style = ''; } if ($href != '#') { $link_begin = "<a href=\"{$href}\"{$href_title}{$href_title}{$href_target}>"; $link_end = '</a>'; } else { $link_begin = ''; $link_end = ''; } $unicode = fa_unicode($type); $output = "<li {$id} class=\"{$class}\" {$style}>" . "<i class=\"x-icon-{$type}\"{$icon_style} data-x-icon=\"&#x{$unicode};\" aria-hidden=\"true\"></i>" . $link_begin . do_shortcode($content) . $link_end . "</li>"; return $output; }
function x_shortcode_prompt($atts) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => '', 'title' => '', 'message' => '', 'button_text' => '', 'button_icon' => '', 'circle' => '', 'href' => '', 'href_title' => '', 'target' => ''), $atts, 'x_prompt')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-prompt ' . esc_attr($class) : 'x-prompt'; $style = $style != '' ? 'style="' . $style . '"' : ''; $type = $type != '' ? $type : ''; $title = $title != '' ? $title : 'Enter Your Text'; $message = $message != '' ? $message : 'Don\'t forget to enter in your text.'; $button_text = $button_text != '' ? $button_text : 'Enter Your Text'; $button_icon = $button_icon != '' ? $button_icon : ''; $href = $href != '' ? $href : '#'; $href_title = $href_title != '' ? $href_title : $button_text; $target = $target == 'blank' ? 'target="_blank"' : ''; if ($button_icon != '') { $unicode = fa_unicode($button_icon); $button_icon = '<i class="x-icon-' . $button_icon . '" data-x-icon="&#x' . $unicode . ';"></i>'; } if ($circle == 'true') { $button = "<div class=\"x-btn-circle-wrap x-btn-block mbn\"><a href=\"{$href}\" class=\"x-btn x-btn-block\" title=\"{$href_title}\" {$target}>{$button_icon}{$button_text}</a></div>"; } else { $button = "<a href=\"{$href}\" class=\"x-btn x-btn-block\" title=\"{$href_title}\" {$target}>{$button_icon}{$button_text}</a>"; } if ($type == 'right') { $output = "<div {$id} class=\"{$class} message-right\" {$style}>" . '<div class="x-prompt-section x-prompt-section-button">' . $button . '</div>' . '<div class="x-prompt-section x-prompt-section-message">' . "<h2 class=\"h-prompt\">{$title}</h2>" . "<p class=\"p-prompt\">{$message}</p>" . '</div>' . '</div>'; } else { $output = "<div {$id} class=\"{$class} message-left\" {$style}>" . '<div class="x-prompt-section x-prompt-section-message">' . "<h2 class=\"h-prompt\">{$title}</h2>" . "<p class=\"p-prompt\">{$message}</p>" . '</div>' . '<div class="x-prompt-section x-prompt-section-button">' . $button . '</div>' . '</div>'; } return $output; }
function x_shortcode_icon_list_item($atts, $content = null) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => ''), $atts, 'x_icon_list_item')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-li-icon ' . esc_attr($class) : 'x-li-icon'; $style = $style != '' ? 'style="' . $style . '"' : ''; $type = $type != '' ? $type : ''; $unicode = fa_unicode($type); $output = "<li {$id} class=\"{$class}\" {$style}><i class=\"x-icon-{$type}\" data-x-icon=\"&#x{$unicode};\"></i>" . do_shortcode($content) . "</li>"; return $output; }
function x_shortcode_icon($atts) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'type' => ''), $atts, 'x_icon')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-icon ' . esc_attr($class) : 'x-icon'; $style = $style != '' ? 'style="' . $style . '"' : ''; $type = $type != '' ? $type : ''; $unicode = fa_unicode($type); $output = "<i {$id} class=\"{$class} x-icon-{$type}\" {$style} data-x-icon=\"&#x{$unicode};\" aria-hidden=\"true\"></i>"; return $output; }
function x_shortcode_card($atts) { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'animation' => '', 'center_vertically' => '', 'front_style' => '', 'front_icon' => '', 'front_icon_size' => '', 'front_icon_color' => '', 'front_image' => '', 'front_image_width' => '', 'front_title' => '', 'front_text' => '', 'back_style' => '', 'back_title' => '', 'back_text' => '', 'back_button_enabled' => 'true', 'back_button_text' => '', 'back_button_link' => '', 'back_button_color' => '', 'back_button_bg_color' => '', 'padding' => ''), $atts, 'x_card')); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-card-outer ' . esc_attr($class) : 'x-card-outer'; $style = $style != '' ? 'style="' . $style . '"' : ''; $animation = $animation != '' ? ' ' . $animation : ' flip-from-left'; $center_vertically = $center_vertically == 'true' ? ' center-vertically' : ''; $front_style = $front_style != '' ? $front_style : 'border: 1px solid #ddd; color: #272727; background-color: #fafafa;'; $front_icon = $front_icon != '' ? $front_icon : ''; $front_icon_size = $front_icon_size != '' ? $front_icon_size : '36px'; $front_icon_color = $front_icon_color != '' ? $front_icon_color : '#272727'; $front_image = $front_image != '' ? $front_image : ''; $front_image_width = $front_image_width != '' ? $front_image_width : 'auto'; $front_title = $front_title != '' ? wp_specialchars_decode($front_title, ENT_QUOTES) : 'Front Title'; $front_text = $front_text != '' ? wp_specialchars_decode($front_text, ENT_QUOTES) : 'This is where the text for the front of your card should go. It\'s best to keep it short and sweet.'; $back_style = $back_style != '' ? $back_style : 'border: 1px solid #ddd; color: #272727; background-color: #fafafa;'; $back_title = $back_title != '' ? wp_specialchars_decode($back_title, ENT_QUOTES) : 'Back Title'; $back_text = $back_text != '' ? wp_specialchars_decode($back_text, ENT_QUOTES) : 'This is where the text for the back of your card should go.'; $back_button_text = $back_button_text != '' ? $back_button_text : 'Click Me!'; $back_button_link = $back_button_link != '' ? $back_button_link : '#'; $back_button_color = $back_button_color != '' ? $back_button_color : '#ffffff'; $back_button_bg_color = $back_button_bg_color != '' ? $back_button_bg_color : '#ff2a13'; $padding = $padding != '' ? $padding : '35px'; if ($front_image != '') { $front_graphic = '<div class="x-face-graphic"><img style="margin: 0; width: ' . $front_image_width . ';" src="' . $front_image . '"></div>'; } else { if ($front_icon != '') { $front_graphic = '<div class="x-face-graphic"><i style="margin: 0; font-size: ' . $front_icon_size . '; color: ' . $front_icon_color . ';" class="x-icon-' . $front_icon . '" data-x-icon="&#x' . fa_unicode($front_icon) . ';"></i></div>'; } else { $front_graphic = ''; } } $data = cs_generate_data_attributes('card', array()); $button_markup = ''; if ('true' == $back_button_enabled) { $button_markup = "<a class=\"x-face-button\" style=\"color: {$back_button_color}; background-color: {$back_button_bg_color};\" href=\"{$back_button_link}\">{$back_button_text}</a>"; } $output = "<div {$id} class=\"{$class}{$animation}{$center_vertically}\" {$data}{$style}>" . '<div class="x-card-inner">' . "<div class=\"x-face-outer front\" style=\"{$front_style}\">" . '<div class="x-face-inner">' . "<div class=\"x-face-content\" style=\"padding: {$padding};\">" . $front_graphic . "<h4 class=\"x-face-title\">{$front_title}</h4>" . "<p class=\"x-face-text\">{$front_text}</p>" . '</div>' . '</div>' . '</div>' . "<div class=\"x-face-outer back\" style=\"{$back_style}\">" . '<div class="x-face-inner">' . "<div class=\"x-face-content\" style=\"padding: {$padding};\">" . "<h4 class=\"x-face-title\">{$back_title}</h4>" . "<p class=\"x-face-text\">{$back_text}</p>" . $button_markup . '</div>' . '</div>' . '</div>' . '</div>' . '</div>'; return $output; }
/** * Get an HTML entity for an icon * @param string $key Icon to lookup * @return string HTML entity */ function fa_entity($key) { return '&#x' . fa_unicode($key) . ';'; }
function x_shortcode_feature_box($atts, $content = '') { extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'graphic' => '', 'graphic_size' => '', 'graphic_shape' => '', 'graphic_border' => '', 'graphic_color' => '', 'graphic_bg_color' => '', 'graphic_icon' => '', 'graphic_image' => '', 'graphic_animation' => '', 'graphic_animation_offset' => '', 'graphic_animation_delay' => '', 'title' => '', 'title_color' => '', 'text' => '', 'text_color' => '', 'link_text' => '', 'link_color' => '', 'href' => '', 'href_title' => '', 'href_target' => '', 'align_h' => '', 'align_v' => '', 'side_graphic_spacing' => '', 'max_width' => '', 'child' => '', 'connector_width' => '', 'connector_style' => '', 'connector_color' => '', 'connector_animation' => ''), $atts, 'x_feature_box')); // // Allow text attribute to be used instead of content. // if ('' == $content && '' != $text) { $content = wp_specialchars_decode($text, ENT_QUOTES); } $title = wp_specialchars_decode($title, ENT_QUOTES); $id = $id != '' ? 'id="' . esc_attr($id) . '"' : ''; $class = $class != '' ? 'x-feature-box ' . esc_attr($class) : 'x-feature-box'; $style = $style != '' ? $style : ''; $graphic = $graphic != '' ? $graphic : 'icon'; $graphic_size = $graphic_size != '' ? $graphic_size : '60px'; $graphic_shape = $graphic_shape != '' ? $graphic_shape : 'square'; $graphic_border = $graphic_border != '' ? $graphic_border : ''; $graphic_color = $graphic_color != '' ? $graphic_color : '#ffffff'; $graphic_bg_color = $graphic_bg_color != '' ? $graphic_bg_color : 'transparent'; $graphic_icon = $graphic_icon != '' ? $graphic_icon : ''; $graphic_image = $graphic_image != '' ? $graphic_image : ''; $graphic_animation = $graphic_animation != '' ? $graphic_animation : 'none'; $graphic_animation_offset = $graphic_animation_offset != '' ? $graphic_animation_offset : '50'; $graphic_animation_delay = $graphic_animation_delay != '' ? $graphic_animation_delay : '0'; $title_color = $title_color != '' ? $title_color : ''; $text_color = $text_color != '' ? $text_color : ''; $link_text = $link_text != '' ? $link_text : ''; $link_color = $link_color != '' ? ' style="color: ' . $link_color . ';"' : ''; $href = $href != '' ? $href : '#'; $href_title = $href_title != '' ? $href_title : $link_text; $href_target = $href_target == 'blank' ? ' target="_blank"' : ''; $align_h = $align_h != '' ? $align_h : 'center'; $align_v = $align_v != '' ? $align_v : 'top'; $side_graphic_spacing = $side_graphic_spacing != '' ? $side_graphic_spacing : '20px'; $max_width = $max_width != '' ? ' max-width: ' . $max_width . ';' : ' max-width: none;'; $child = $child == 'true' ? $child : ''; $connector_width = $connector_width != '' ? $connector_width : '1px'; $connector_style = $connector_style != '' ? $connector_style : 'dashed'; $connector_color = $connector_color != '' ? $connector_color : '#2ecc71'; $connector_animation = $connector_animation != '' ? $connector_animation : 'none'; // // Graphic - design. // $graphic_font_size = 'font-size: ' . $graphic_size . ';'; if ($graphic_border != '' && $graphic_shape != 'hexagon' && $graphic_shape != 'badge') { $graphic_border = ' ' . $graphic_border; } else { $graphic_border = ''; } if ($graphic != 'image') { $graphic_colors = ' color: ' . $graphic_color . '; background-color: ' . $graphic_bg_color . ';'; } else { $graphic_colors = ''; } if ($graphic_shape == 'hexagon' || $graphic_shape == 'badge') { $graphic_pseudo_element_color = ' border-color: ' . $graphic_bg_color . ';'; } else { $graphic_pseudo_element_color = ''; } // // Graphic - side alignment. // if ($align_h != 'center') { $side_align_style = ' style="display: table-cell; vertical-align: ' . $align_v . ';"'; $side_graphic_spacing = $align_h == 'left' ? ' margin-right: ' . $side_graphic_spacing . ';' : ' margin-left: ' . $side_graphic_spacing . ';'; } else { $side_align_style = ''; $side_graphic_spacing = ''; } // // Graphic - attributes. // $graphic_container_class_style = ' class="x-feature-box-graphic ' . $graphic_shape . '"' . $side_align_style; $graphic_outer_class_style = ' class="x-feature-box-graphic-outer ' . $graphic_shape . cs_animation_base_class($graphic_animation) . '" style="' . $side_graphic_spacing . '"'; $graphic_inner_class_style = ' class="x-feature-box-graphic-inner ' . $graphic_shape . '" style="' . $graphic_font_size . $graphic_pseudo_element_color . '"'; $graphic_style = ' style="margin: 0 auto;' . $graphic_border . $graphic_colors . '"'; // // Graphic. // if ($graphic == 'image') { $graphic = '<div' . $graphic_container_class_style . '>' . '<div' . $graphic_outer_class_style . '>' . '<div' . $graphic_inner_class_style . '>' . '<img class="' . $graphic_shape . '" src="' . $graphic_image . '"' . $graphic_style . '>' . '</div>' . '</div>' . '</div>'; } else { if ($graphic == 'numbers' && $child == 'true') { $graphic = '<div' . $graphic_container_class_style . '>' . '<div' . $graphic_outer_class_style . '>' . '<div' . $graphic_inner_class_style . '>' . '<i class="number w-h ' . $graphic_shape . '"' . $graphic_style . '></i>' . '</div>' . '</div>' . '</div>'; } else { $graphic = '<div' . $graphic_container_class_style . '>' . '<div' . $graphic_outer_class_style . '>' . '<div' . $graphic_inner_class_style . '>' . '<i class="x-icon-' . $graphic_icon . ' ' . $graphic_shape . '" data-x-icon="&#x' . fa_unicode($graphic_icon) . ';"' . $graphic_style . '></i>' . '</div>' . '</div>' . '</div>'; } } // // Connector. // if ($child == 'true') { $left = $align_h == 'left' ? ' left: 0;' : ' left: calc(100% - ' . $graphic_size . ');'; $right = $align_h == 'right' ? ' right: 0;' : ' right: calc(100% - ' . $graphic_size . ');'; $connector_class = cs_animation_base_class($connector_animation); $connector_style = 'style="' . $graphic_font_size . $left . $right . ' border-left: ' . $connector_width . ' ' . $connector_style . ' ' . $connector_color . ';"'; $connector_text = '<span class="visually-hidden">Connector.</span>'; if ($align_v == 'top') { $connector = '<span class="x-feature-box-connector full' . $connector_class . '" ' . $connector_style . '>' . $connector_text . '</span>'; } else { $connector = '<span class="x-feature-box-connector upper' . $connector_class . '" ' . $connector_style . '>' . $connector_text . '</span>' . '<span class="x-feature-box-connector lower' . $connector_class . '" ' . $connector_style . '>' . $connector_text . '</span>'; } } else { $connector = ''; } // // Content. // $title_color = $title_color != '' ? ' style="color: ' . $title_color . ';"' : ''; $text_color = $text_color != '' ? ' style="color: ' . $text_color . ';"' : ''; $link = $link_text != '' ? ' <a href="' . $href . '" title="' . $href_title . '"' . $href_target . $link_color . '>' . $link_text . '</a>' : ''; $output = '<div class="x-feature-box-content"' . $side_align_style . '>' . '<h4 class="x-feature-box-title"' . $title_color . '>' . $title . '</h4>' . '<p class="x-feature-box-text"' . $text_color . '>' . do_shortcode($content) . $link . '</p>' . '</div>'; // // Output. // $js_params = array('child' => $child == 'true', 'graphicAnimation' => $graphic_animation); if ($child == 'true') { $js_params['connectorAnimation'] = $connector_animation; $js_params['alignH'] = $align_h; $js_params['alignV'] = $align_v; } else { $js_params['graphicAnimationOffset'] = $graphic_animation_offset; $js_params['graphicAnimationDelay'] = $graphic_animation_delay; } $data = cs_generate_data_attributes('feature_box', $js_params); $element = $child == 'true' ? 'li' : 'div'; $ordered_content = $align_h == 'right' ? $output . $graphic : $graphic . $output; $align_h = ' ' . $align_h . '-text'; $align_v = ' ' . $align_v . '-text'; $output = "<{$element} {$id} class=\"{$class}{$align_h}{$align_v} cf\" style=\"{$style}{$max_width}\" {$data}>" . $connector . $ordered_content . "</{$element}>"; return $output; }
/** * Template function that returns a data attribute for an icon * @param string $key Icon to lookup * @return string Data attribute string that can be placed inside an element tag */ function fa_data_icon($key) { return 'data-x-icon="' . fa_unicode($key) . '"'; }