Current Path : /var/www/ooareogundevinitiative/wp-content/themes/pain/framework/ |
Current File : /var/www/ooareogundevinitiative/wp-content/themes/pain/framework/functions.php |
<?php /** * functions.php * */ /** * jw_GetAllFileOnDir * * @param string $dir * @return array */ if( ! function_exists( 'jw_ScanAllFileOnDir' ) ) : function jw_GetAllFileOnDir( $dir ) { $files = array(); if( is_dir( $dir ) && $files = glob( $dir . '*.php', GLOB_BRACE ) ) : $files = array_diff( $files, array( '.', '..' ) ); endif; return $files; } endif; /** * jw_ScanCommentInFile * * @param string $path * @return array */ if( ! function_exists( 'jw_ScanCommentInFile' ) ) : function jw_ScanCommentInFile( $path ) { require_once( ABSPATH . 'wp-admin/includes/file.php' ); WP_Filesystem(); global $wp_filesystem; $comments = array(); $params = array(); $expr = "/((?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:\/\/.*))/"; $comments = $wp_filesystem->get_contents( $path ); preg_match_all($expr, $comments, $matches); if( ! isset( $matches[0] ) || ! isset( $matches[0][0] ) ) return; $comments = $matches[0][0]; if( empty( $comments ) ) return; /* filter string */ $comments = str_replace( array( '/*', '/**', '*/', '**/', '*' ) , '', $comments ); /* */ $segments = explode( chr(10), $comments ); /* build params */ if( count( $segments ) == 0 ) return; foreach( $segments as $segment ) { $segment = trim( $segment ); if( ! empty( $segment ) ) { $_arr = explode( ':', $segment, 2 ); if( count( $_arr ) == 2 ) $params[strtolower( $_arr[0] )] = ltrim( $_arr[1] ); } } return( $params ); } endif; /** * jw_LoadHeaderLayout * */ if( ! function_exists( 'jw_LoadHeaderLayoutOpts' ) ) : function jw_LoadHeaderLayoutOpts() { $files = jw_GetAllFileOnDir( ABS_PATH_FR . '/headers/' ); if( count( $files ) <= 0 ) return; $header_opts = array(); foreach( $files as $file ) : $path = $file; $comment = jw_ScanCommentInFile( $path ); if( $comment ) : $header_opts[basename( $path, '.php' )] = array( 'alt' => $comment['layout name'], 'img' => URI_PATH . $comment['preview image'], ); endif; endforeach; return $header_opts; } endif; /** * jw_LoadHeaderLayoutOptsMetabox * */ if( ! function_exists( 'jw_LoadHeaderLayoutOptsMetabox' ) ) : function jw_LoadHeaderLayoutOptsMetabox() { $files = jw_GetAllFileOnDir( ABS_PATH_FR . '/headers/' ); if( count( $files ) <= 0 ) return; $header_opts = array( 'global' => __( 'Global', 'pain' ) ); foreach( $files as $file ) : $path = $file; $comment = jw_ScanCommentInFile( $path ); if( $comment ) $header_opts[basename( $path, '.php' )] = $comment['layout name']; endforeach; return $header_opts; } endif; if( ! function_exists( 'jwsthemes_LoadFooterLayoutOpts' ) ) : function jwsthemes_LoadFooterLayoutOpts() { $files = jw_GetAllFileOnDir( ABS_PATH_FR . '/footers/' ); if( count( $files ) <= 0 ) return; $footer_opts = array(); foreach( $files as $file ) : $path = $file; $comment = jw_ScanCommentInFile( $path ); if( $comment ) : $footer_opts[basename( $path, '.php' )] = array( 'alt' => $comment['layout name'], 'img' => URI_PATH . $comment['preview image'], ); endif; endforeach; return $footer_opts; } endif; /** * jwsthemes_template_part * * @param [string] $__path * @param [string] $__type * @param [array] $__param */ if( ! function_exists( 'jwsthemes_template_part' ) ) : function jwsthemes_template_part( $__path = "", $__type = "", $__params ) { extract( $__params ); # check $type exist $__new_path = ""; if( ! empty( $__type ) ) $__new_path = sprintf( '%s-%s', $__path, $__type ); if( file_exists( $__new_path . '.php' ) ) include $__new_path . '.php'; else include $__path . '.php'; } endif; /** * jwsthemes_renderCarouselByAttachmentId * * @param [array] $ids * @param [string] $size * @return [html] $output */ if( ! function_exists( 'jwsthemes_renderCarouselByAttachmentId' ) ) : function jwsthemes_renderCarouselByAttachmentId( $ids = array(), $size = 'medium' ) { if( count( $ids ) <= 0 ) return; $slide_item = ""; foreach( $ids as $id ) : $img_data = wp_get_attachment_image_src( $id, $size ); $img_url = $img_data[0]; $slide_item .= sprintf( ' <div class="s-item"> <div class="s-item-inner" style="background: url(%s) no-repeat center center / cover;"> </div> </div>', $img_url ); endforeach; $slick_opts = json_encode( array( 'dots' => true, 'arrows' => false, 'autoplay' => true, 'autoplaySpeed' => 5000 ) ); return sprintf( '<div class="bears-slick-carousel" data-slick-carousel=%s>%s</div>', $slick_opts, $slide_item ); } endif; /** * jwsthemes_renderAudio * * @param [string] $audio_data * @param [string] $audio_type * @return [html] $output */ if( ! function_exists( 'jwsthemes_renderAudio' ) ) : function jwsthemes_renderAudio( $audio_data, $audio_type ) { $output = ""; switch ( $audio_type ) { case 'soundcloud': $output = $audio_data; break; } return sprintf( '<div class="bears-audio-wrap">%s</div>', $output ); } endif; if( ! function_exists( 'jwsthemes_renderVideo' ) ) : function jwsthemes_renderVideo( $video_data, $video_type, $video_height = "" ) { $output = ""; switch ( $video_type ) { case 'vimeo': $segment_url = explode( '/' , $video_data ); $vimeo_ID = end( $segment_url ); $output = sprintf( ' <iframe src="https://player.vimeo.com/video/%s" width="%s" %s frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>', $vimeo_ID, '100%', ( ! empty( $video_height ) ) ? "height='{$video_height}'" : '' ); break; case 'youtube': $segment_url = explode( '/' , $video_data ); $youtu_ID = end( $segment_url ); $output = sprintf( ' <iframe src="https://www.youtube.com/embed/%s" width="%s" %s frameborder="0" allowfullscreen></iframe>', $youtu_ID, '100%', ( ! empty( $video_height ) ) ? "height='{$video_height}'" : '' ); break; default: # code... break; } return sprintf( '<div class="bears-video-wrap">%s</div>', $output ); } endif; /** * tbbs_BearsCarouselCausesParams * */ if( ! function_exists( 'tbbs_BearsCarouselCausesParams' ) ) : function tbbs_BearsCarouselCausesParams() { return array( array( 'name' => 'trims_description', 'title' => __( 'Trims Description' , 'pain' ), 'type' => 'text', 'value' => 22, ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), array( 'value' => 'urgent', 'text' => __( 'Urgent', 'pain' ), ), array( 'value' => 'basic', 'text' => __( 'Basic', 'pain' ), ), ) ), array( 'name' => 'color', 'title' => __( 'Color', 'pain' ), 'type' => 'select', 'value' => 'black', 'description' => __( 'Opt use for layout item: Basic' , 'pain' ), 'options' => array( array( 'value' => 'white', 'text' => __( 'White', 'pain' ), ), array( 'value' => 'black', 'text' => __( 'Black', 'pain' ), ), ) ) ); } endif; /** * tbbs_BearsBlockDirectLinkParams * */ if( ! function_exists( 'tbbs_BearsBlockDirectLinkParams' ) ) : function tbbs_BearsBlockDirectLinkParams() { return array( array( 'name' => 'title', 'title' => __( 'Title', 'pain' ), 'type' => 'text', 'value' => '', ), array( 'name' => 'sub_title', 'title' => __( 'Sub Title', 'pain' ), 'type' => 'text', 'value' => '', ), array( 'name' => 'link', 'title' => __( 'Link', 'pain' ), 'type' => 'link', 'value' => array( 'text' => '', 'url' => '' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), array( 'value' => 'title_vertical', 'text' => __( 'Title vertical', 'pain' ), ), ) ) ); } endif; /** * tbbs_BearsCarouselGalleryParams * */ if( ! function_exists( 'tbbs_BearsCarouselGalleryParams' ) ) : function tbbs_BearsCarouselGalleryParams() { return array( array( 'name' => 'height', 'title' => __( 'Height', 'pain' ), 'type' => 'text', 'value' => '450px' ), array( 'name' => 'gallery_ids', 'title' => __( 'Gallery Ids', 'pain' ), 'type' => 'media', 'multiple' => true, 'data' => 'id', ), array( 'name' => 'image_size', 'title' => __( 'Image Size', 'pain' ), 'type' => 'imagesize', 'value' => 'medium_large', ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ) ) ) ); } endif; /** * tbbs_BearsCarouselWelfareReviewsParams * */ if( ! function_exists( 'tbbs_BearsCarouselWelfareReviewsParams' ) ) : function tbbs_BearsCarouselWelfareReviewsParams() { return array( array( 'name' => 'count_items', 'title' => __( 'Count Item(s)', 'pain' ), 'type' => 'text', 'value' => 3 ), array( 'name' => 'trim_text', 'title' => __( 'Trim Text', 'pain' ), 'type' => 'text', 'value' => 'full', 'description' => __( 'Ex: 10, 20, full' , 'pain' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ) ) ) ); } endif; /** * tbbs_BearsButtonCustomParams * */ if( ! function_exists( 'tbbs_BearsButtonCustomParams' ) ) : function tbbs_BearsButtonCustomParams() { return array( array( 'name' => 'link', 'title' => __( 'Link', 'pain' ), 'type' => 'link', 'value' => array( 'text' => '', 'url' => '' ), ), array( 'name' => 'align', 'title' => __( 'Align', 'pain' ), 'type' => 'select', 'value' => 'left', 'options' => array( array( 'value' => 'left', 'text' => 'Left' ), array( 'value' => 'center', 'text' => 'Center' ), array( 'value' => 'right', 'text' => 'Right' ), ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'border_line', 'text' => __( 'Border Line', 'pain' ), ), array( 'value' => 'background_color', 'text' => __( 'Background Color (Flow presets)', 'pain' ), ), array( 'value' => 'border_line_shadow_effect', 'text' => __( 'Border Line - Shadow effect', 'pain' ), ), array( 'value' => 'background_color_shadow_effect', 'text' => __( 'Background Color - Shadow effect', 'pain' ), ), ) ) ); } endif; /** * tbbs_BearsBlogCousesParams * */ if( ! function_exists( 'tbbs_BearsBlogCousesParams' ) ) : function tbbs_BearsBlogCousesParams() { return array( array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'show', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 1, 'text' => 'One' ), array( 'value' => 2, 'text' => 'Two' ), array( 'value' => 3, 'text' => 'Three' ), array( 'value' => 4, 'text' => 'Four' ), ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), ) ) ); } endif; if( ! function_exists( 'tbbs_BearsBlogPostParams' ) ) : function tbbs_BearsBlogPostParams() { return array( array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'show', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 2, 'text' => 'Two' ), array( 'value' => 3, 'text' => 'Three' ), array( 'value' => 4, 'text' => 'Four' ), ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'special_first_item', 'options' => array( array( 'value' => 'special_first_item', 'text' => __( 'Special first item', 'pain' ), ), ) ) ); } endif; if( ! function_exists( 'jwsthemes_BearsBlogSpecialParams' ) ) : function jwsthemes_BearsBlogSpecialParams() { return array( array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 2, 'text' => '2 Colmns' ), array( 'value' => 3, 'text' => '3 Colmns' ), array( 'value' => 4, 'text' => '4 Colmns' ), ), ), array( 'name' => 'trim_word', 'title' => __( 'Trim Word', 'pain' ), 'type' => 'text', 'value' => 20, ), array( 'name' => 'readmore_text', 'title' => __( 'Readmore Text', 'pain' ), 'type' => 'text', 'value' => __( 'Readmore...', 'pain' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'zigzag_inline', 'options' => array( array( 'value' => 'zigzag_inline', 'text' => __( 'ZigZag inline', 'pain' ), ), ) ) ); } endif; /** * tbbs_BearsBlogEventsParams * */ if( ! function_exists( 'tbbs_BearsBlogEventsParams' ) ) : function tbbs_BearsBlogEventsParams() { return array( array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'show', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 1, 'text' => 'One' ), array( 'value' => 2, 'text' => 'Two' ), array( 'value' => 3, 'text' => 'Three' ), array( 'value' => 4, 'text' => 'Four' ), ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), array( 'value' => 'grid_basic', 'text' => __( 'Grid Basic', 'pain' ), ), array( 'value' => 'listing', 'text' => __( 'Listing', 'pain' ), ), ) ) ); } endif; if( ! function_exists( 'jwsthemes_BearsBlogEvents2Params' ) ) : function jwsthemes_BearsBlogEvents2Params() { return array( array( 'name' => 'height', 'title' => __( 'Height', 'pain' ), 'type' => 'text', 'value' => '260px', ), array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'hide', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 1, 'text' => '1 Column' ), array( 'value' => 2, 'text' => '2 Columns' ), array( 'value' => 3, 'text' => '3 Columns' ), array( 'value' => 4, 'text' => '4 Columns' ), ), ), array( 'name' => 'trim_word', 'title' => __( 'Trim Word', 'pain' ), 'type' => 'text', 'value' => 20, ), array( 'name' => 'readmore_text', 'title' => __( 'Readmore Text', 'pain' ), 'type' => 'text', 'value' => __( 'Readmore...', 'pain' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'timelife', 'text' => __( 'Time Life', 'pain' ), ), array( 'value' => 'grid_classic', 'text' => __( 'Grid Classis', 'pain' ), ), array( 'value' => 'listing', 'text' => __( 'Listing', 'pain' ), ), ) ) ); } endif; /** * tbbs_BearsBlockCustomParams * */ if( ! function_exists( 'tbbs_BearsBlockCustomParams' ) ) : function tbbs_BearsBlockCustomParams() { return array( array( 'name' => 'image', 'title' => __( 'Image', 'pain' ), 'type' => 'media', 'multiple' => false, 'data' => 'id', ), array( 'name' => 'icon', 'title' => __( 'Icon Class', 'pain' ), 'type' => 'text', 'value' => '' ), array( 'name' => 'title', 'title' => __( 'Title', 'pain' ), 'type' => 'text', 'value' => '' ), array( 'name' => 'sub_title', 'title' => __( 'Sub Title', 'pain' ), 'type' => 'text', 'value' => '' ), array( 'name' => 'content', 'title' => __( 'Content', 'pain' ), 'type' => 'textarea', 'value' => '' ), array( 'name' => 'link', 'title' => __( 'Link', 'pain' ), 'type' => 'link', 'value' => array( 'text' => '', 'url' => '' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Image', 'pain' ), ), array( 'value' => 'icon', 'text' => __( 'Icon', 'pain' ), ), array( 'value' => 'icon2', 'text' => __( 'Icon 2', 'pain' ), ), ) ) ); } endif; /** * get_tbdonations_payment * * @param [string] $sort * @param [int] $limit */ if( ! function_exists( 'get_tbdonations_payment' ) ) : function jwsthemes_get_list_tbdonations_payment( $sort = 'DESC', $limit ) { global $wpdb; $table_prefix = $wpdb->prefix; $result = $wpdb->get_results( "SELECT p.* FROM {$table_prefix}tbdonations_payment as p INNER JOIN {$table_prefix}users as u ON p.user_id = u.ID WHERE p.paid = 1 ORDER BY p.id {$sort} LIMIT {$limit}" ); return $result; } endif; /** * jwsthemes_BearsBlogCharitableParams * */ if( ! function_exists( 'jwsthemes_BearsBlogCharitableParams' ) ) : function jwsthemes_BearsBlogCharitableParams() { return array( array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'hide', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 1, 'text' => '1 Column' ), array( 'value' => 2, 'text' => '2 Columns' ), array( 'value' => 3, 'text' => '3 Columns' ), array( 'value' => 4, 'text' => '4 Columns' ), ), ), array( 'name' => 'orderby', 'title' => __( 'Order By', 'pain' ), 'type' => 'select', 'value' => 'post_date', 'options' => array( array( 'value' => 'post_date', 'text' => __( 'Post Date', 'pain' ), ), array( 'value' => 'popular', 'text' => __( 'Popular', 'pain' ), ), array( 'value' => 'ending', 'text' => __( 'Ending', 'pain' ), ), ) ), array( 'name' => 'trim_word', 'title' => __( 'Trim Word', 'pain' ), 'type' => 'text', 'value' => 20, ), array( 'name' => 'readmore_text', 'title' => __( 'Readmore Text', 'pain' ), 'type' => 'text', 'value' => __( 'Readmore', 'pain' ), ), array( 'name' => 'donate_text', 'title' => __( 'Donate Text', 'pain' ), 'type' => 'text', 'value' => __( 'Donate Now', 'pain' ), ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), ) ), ); } endif; if( ! function_exists( 'jwsthemes_BearsCarouselTeamParams' ) ) : function jwsthemes_BearsCarouselTeamParams() { return array( array( 'name' => 'height', 'title' => __( 'Height', 'pain' ), 'type' => 'text', 'value' => '400px', 'description' => 'Ex: 400px' ), array( 'name' => 'image_size', 'title' => __( 'Image Size', 'pain' ), 'type' => 'imagesize', 'value' => 'medium_large', ), array( 'name' => 'align', 'title' => __( 'Align', 'pain' ), 'type' => 'select', 'value' => 'left', 'options' => array( array( 'value' => 'left', 'text' => __( 'Left', 'pain' ), ), array( 'value' => 'center', 'text' => __( 'Center', 'pain' ), ), array( 'value' => 'right', 'text' => __( 'Right', 'pain' ), ), ) ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'default', 'text' => __( 'Default', 'pain' ), ), ) ), ); } endif; if( ! function_exists( 'jwsthemes_BearsBlog2PostParams' ) ) : function jwsthemes_BearsBlog2PostParams() { return array( array( 'name' => 'show_pagination', 'title' => __( 'Show Pagination', 'pain' ), 'type' => 'select', 'value' => 'hide', 'options' => array( array( 'value' => 'show', 'text' => 'Show' ), array( 'value' => 'hide', 'text' => 'Hide' ), ), ), array( 'name' => 'columns', 'title' => __( 'Columns', 'pain' ), 'type' => 'select', 'value' => 3, 'options' => array( array( 'value' => 1, 'text' => '1 Column' ), array( 'value' => 2, 'text' => '2 Columns' ), array( 'value' => 3, 'text' => '3 Columns' ), array( 'value' => 4, 'text' => '4 Columns' ), ), ), array( 'name' => 'trim_word', 'title' => __( 'Trim Word', 'pain' ), 'type' => 'text', 'value' => 18, ), array( 'name' => 'readmore_text', 'title' => __( 'Readmore Text', 'pain' ), 'type' => 'text', 'value' => __( 'Readmore', 'pain' ), ), array( 'name' => 'image_size', 'title' => __( 'Image Size', 'pain' ), 'type' => 'imagesize', 'value' => 'medium_large', ), array( 'name' => 'layout_item', 'title' => __( 'Layout Item', 'pain' ), 'type' => 'select', 'value' => 'default', 'options' => array( array( 'value' => 'grid_classic', 'text' => __( 'Grid Classic', 'pain' ), ), ) ), ); } endif; /** * jwsthemes_em_wp_query * * @param [array] $args_default * @return $query */ if( ! function_exists( 'jwsthemes_em_wp_query' ) ) : function jwsthemes_em_wp_query( $args_default ) { $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; $args_default['paged'] = $paged; $args_default['post_type'] = 'event'; $args_default['meta_query'] = array( 'key' => '_start_ts', 'value' => current_time('timestamp'), 'compare' => '>=', 'type'=>'numeric' ); // The Query $query = new WP_Query( $args_default ); return $query; } endif; if( ! function_exists( 'jwstheme_eventManagerBook_form' ) ) : function jwstheme_eventManagerBook_form() { extract( $_POST ); $EM_Event = new EM_Event( $event_id ); $output = $EM_Event->output( '#_BOOKINGFORM' ); echo json_encode( array( 'success' => true, 'data' => $output ) );exit(); } endif; add_action( 'wp_ajax_jwstheme_eventManagerBook_form', 'jwstheme_eventManagerBook_form' ); add_action( 'wp_ajax_nopriv_jwstheme_eventManagerBook_form', 'jwstheme_eventManagerBook_form' ); /** * jwsthemes_infoteam_default * */ if( ! function_exists( 'tbbs_quickviewLayout_infoteam_default' ) ) : function tbbs_quickviewLayout_infoteam_default( $post_id ) { wp( 'p=' . $post_id . '&post_type=team' ); ob_start(); while ( have_posts() ) : the_post(); global $post; # thumbnail $thumbnail = ''; if( has_post_thumbnail() ): $thumbnail_data = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); $thumbnail = $thumbnail_data[0]; endif; # meta field $team_position = get_post_meta( $post->ID, 'tb_team_position', true ); $team_contact = array( 'phone' => get_post_meta( $post->ID, 'tb_team_phone', true ), 'twitter' => get_post_meta( $post->ID, 'tb_team_twitter', true ), 'google' => get_post_meta( $post->ID, 'tb_team_google', true ), 'facebook' => get_post_meta( $post->ID, 'tb_team_facebook', true ), 'email' => get_post_meta( $post->ID, 'tb_team_email', true ) ); ?> <div class="bears-quickview-team"> <div class="image-meta" style="background: url(<?php echo esc_attr( $thumbnail ) ?>) no-repeat center center / cover, #fafafa;"> </div> <div class="info-meta"> <h3 class='title'><?php the_title(); ?></h3> <div class='position'><?php echo "{$team_position}"; ?></div> <div class='extra-meta'> <a class='extra-item e-tw' href="<?php echo esc_attr( $team_contact['twitter'] ); ?>" target="_blank"><i class="fa fa-twitter-square"></i></a> <a class='extra-item e-g' href="<?php echo esc_attr( $team_contact['google'] ); ?>" target="_blank"><i class="fa fa-google-plus-square"></i></a> <a class='extra-item e-fb' href="<?php echo esc_attr( $team_contact['facebook'] ); ?>" target="_blank"><i class="fa fa-facebook-square"></i></a> <a class='extra-item e-email' href="mailto:<?php echo esc_attr( $team_contact['email'] ); ?>"><i class="fa fa-envelope"></i></a> <a class='extra-item e-phone' href="#"><i class="fa fa-phone-square"></i> <?php echo "{$team_contact['phone']}"; ?></a> </div> <p class='des'><?php the_content(); ?></p> </div> </div> <?php endwhile; $output = ob_get_clean(); if (function_exists('output_ech')) { output_ech($output); } } endif;