File: /var/www/html/wp-content/plugins/hover_effects_pack/hover_effects_pack.php
<?php
/*
Plugin Name: Hover Effects Pack
Plugin URI: http://codecanyon.net/item/hover-effects-pack-wordpress-plugin/6712508
Description: This hover pack allows you to add animation effects to images, when it hovered. Also you have ability to add text, that will go over image, and this text also can be animated. In this pack you can find 10 image animation effects and 10 animation effects for text, that goes over image. Also you can combine several text animation effects for one item.
Author: borisolhor
Version: 2.6.2
Author URI: http://codecanyon.net/user/borisolhor
*/
if (!defined('ABSPATH')) die("Can't load this file directly");
function hover_pack_resources() {
$options = get_option('hp_options');
$popup_type = isset($options['popup_type']) ? $options['popup_type'] : '';
$hover_color = isset($options['hover_color']) ? $options['hover_color'] : '#74c9be';
$title_color = isset($options['title_color']) ? $options['title_color'] : '#ffffff';
$text_color = isset($options['text_color']) ? $options['text_color'] : '#ffffff';
wp_register_style('hover_effects_pack', plugins_url('css/hover_pack.css', __FILE__));
wp_enqueue_style('hover_effects_pack');
$custom_css = "
.b-link-fade .b-wrapper .h, .b-link-fade .b-top-line .h{
color: $title_color !important;
}
.b-link-fade .b-wrapper .p, .b-link-fade .b-top-line .p{
color: $text_color !important;
}
.b-link-fade .b-top-line{
background: $hover_color;
}
.b-link-none .b-wrapper .h {
color: $title_color !important;
}
.b-link-none .b-wrapper .p{
color: $text_color !important;
}
.b-link-flow .b-wrapper .h, .b-link-flow .b-top-line .h{
color: $title_color !important;
}
.b-link-flow .b-wrapper .p{
color: $text_color !important;
}
.b-link-flow .b-top-line,
.b-link-flow.b-inverse-effect:hover .b-top-line{
background: $hover_color;
}
.b-link-stroke .b-wrapper .h{
color: $title_color !important;
}
.b-link-stroke .b-wrapper .p{
color: $text_color !important;
}
.b-link-stroke .b-top-line,
.b-link-stroke.b-inverse-effect:hover .b-top-line{
background: $hover_color;
}
.b-link-stroke .b-bottom-line,
.b-link-stroke.b-inverse-effect:hover .b-bottom-line{
background: $hover_color;
}
.b-link-twist .b-wrapper .h{
color: $title_color !important;
}
.b-link-twist .b-wrapper .p{
color: $text_color !important;
}
.b-link-twist .b-top-line,
.b-link-twist.b-inverse-effect:hover .b-top-line{
background: $hover_color;
}
.b-link-twist .b-bottom-line,
.b-link-twist.b-inverse-effect:hover .b-bottom-line{
background: $hover_color;
}
.b-link-flip{
background: $hover_color;
}
.b-link-flip .b-wrapper .h{
color: $title_color !important;
}
.b-link-flip .b-wrapper .p{
color: $text_color !important;
}
.b-link-flip .b-top-line,
.b-link-flip.b-inverse-effect:hover .b-top-line{
background: $hover_color;
}
.b-link-flip .b-bottom-line,
.b-link-flip.b-inverse-effect:hover .b-bottom-line{
background: $hover_color;
}
.b-link-box .b-wrapper .h{
color: $title_color !important;
}
.b-link-box .b-wrapper .p{
color: $text_color !important;
}
.b-link-box .b-top-line,
.b-link-box.b-inverse-effect:hover .b-top-line{
border: 30px solid $hover_color;
}
.b-link-box .b-bottom-line,
.b-link-box.b-inverse-effect:hover .b-bottom-line{
background: $hover_color;
}
.b-link-stripe .b-wrapper .h{
color: $title_color !important;
}
.b-link-stripe .b-wrapper .p{
color: $text_color !important;
}
.b-link-stripe .b-line,
.b-link-stripe.b-inverse-effect:hover .b-line{
background: $hover_color;
}
.b-link-apart-horisontal .b-wrapper .h, .b-link-apart-vertical .b-wrapper .h{
color: $title_color !important;
}
.b-link-apart-horisontal .b-wrapper .p, .b-link-apart-vertical .b-wrapper .p{
color: $text_color !important;
}
.b-link-apart-horisontal .b-top-line, .b-link-apart-horisontal .b-top-line-up,
.b-link-apart-horisontal.b-inverse-effect:hover .b-top-line, .b-link-apart-horisontal.b-inverse-effect:hover .b-top-line-up{
background: $hover_color;
}
.b-link-apart-horisontal .b-bottom-line, .b-link-apart-horisontal .b-bottom-line-up,
.b-link-apart-horisontal.b-inverse-effect:hover .b-bottom-line, .b-link-apart-horisontal.b-inverse-effect:hover .b-bottom-line-up{
background: $hover_color;
}
.b-link-apart-vertical .b-top-line, .b-link-apart-vertical .b-top-line-up,
.b-link-apart-vertical.b-inverse-effect:hover .b-top-line, .b-link-apart-vertical.b-inverse-effect:hover .b-top-line-up{
background: $hover_color;
}
.b-link-apart-vertical .b-bottom-line, .b-link-apart-vertical .b-bottom-line-up,
.b-link-apart-vertical.b-inverse-effect:hover .b-bottom-line, .b-link-apart-vertical.b-inverse-effect:hover .b-bottom-line-up{
background: $hover_color;
}
.b-link-diagonal .b-wrapper .h{
color: $title_color !important;
}
.b-link-diagonal .b-wrapper .p{
color: $text_color !important;
}
.b-link-diagonal .b-line,
.b-link-diagonal.b-inverse-effect:hover .b-line{
background: $hover_color;
}
";
wp_add_inline_style( 'hover_effects_pack', $custom_css );
wp_enqueue_script('jquery');
if ($popup_type == 'pp') {
wp_register_script('prettyPhoto_script', plugins_url('prettyphoto/js/jquery.prettyPhoto.js', __FILE__));
wp_enqueue_script('prettyPhoto_script');
wp_register_script('customPrettyPhoto_script', plugins_url('prettyphoto/js/customprettyPhoto.js', __FILE__));
wp_enqueue_script('customPrettyPhoto_script');
wp_register_style('prettyPhoto', plugins_url('prettyphoto/css/prettyPhoto.css', __FILE__));
wp_enqueue_style('prettyPhoto');
} else {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
}
$touch_link = isset($options['touch_link']) ? $options['touch_link'] : '';
$thumb_size = isset($options['thumb_size']) ? $options['thumb_size'] : 'th';
wp_register_script('hover_effects_pack', plugins_url('js/hover_pack.js', __FILE__), [], '1.1');
wp_localize_script('hover_effects_pack', 'wphp_params', array(
'wphp_touch_link' => $touch_link,
'wphp_thumb_size' => $thumb_size,
'wphp_plugin_url' => plugin_dir_url( __FILE__ )
));
wp_enqueue_script('hover_effects_pack');
}
add_action('init', 'hover_pack_resources');
function hover_pack_button() {
if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
return;
}
if (get_user_option('rich_editing') == 'true') {
add_filter('mce_external_plugins', 'add_mce_plugin');
add_filter('mce_buttons', 'hp_register_button');
}
}
add_action('init', 'hover_pack_button');
function hp_register_button($buttons) {
array_push($buttons, "|", 'hover_pack_button');
return $buttons;
}
function add_mce_plugin($plugin_array) {
$plugin_array['hover_pack'] = plugins_url('js/hover_effects_plugin.js', __FILE__);
return $plugin_array;
}
function hover_pack_admin_resources() {
wp_register_style('hover-pack-admin-css', plugins_url('css/admin.css', __FILE__));
wp_enqueue_style('hover-pack-admin-css');
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_register_script('hover_effects_pack_settings', plugins_url('js/hover_pack_settings.js', __FILE__), [], '1.0');
wp_enqueue_script('hover_effects_pack_settings');
}
add_action('admin_enqueue_scripts', 'hover_pack_admin_resources');
function hover_pack_func($atts) {
$popup_class = '';
$rel = '';
extract(shortcode_atts(array('img' => '', 'img_id' => '', 'link' => '', 'img_title' => '', 'img_alt' => '', 'gallery_id'=>'', 'disable_popup' => '', 'link_tab' => '', 'width' => '', 'height' => '', 'class' => '', 'radius' => '', 'effect' => '', 'inverse_effect' => '', 'color' => '', 'opacity' => '', 'title' => '', 'title_visible' => '', 'title_delay' => '', 'title_slide' => '', 'title_rotation' => '', 'title_scale' => '', 'title_fade' => '', 'text' => '', 'text_visible' => '', 'text_delay' => '', 'text_slide' => '', 'text_rotation' => '', 'text_scale' => '', 'text_fade' => ''), $atts));
$options = get_option('hp_options');
$popup_type = isset($options['popup_type']) ? $options['popup_type'] : '';
switch ($popup_type) {
case 'tb':
$popup_class = 'thickbox';
$rel = $gallery_id;
break;
case 'pp':
$popup_class = 'prettyphoto';
if($gallery_id != '') {
$rel = 'PrettyPhoto['.$gallery_id.']';
} else {
$rel = 'PrettyPhoto';
}
break;
}
$effect_class = 'b-link-fade';
switch ($effect) {
case 'none':
$effect_class = 'b-link-none';
break;
case 'fade':
$effect_class = 'b-link-fade';
break;
case 'flow':
$effect_class = 'b-link-flow';
break;
case 'stroke':
$effect_class = 'b-link-stroke';
break;
case 'twist':
$effect_class = 'b-link-twist';
break;
case 'flip':
$effect_class = 'b-link-flip';
break;
case 'box':
$effect_class = 'b-link-box';
break;
case 'stripe':
$effect_class = 'b-link-stripe';
break;
case 'apart-horizontal':
$effect_class = 'b-link-apart-horisontal';
break;
case 'apart-vertical':
$effect_class = 'b-link-apart-vertical';
break;
case 'diagonal':
$effect_class = 'b-link-diagonal';
break;
}
if ($inverse_effect != '') {
$effect_class .= ' b-inverse-effect';
}
$opacity_class = ' ';
switch ($opacity) {
case '90':
$opacity_class = 'b-opacity-90';
break;
case '80':
$opacity_class = 'b-opacity-80';
break;
case '70':
$opacity_class = 'b-opacity-70';
break;
case '60':
$opacity_class = 'b-opacity-60';
break;
case '50':
$opacity_class = 'b-opacity-50';
break;
case '40':
$opacity_class = 'b-opacity-40';
break;
case '30':
$opacity_class = 'b-opacity-30';
break;
case '20':
$opacity_class = 'b-opacity-20';
break;
case '10':
$opacity_class = 'b-opacity-10';
break;
}
if ($radius != '') {
$border_radius = 'border-radius-' . $radius;
} else {
$border_radius = '';
}
if ($disable_popup == 1 || $disable_popup == 'disable_popup') {
$popup_class = '';
$rel = '';
}
$link_target = '';
if ($link_tab == 1 || $link_tab == 'link_tab') {
$link_target = 'target="_blank"';
}
if ($link == '') {
if ($img_id != '') {
$attachment = wp_get_attachment_image_src($img_id, 'full');
$link = $attachment[0];
} else {
$link = 'javascript:void(0)';
}
}
// Img Title and Alt
$img_title_html = '';
if($img_title != '') {
$img_title_html = "title='$img_title'";
}
$img_alt_html = '';
if($img_alt != '') {
$img_alt_html = "alt='$img_alt'";
}
// Get options
$options = get_option('hp_options');
$header_tag = isset($options['typography_header']) ? $options['typography_header'] : 'h2';
$paragraph_tag = isset($options['typography_paragraph']) ? $options['typography_paragraph'] : 'p';
$header_padding = isset($options['typography_header_padding']) ? $options['typography_header_padding'] : '';
$paragraph_padding = isset($options['typography_paragraph_padding']) ? $options['typography_paragraph_padding'] : '';
$image_css_size = isset($options['image_css_size_enable']) ? $options['image_css_size_enable'] : 'off';
$link_wrap = isset($options['wrapper_settings']) ? $options['wrapper_settings'] : 'image';
$header_padding_html = '';
$data_color="";
if(isset($color)) {
if($color != '') {
$data_color = "data-color='".$color."'";
}
}
if (isset($header_padding)) {
$header_padding_html = 'style="padding-left:' . (int)$header_padding . 'px;padding-right:' . (int)$header_padding . 'px;"';
}
$paragraph_padding_html = '';
if (isset($paragraph_padding)) {
$paragraph_padding_html = 'style="padding-left:' . (int)$paragraph_padding . 'px;padding-right:' . (int)$paragraph_padding . 'px;"';
}
if($link_wrap == 'image') {
$html = '<a href="' . $link . '" ' . $link_target . ' class="' . $effect_class . ' b-animate-go ' . $class . ' ' . $popup_class . ' ' . $border_radius . ' ' . $opacity_class . '" '.$data_color.' rel="'.$rel.'">';
} else {
$html = '<span class="' . $effect_class . ' b-animate-go ' . $class . ' ' . $popup_class . ' ' . $border_radius . ' ' . $opacity_class . '" '.$data_color.' >';
}
if (isset($img_id) && $img_id != '') {
// get image params by attchment id
$attachment_size = $options['thumb_size'];
switch ($attachment_size) {
case 'th':
$attachment_size_name = 'thumbnail';
break;
case 'md':
$attachment_size_name = 'medium';
break;
case 'og':
$attachment_size_name = 'full';
break;
default:
$attachment_size_name = 'thumbnail';
break;
}
$attachment = wp_get_attachment_image_src($img_id, $attachment_size_name);
$img_width_height_style = 'style="';
if ($attachment[1] > 0) {
$img_width = 'width="' . $attachment[1] . '"';
$img_width_height_style.= 'width: ' . $attachment[1] . 'px;';
} else {
$img_width = '';
$img_width_height_style.= '';
}
if ($attachment[2] > 0) {
$img_height = 'height="' . $attachment[2] . '"';
$img_width_height_style.= 'height: ' . $attachment[2] . 'px;';
} else {
$img_height = '';
$img_width_height_style.= '';
}
$img_width_height_style.= '"';
if($image_css_size != 'checked') {
$img_width_height_style = '';
}
$html.= '<img src="' . $attachment[0] . '" ' . $img_width . ' ' . $img_height . ' ' . $img_width_height_style . ' '.$img_alt_html.' '.$img_title_html.' />';
} else {
$img_width_height_style = 'style="';
$img_height = "";
$img_width = "";
if ((int)$width > 0) {
$img_width = 'width="' . (int)$width . '"';
$img_width_height_style.= 'width: ' . (int)$width . 'px;';
}
if ((int)$height > 0) {
$img_height = 'height="' . (int)$height . '"';
$img_width_height_style.= 'height: ' . (int)$height . 'px;';
}
$img_width_height_style.= '"';
if($image_css_size != 'checked') {
$img_width_height_style = '';
}
$html.= '<img src="' . $img . '" ' . $img_width . ' ' . $img_height . ' ' . $img_width_height_style . ' '.$img_alt_html.' '.$img_title_html.' />';
}
// if we have title or text
if (isset($title) || isset($text)) {
$html.= '<div class="b-wrapper">';
if (isset($title) && $title != '') {
$title_delay_class = '';
if ($title_delay) {
switch ($title_delay) {
case '03':
$title_delay_class = 'b-delay03';
break;
case '06':
$title_delay_class = 'b-delay06';
break;
case '09':
$title_delay_class = 'b-delay09';
break;
case '12':
$title_delay_class = 'b-delay12';
break;
case '15':
$title_delay_class = 'b-delay15';
break;
}
}
$title_slide_class = '';
if ($title_slide) {
switch ($title_slide) {
case 'from-left':
$title_slide_class = 'b-from-left';
break;
case 'from-right':
$title_slide_class = 'b-from-right';
break;
case 'from-top':
$title_slide_class = 'b-from-top';
break;
case 'from-bottom':
$title_slide_class = 'b-from-bottom';
break;
}
}
$title_rotate_class = '';
if ($title_rotation) {
switch ($title_rotation) {
case 'cw-90':
$title_rotate_class = 'b-cw-90';
break;
case 'ccw-90':
$title_rotate_class = 'b-ccw-90';
break;
case 'cw-180':
$title_rotate_class = 'b-cw-180';
break;
case 'ccw-180':
$title_rotate_class = 'b-ccw-180';
break;
}
}
$title_scale_class = '';
if ($title_scale == 1 || $title_scale == 'title_scale') {
$title_scale_class = 'b-scale';
}
$title_opacity_class = '';
if ($title_fade == 1 || $title_fade == 'title_fade') {
$title_opacity_class = 'b-opacity';
}
if($link_wrap == 'title') {
$html .= '<a href = "' . $link . '" ' . $link_target . ' >';
}
if($title_visible == 1 || $title_visible == 'title_visible') {
$html.= '<' . $header_tag . ' ' . $header_padding_html . ' class="b-animate h b-visible ">' . html_entity_decode(html_entity_decode($title)) . '</' . $header_tag . '>';
} else {
$html.= '<' . $header_tag . ' ' . $header_padding_html . ' class="b-animate h ' . $title_slide_class . ' ' . $title_scale_class . ' ' . $title_opacity_class . ' ' . $title_rotate_class . ' ' . $title_delay_class . ' ">' . html_entity_decode(html_entity_decode($title)) . '</' . $header_tag . '>';
}
if($link_wrap == 'title') {
$html .= "</a>";
}
}
if (isset($text) && $text != '') {
$text_delay_class = '';
if ($text_delay) {
switch ($text_delay) {
case '03':
$text_delay_class = 'b-delay03';
break;
case '06':
$text_delay_class = 'b-delay06';
break;
case '09':
$text_delay_class = 'b-delay09';
break;
case '12':
$text_delay_class = 'b-delay12';
break;
case '15':
$text_delay_class = 'b-delay15';
break;
}
}
$text_slide_class = '';
if ($text_slide) {
switch ($text_slide) {
case 'from-left':
$text_slide_class = 'b-from-left';
break;
case 'from-right':
$text_slide_class = 'b-from-right';
break;
case 'from-top':
$text_slide_class = 'b-from-top';
break;
case 'from-bottom':
$text_slide_class = 'b-from-bottom';
break;
}
}
$text_rotate_class = '';
if ($text_rotation) {
switch ($text_rotation) {
case 'cw-90':
$text_rotate_class = 'b-cw-90';
break;
case 'ccw-90':
$text_rotate_class = 'b-ccw-90';
break;
case 'cw-180':
$text_rotate_class = 'b-cw-180';
break;
case 'ccw-180':
$text_rotate_class = 'b-ccw-180';
break;
}
}
$text_scale_class = '';
if ($text_scale == 1 || $text_scale == 'text_scale') {
$text_scale_class = 'b-scale';
}
$text_opacity_class = '';
if ($text_fade == 1 || $text_fade == 'text_fade') {
$text_opacity_class = 'b-opacity';
}
if($link_wrap == 'text') {
$html .= '<a href = "' . $link . '" ' . $link_target . ' >';
}
if (is_base64_encoded($text)) {
$text_to_output = urldecode(base64_decode($text));
} else {
$text_to_output = html_entity_decode(html_entity_decode($text));
}
if($text_visible == 1 || $text_visible == 'text_visible') {
$html.= '<' . $paragraph_tag . ' ' . $paragraph_padding_html . ' class="b-animate p b-visible ">' . $text_to_output . '</' . $paragraph_tag . '>';
} else {
$html.= '<' . $paragraph_tag . ' ' . $paragraph_padding_html . ' class="b-animate p ' . $text_slide_class . ' ' . $text_scale_class . ' ' . $text_opacity_class . ' ' . $text_rotate_class . ' ' . $text_delay_class . ' ">' . $text_to_output . '</' . $paragraph_tag . '>';
}
if($link_wrap == 'text') {
$html .= "</a>";
}
}
$html.= '</div>';
}
if($link_wrap == 'image') {
$html.= '</a>';
} else {
$html.= '</span>';
}
return $html;
}
add_shortcode('hover_pack', 'hover_pack_func');
add_filter('widget_text', 'do_shortcode');
// Add Feature Image support
function featured_image_hp($html, $post_id = 0) {
$options = get_option('hp_options');
$featured_enable = isset($options['featured_enable']) ? $options['featured_enable'] : '';
$featured_effect = isset($options['featured_effect']) ? $options['featured_effect'] : '';
$featured_inverse_effect = isset($options['featured_inverse_effect']) ? $options['featured_inverse_effect'] : '';
$featured_opacity = isset($options['featured_opacity']) ? $options['featured_opacity'] : '';
$featured_title = isset($options['featured_title']) ? $options['featured_title'] : 'none';
$featured_title_visible = isset($options['featured_title_visible']) ? $options['featured_title_visible'] : 'none';
$featured_title_custom = isset($options['featured_title_custom']) ? $options['featured_title_custom'] : '';
$featured_title_fade_effect = isset($options['featured_title_fade_effect']) ? $options['featured_title_fade_effect'] : '';
$featured_title_effect_delay = isset($options['featured_title_effect_delay']) ? $options['featured_title_effect_delay'] : '';
$featured_title_slide_effect = isset($options['featured_title_slide_effect']) ? $options['featured_title_slide_effect'] : '';
$featured_title_rotation_effect = isset($options['featured_title_rotation_effect']) ? $options['featured_title_rotation_effect'] : '';
$featured_title_scale_effect = isset($options['featured_title_scale_effect']) ? $options['featured_title_scale_effect'] : '';
$header_tag = isset($options['typography_header']) ? $options['typography_header'] : 'h2';
$header_padding = isset($options['typography_header_padding']) ? $options['typography_header_padding'] : '';
$header_padding_html = '';
if (isset($header_padding)) {
$header_padding_html = 'style="padding-left:' . (int)$header_padding . 'px;padding-right:' . (int)$header_padding . 'px;"';
}
if ($featured_enable == 'checked') {
switch ($featured_effect) {
case 'none':
$effect_class = 'b-link-none';
break;
case 'fade':
$effect_class = 'b-link-fade';
break;
case 'flow':
$effect_class = 'b-link-flow';
break;
case 'stroke':
$effect_class = 'b-link-stroke';
break;
case 'twist':
$effect_class = 'b-link-twist';
break;
case 'flip':
$effect_class = 'b-link-flip';
break;
case 'box':
$effect_class = 'b-link-box';
break;
case 'stripe':
$effect_class = 'b-link-stripe';
break;
case 'apart-horizontal':
$effect_class = 'b-link-apart-horisontal';
break;
case 'apart-vertical':
$effect_class = 'b-link-apart-vertical';
break;
case 'diagonal':
$effect_class = 'b-link-diagonal';
break;
default:
$effect_class = '';
break;
}
if ($featured_inverse_effect != '') {
$effect_class .= ' b-inverse-effect';
}
switch ($featured_opacity) {
case '90':
$opacity_class = 'b-opacity-90';
break;
case '80':
$opacity_class = 'b-opacity-80';
break;
case '70':
$opacity_class = 'b-opacity-70';
break;
case '60':
$opacity_class = 'b-opacity-60';
break;
case '50':
$opacity_class = 'b-opacity-50';
break;
case '40':
$opacity_class = 'b-opacity-40';
break;
case '30':
$opacity_class = 'b-opacity-30';
break;
case '20':
$opacity_class = 'b-opacity-20';
break;
case '10':
$opacity_class = 'b-opacity-10';
break;
default:
$opacity_class = '';
break;
}
$ret = '<a href="' . get_permalink($post_id) . '" class="b-animate-go ' . $effect_class . ' ' . $opacity_class . '" title="' . strip_tags(esc_attr(get_the_title($post_id))) . '">' . strip_tags($html, '<img>');
if ($featured_title != 'none') {
$ret.= '<div class="b-wrapper">';
if ($featured_title == 'title' || $featured_title == 'custom') {
if($featured_title == 'title') {
$title = strip_tags(get_the_title($post_id));
}
if($featured_title == 'custom') {
$title = $featured_title_custom;
}
$title_delay_class = '';
if ($featured_title_effect_delay) {
switch ($featured_title_effect_delay) {
case '03':
$title_delay_class = 'b-delay03';
break;
case '06':
$title_delay_class = 'b-delay06';
break;
case '09':
$title_delay_class = 'b-delay09';
break;
case '12':
$title_delay_class = 'b-delay12';
break;
case '15':
$title_delay_class = 'b-delay15';
break;
}
}
$title_slide_class = '';
if ($featured_title_slide_effect) {
switch ($featured_title_slide_effect) {
case 'from-left':
$title_slide_class = 'b-from-left';
break;
case 'from-right':
$title_slide_class = 'b-from-right';
break;
case 'from-top':
$title_slide_class = 'b-from-top';
break;
case 'from-bottom':
$title_slide_class = 'b-from-bottom';
break;
}
}
$title_rotate_class = '';
if ($featured_title_rotation_effect) {
switch ($featured_title_rotation_effect) {
case 'cw-90':
$title_rotate_class = 'b-cw-90';
break;
case 'ccw-90':
$title_rotate_class = 'b-ccw-90';
break;
case 'cw-180':
$title_rotate_class = 'b-cw-180';
break;
case 'ccw-180':
$title_rotate_class = 'b-ccw-180';
break;
}
}
$title_scale_class = '';
if ($featured_title_scale_effect == 'checked') {
$title_scale_class = 'b-scale';
}
$title_fade_class = '';
if ($featured_title_fade_effect == 'checked') {
$title_fade_class = 'b-opacity';
}
if($featured_title_visible == 'checked') {
$ret.= '<' . $header_tag . ' ' . $header_padding_html . ' class="b-animate h b-visible ">' . $title . '</' . $header_tag . '>';
} else {
$ret.= '<' . $header_tag . ' ' . $header_padding_html . ' class="b-animate h ' . $title_slide_class . ' ' . $title_scale_class . ' ' . $title_fade_class . ' ' . $title_rotate_class . ' ' . $title_delay_class . ' ">' . $title . '</' . $header_tag . '>';
}
}
$ret.= '</div>';
}
$ret.= "</a>";
return $ret;
} else {
return $html;
}
}
add_filter('post_thumbnail_html', 'featured_image_hp', 10, 3);
// Settings section
require_once 'hp_settings.php';
// Widget support
require_once 'widget.php';
// SiteOrigin Pagebuilder Integration
require_once '3rd_party/siteorigin_pb.php';
// WPBakery Visual Composer
require_once '3rd_party/wpbakery_vc.php';
// Layers WP Integration
//require_once '3rd_party/layerswp.php';
// Register widget class from SiteOrigin extension for WP
// Generate files on plugin activation
function is_base64_encoded($data)
{
try {
$decoded = base64_decode($data, true);
if ( base64_encode($decoded) === $data ) {
return true;
} else {
return false;
}
}
catch(Exception $e) {
return false;
}
};
require_once('gutenberg_support.php');