PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_schedule_shortcode( $attributes, $content ) { extract( shortcode_atts( array( 'start_date' => '', 'end_date' => '', 'dark_bg' => '', 'schedule_item' => '', 'shortcodeclass' => '', 'shortcodeid' => '', ), $attributes ) ); wp_enqueue_style( 'wn-deep-schedule', DEEP_ASSETS_URL . 'css/frontend/schedule/schedule.css' ); // Class & ID $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; static $uniqid = 0; $uniqid++; // schedule_item loop include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $schedule_item_data = array(); // Fetch Item Loop Variables if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { $schedule_item = (array) vc_param_group_parse_atts( $schedule_item ); foreach ( $schedule_item as $data ) : $new_line = $data; $new_line['item_time'] = isset( $data['item_time'] ) ? $data['item_time'] : ''; $new_line['item_title'] = isset( $data['item_title'] ) ? $data['item_title'] : ''; $new_line['item_presenter_name'] = isset( $data['item_presenter_name'] ) ? $data['item_presenter_name'] : ''; $new_line['item_presenter_image'] = isset( $data['item_presenter_image'] ) ? $data['item_presenter_image'] : ''; $new_line['item_location'] = isset( $data['item_location'] ) ? $data['item_location'] : ''; $schedule_item_data[] = $new_line; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) && (is_array($schedule_item) || is_object($schedule_item)) ) { foreach( $attributes['schedule_item'] as $key => $data ){ $new_line = $data; $new_line->item_time = isset( $data->item_time ) ? $data->item_time : ''; $new_line->item_title = isset( $data->item_title ) ? $data->item_title : ''; $new_line->item_presenter_name = isset( $data->item_presenter_name ) ? $data->item_presenter_name : ''; $new_line->item_presenter_image = isset( $data->item_presenter_image ) ? $data->item_presenter_image : ''; $new_line->item_location = isset( $data->item_location ) ? $data->item_location : ''; $schedule_item_data[] = $new_line; } } if ( $dark_bg == 'yes' ) { $dark_class = 'w-s-darkbg'; } else { $dark_class = ''; } // render $out = ' <div class="wn-schedule-wrap wn-schedule-wrap-' . $uniqid . ' ' . $dark_class . ' ' . $shortcodeclass . '" ' . $shortcodeid . '> <div class="wn-schedule-box"> <div class="wn-schedule-date w-s-date-start">' . $start_date . '</div>'; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { foreach ( $schedule_item_data as $line ) : if ( !empty ( $line['item_presenter_image'] ) ) { $presenter_image = '<img src="' . wp_get_attachment_url( $line['item_presenter_image'] ) . '" alt="' . $line['item_presenter_name'] . '">'; } else { $presenter_image = ''; } $out .= '<div class="wn-schedule-event">'; $out .= !empty ( $line['item_time'] ) ? '<div class="wn-schedule-time">' . $line['item_time'] . '</div>' : ''; $out .= '<div class="wn-schedule-content">'; $out .= !empty ( $line['item_title'] ) ?'<div class="wn-schedule-title">' . $line['item_title'] . '</div>' : ''; $out .= ( empty ( $presenter_image ) && empty ( $line['item_presenter_name'] ) ) ? '' : '<div class="wn-schedule-presenter"> ' . $presenter_image . ' ' . $line['item_presenter_name'] . '</div>'; $out .= !empty ( $line['item_location'] ) ? '<div class="wn-schedule-location">' . $line['item_location'] . '</div>' : ''; $out .= '</div>'; $out .= '</div>'; endforeach; } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { foreach ( $schedule_item_data as $line ) : if ( !empty ( $line->item_presenter_image ) ) { $presenter_image = '<img src="' . wp_get_attachment_url( $line->item_presenter_image ) . '" alt="' . $line->item_presenter_name . '">'; } else { $presenter_image = ''; } $out .= '<div class="wn-schedule-event">'; $out .= !empty ( $line->item_time ) ? '<div class="wn-schedule-time">' . $line->item_time . '</div>' : ''; $out .= '<div class="wn-schedule-content">'; $out .= !empty ( $line->item_title ) ?'<div class="wn-schedule-title">' . $line->item_title . '</div>' : ''; $out .= ( empty ( $presenter_image ) && empty ( $line->item_presenter_name ) ) ? '' : '<div class="wn-schedule-presenter"> ' . $presenter_image . ' ' . $line->item_presenter_name . '</div>'; $out .= !empty ( $line->item_location ) ? '<div class="wn-schedule-location">' . $line->item_location . '</div>' : ''; $out .= '</div>'; $out .= '</div>'; endforeach; } $out .= ' <div class="wn-schedule-date w-s-date-end">' . $end_date . '</div> </div> </div>'; return $out; } add_shortcode( 'schedule', 'deep_schedule_shortcode' );
[+]
..
[-] 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]