PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_testimonial_carousel( $atts, $content = null ) { extract(shortcode_atts(array( 'testimonial_item_type4'=> '', 'testimonial_item' => '', 'items' => '3', 'type' => '1', 'shortcodeclass' => '', 'shortcodeid' => '', ), $atts)); wp_enqueue_style( 'wn-deep-testimonial-carousel0', DEEP_ASSETS_URL . 'css/frontend/testimonial-carousel/testimonial-carousel0.css' ); wp_enqueue_style( 'wn-deep-testimonial-carousel' . $type, DEEP_ASSETS_URL . 'css/frontend/testimonial-carousel/testimonial-carousel' . $type . '.css' ); $testimonial_item_data = array(); $testimonial_item_data_t4 = array(); $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { // testimonial_item loop $testimonial_item = (array) vc_param_group_parse_atts( $testimonial_item ); foreach ( $testimonial_item as $data ) { $img_id = $data['img']; if( isset( $data['img'] ) && is_numeric( $data['img'] ) ) $data['img'] = wp_get_attachment_url( $data['img'] ); // crop image if thumbnail is set if ( !empty( $data['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'; } $patt = array ( '0' => 'x', '1' => '*' ); $arr = explode( chr( 1 ), str_replace( $patt, chr( 1 ), $data['thumbnail'] ) ); // get width and height $image = new Wn_Img_Maniuplate; // instance from settor class $data['img'] = $image->m_image( $img_id, $data['img'] , $arr['0'] , $arr['1'] ); // set required and get result } $new_line = $data; $new_line['img'] = isset( $data['img'] ) ? '<img src="' . esc_url( $data['img'] ) . '" alt="' . $data['img'] . '">' : ''; $new_line['tc_content'] = isset( $data['tc_content'] ) ? '<p class="tc-content">' . esc_html( $data['tc_content'] ) . '</p>' : ''; $new_line['name'] = isset( $data['name'] ) ? '<p class="tc-name colorf">' . esc_html( $data['name'] ) . '</p>' : ''; $new_line['job'] = isset( $data['job'] ) ? '<p class="tc-job">' . esc_html( $data['job'] ) . '</p>' : ''; $new_line['thumbnail'] = isset( $data['thumbnail'] ) ? $data['thumbnail']: ''; $testimonial_item_data[] = $new_line; } // testimonial_item_type4 loop $testimonial_item_type4 = (array) vc_param_group_parse_atts( $testimonial_item_type4 ); foreach ($testimonial_item_type4 as $value) { $new_line = $value; $new_line['tc_content_t4'] = isset( $value['tc_content_t4'] ) ? esc_html( $value['tc_content_t4'] ) : ''; $new_line['first_url'] = $value['first_url'] ? '<a href="' . esc_url( $value['first_url'] ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value['first_social'] . '"></i></a>' : ''; $new_line['second_url'] = $value['second_url'] ? '<a href="' . esc_url( $value['second_url'] ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value['second_social'] . '"></i></a>' : ''; $new_line['third_url'] = $value['third_url'] ? '<a href="' . esc_url( $value['third_url'] ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value['third_social'] . '"></i></a>' : ''; $new_line['fourth_url'] = $value['fourth_url'] ? '<a href="' . esc_url( $value['fourth_url'] ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value['fourth_social'] . '"></i></a>' : ''; $testimonial_item_data_t4[] = $new_line; } } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) && is_array($testimonial_item) ) { foreach ( $atts['testimonial_item'] as $key => $data ) { $img_id = $data->img; if( isset( $data->img ) && is_numeric( $data->img ) ) $data->img = wp_get_attachment_url( $data->img ); // crop image if thumbnail is set if ( !empty($data->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'; } $patt = array ( '0' => 'x', '1' => '*' ); $arr = explode( chr( 1 ), str_replace( $patt, chr( 1 ), $data->thumbnail ) ); // get width and height $image = new Wn_Img_Maniuplate; // instance from settor class $data->img = $image->m_image( $img_id, $data->img , $arr['0'] , $arr['1'] ); // set required and get result } $new_line = $data; $new_line->img = isset( $data->img ) ? '<img src="' . esc_url( $data->img ) . '" alt="' . $data->img . '">' : ''; $new_line->tc_content = isset( $data->tc_content ) ? '<p class="tc-content">' . esc_html( $data->tc_content ) . '</p>' : ''; $new_line->name = isset( $data->name ) ? '<p class="tc-name colorf">' . esc_html( $data->name ) . '</p>' : ''; $new_line->job = isset( $data->job ) ? '<p class="tc-job">' . esc_html( $data->job ) . '</p>' : ''; $new_line->thumbnail = isset( $data->thumbnail ) ? $data->thumbnail: ''; $testimonial_item_data[] = $new_line; } } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) && is_object( $testimonial_item_type4 ) ) { // testimonial_item_type4 loop foreach ( $atts['testimonial_item_type4'] as $key => $value ) { $new_line = $value; $new_line->tc_content_t4 = isset( $value->tc_content_t4 ) ? esc_html( $value->tc_content_t4 ) : ''; $new_line->first_url = $value->first_url ? '<a href="' . esc_url( $value->first_url ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value->first_social . '"></i></a>' : ''; $new_line->second_url = $value->second_url ? '<a href="' . esc_url( $value->second_url ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value->second_social . '"></i></a>' : ''; $new_line->third_url = $value->third_url ? '<a href="' . esc_url( $value->third_url ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value->third_social . '"></i></a>' : ''; $new_line->fourth_url = $value->fourth_url ? '<a href="' . esc_url( $value->fourth_url ) . '" target="_blank"><i class="wn-fab wn-fa-' . $value->fourth_social . '"></i></a>' : ''; $testimonial_item_data_t4[]= $new_line; } } // render if ( $type == '1' ) { $out = '<div class="testimonial-carousel testi-carou-' . $type . ' ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; $out .= '<div class="testimonial-owl-carousel owl-carousel owl-theme" data-testimonial_count="' . $items . '">'; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item">' . $line['img'] . $line['tc_content'] . $line['name'] . $line['job'] . '</div>'; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item">' . $line->img . $line->tc_content . $line->name . $line->job . '</div>'; endforeach; } $out .= '</div>'; $out .= '</div>'; return $out; } if ( $type == '2' ) { $out = '<div class="testimonial-carousel testi-carou-' . $type . ' ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; $out .= '<div class="testimonial-owl-carousel owl-carousel owl-theme" data-testimonial_count="' . $items . '">'; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item"> ' . $line['tc_content'] . ' <div class="t-m-footer">'. $line['img'] . $line['name'] . $line['job'] . '</div> </div>'; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item"> ' . $line->tc_content . ' <div class="t-m-footer">'. $line->img . $line->name . $line->job . '</div> </div>'; endforeach; } $out .= '</div>'; $out .= '</div>'; return $out; } if ( $type == '3' ) { $out = '<div class="testimonial-carousel testi-carou-' . $type . ' ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; $out .= '<div class="testimonial-owl-carousel owl-carousel owl-theme" data-testimonial_count="' . $items . '">'; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item"> ' . $line['img'] . ' <div class="main-content"> ' . $line['name'] . $line['job'] . ' <div class="t-m-footer"> ' . $line['tc_content'] . ' </div> </div> </div>'; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { foreach ( $testimonial_item_data as $line ) : $out .= '<div class="tc-item"> ' . $line->img . ' <div class="main-content"> ' . $line->name . $line->job . ' <div class="t-m-footer"> ' . $line->tc_content . ' </div> </div> </div>'; endforeach; } $out .= '</div>'; $out .= '</div>'; return $out; } if ( $type == '4' ) { $out = '<div class="testimonial-carousel testi-carou-' . $type . ' colorb ' . $shortcodeclass . '" ' . $shortcodeid . ' >'; $out .= '<div class="testimonial-owl-carousel owl-carousel owl-theme" data-testimonial_count="' . $items . '">'; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { foreach ( $testimonial_item_data_t4 as $line ) : $out .= '<div class="tc-content-t4"> <p>' . $line['tc_content_t4'] . ' </p> <div class="tc-social-t4"> <li>' . $line['first_url'] . '</li> <li>' . $line['second_url'] . '</li> <li>' . $line['third_url'] . '</li> <li>' . $line['fourth_url'] . '</li> </div> </div>'; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { foreach ( $testimonial_item_data_t4 as $line ) : $out .= '<div class="tc-content-t4"> <p>' . $line->tc_content_t4 . ' </p> <div class="tc-social-t4"> <li>' . $line->first_url . '</li> <li>' . $line->second_url . '</li> <li>' . $line->third_url . '</li> <li>' . $line->fourth_url . '</li> </div> </div>'; endforeach; } $out .= '</div>'; $out .= '</div>'; return $out; } } add_shortcode( 'testimonial-carousel', 'deep_testimonial_carousel' );
[+]
..
[-] 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]