PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_video_background ( $atts, $content = null ) { extract(shortcode_atts(array( 'video_type' => 'youtube', 'video_url' => '', 'thumbnail' => '', 'width' => '', 'height' => '', 'thumbnail_size' => '', 'overlay_color' => '', 'action_type' => 'popup', 'target_url' => '', 'shortcodeclass' => '', 'shortcodeid' => '', ), $atts )); $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $thumbnail_id = $thumbnail; $live_page_builders_css = ''; $thumbnail = wp_get_attachment_url( $thumbnail ); // crop image if thumbnail is set if ( $thumbnail ) { // if main class not exist get it if ( ! class_exists( 'Wn_Img_Maniuplate' ) ) { require_once DEEP_CORE_DIR . 'helper-classes/class_webnus_manuplate.php'; } $thumb_array = explode( 'x', $thumbnail_size ); // get width and height $image = new Wn_Img_Maniuplate; // instance from settor class if ( $thumb_array['0'] == '' || $thumb_array['1'] == '' ) { $img = $thumbnail; } else { $img = $image->m_image( $thumbnail_id, $thumbnail , $thumb_array['0'] , $thumb_array['1'] ); // set required and get result } } static $uniqid = 0; $uniqid++; $live_page_builders_css = ''; $width = $width ? $width : ''; $height = $height ? $height : ''; $overlay_color = $overlay_color ? '.video-background-wrap[data-id="' . $uniqid . '"] a { background: ' . $overlay_color . '; }' : ''; $thumbnail = $thumbnail ? '<image src="' . esc_url( $img ) . '">' : '' ; if ( $action_type == 'popup' ) { $target_url = $video_url ? '<a href="'. esc_url( $video_url ) .'" class="wn-popup-video"></a>' : '' ; } else { $target_url = empty( $target_url ) ? '<a href="'. esc_url( $video_url ) .'"></a>' : '<a href="'. esc_url( $target_url ) .'"></a>' ; } $video_url = $video_url ? $video_url : ''; $youtube_id = strstr( $video_url, 'embed/', false ); $get_youtube_id = explode( '/', $youtube_id ); $internal = ( $video_type == 'internal') ? '<div class="video-wrap">' . $target_url . '<video class="wn-bg-internal" src="' . $video_url . '" autoplay muted ></video></div>' : '' ; // Fetch Carousle Item Loop Variables if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { wp_enqueue_script( 'vc_youtube_iframe_api_js' ); $class_data = 'class="video-background-wrap vc_row vc_video-bg-container ' . $shortcodeclass . '" ' . $shortcodeid . ' data-vc-video-bg="' . $video_url . '"'; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { wp_register_script('kc-youtube-iframe-api', 'https://www.youtube.com/iframe_api', null, KC_VERSION, true ); wp_enqueue_script('kc-youtube-iframe-api'); $class_data = 'class="video-background-wrap kc-elm kc_row kc-video-bg" data-vc-video-mute="yes" data-kc-video-bg="' . $video_url . '"'; } $out = ' <div ' . $class_data . ' data-id="' . $uniqid . '"> ' . $target_url . $internal . $thumbnail . ' </div>'; deep_save_dyn_styles( ' ' . $overlay_color . ' .video-background-wrap[data-id="' . $uniqid . '"] { height: ' . $height . '; } .video-background-wrap[data-id="' . $uniqid . '"] video { width: 100%; height: 100%; } .video-background-wrap.vc_row.vc_video-bg-container { margin: 0; } ' ); // live editor $live_page_builders_css .= ' ' . $overlay_color . ' .video-background-wrap[data-id="' . $uniqid . '"] { height: ' . $height . '; } .video-background-wrap[data-id="' . $uniqid . '"] video { width: 100%; height: 100%; } .video-background-wrap.vc_row.vc_video-bg-container { margin: 0; } '; if ( ! in_array( 'admin-bar', get_body_class() ) ) { if ( ! empty( $live_page_builders_css ) ) { $out .= '<style>'; $out .= $live_page_builders_css; $out .= '</style>'; } } return $out; } add_shortcode('video-background','deep_video_background');
[+]
..
[-] video-teaser.php
[edit]
[-] vcw.php
[edit]
[-] sermon-category.php
[edit]
[-] iconbox.php
[edit]
[-] speakers.php
[edit]
[-] iconfonts-param.php
[edit]
[-] checklist-param.php
[edit]
[-] infobox.php
[edit]
[-] webtags.php
[edit]
[-] teaser-box.php
[edit]
[-] latest-from-blog.php
[edit]
[-] reservation.php
[edit]
[-] subscribe.php
[edit]
[-] progressbar.php
[edit]
[-] review-items.php
[edit]
[-] icon-divider.php
[edit]
[-] toggle-box.php
[edit]
[+]
assets
[-] pie.php
[edit]
[-] asermon.php
[edit]
[-] buttons.php
[edit]
[-] accordion.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] deep-gallery.php
[edit]
[-] custom-menu.php
[edit]
[-] postslider.php
[edit]
[-] magazine.php
[edit]
[-] callout.php
[edit]
[-] maxcounter.php
[edit]
[-] testimonialslider.php
[edit]
[-] testimonials.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] services.php
[edit]
[-] image-carousel.php
[edit]
[-] category-tab.php
[edit]
[-] slide-up-note.php
[edit]
[-] ourteam.php
[edit]
[-] prayerwall-items.php
[edit]
[-] heading.php
[edit]
[-] tablepress.php
[edit]
[-] instagram.php
[edit]
[-] video-play.php
[edit]
[-] columns.php
[edit]
[-] special-offer.php
[edit]
[-] like-view-share.php
[edit]
[-] image-hotspot.php
[edit]
[-] postfromblog.php
[edit]
[-] roadmap.php
[edit]
[-] search.php
[edit]
[-] recipes.php
[edit]
[-] ourclients.php
[edit]
[-] tab.php
[edit]
[-] blog.php
[edit]
[-] icon.php
[edit]
[-] latest-tweets.php
[edit]
[-] before-after-image.php
[edit]
[-] food-menu.php
[edit]
[-] alerts.php
[edit]
[-] login.php
[edit]
[-] pricing-plan.php
[edit]
[-] dropcap.php
[edit]
[-] rooms.php
[edit]
[-] prayerwall-form.php
[edit]
[-] countdown.php
[edit]
[-] lefttab.php
[edit]
[-] schedule.php
[edit]
[-] block-quote.php
[edit]
[-] highlight.php
[edit]
[-] our-process.php
[edit]
[-] w-title.php
[edit]
[-] shop-products.php
[edit]
[-] buy-process.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] causes.php
[edit]
[-] review-form.php
[edit]
[-] pricingtables.php
[edit]
[-] sermons.php
[edit]
[-] distance.php
[edit]
[-] collection.php
[edit]
[-] donate.php
[edit]
[-] googlemap.php
[edit]
[-] list.php
[edit]
[-] acause.php
[edit]
[-] service-carousel.php
[edit]
[-] quote.php
[edit]
[-] w-svg.php
[edit]
[-] tooltip.php
[edit]
[-] socials.php
[edit]
[-] process-carousel.php
[edit]