%2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); echo '' . $time_string . ''; } endif; if( ! function_exists( 'travel_agency_posted_by' ) ) : /** * Posted By */ function travel_agency_posted_by(){ echo '' . esc_html( get_the_author() ) . ''; } endif; if( ! function_exists( 'travel_agency_categories' ) ) : /** * Blog Categories */ function travel_agency_categories(){ // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'travel-agency' ) ); if ( $categories_list ) { echo '' . $categories_list . ''; } } } endif; if( ! function_exists( 'travel_agency_tags' ) ) : /** * Blog Categories */ function travel_agency_tags(){ // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { $tags_list = get_the_tag_list( '', ' ' ); if ( $tags_list ) { echo '
' . $tags_list . '
'; // WPCS: XSS OK. } } } endif; if ( ! function_exists( 'travel_agency_comment_count' ) ) : /** * Comments counts */ function travel_agency_comment_count(){ if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'travel-agency' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), __( '1', 'travel-agency' ), '%' ); echo ''; } } endif; if( ! function_exists( 'travel_agency_sidebar_layout' ) ) : /** * Return sidebar layouts for pages */ function travel_agency_sidebar_layout(){ global $post; if( get_post_meta( $post->ID, '_sidebar_layout', true ) ){ return get_post_meta( $post->ID, '_sidebar_layout', true ); }else{ return 'right-sidebar'; } } endif; if( ! function_exists( 'travel_agency_comment_list' ) ) : /** * Callback function for Comment List * * @link https://codex.wordpress.org/Function_Reference/wp_list_comments */ function travel_agency_comment_list( $comment, $args, $depth ) { if ( 'div' === $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
comment_approved == '0' ){ ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
wte_trip_currency_code_converter( $code ); } $currency = $obj->wp_travel_engine_currencies_symbol( $code ); } return $currency; } endif; if( ! function_exists( 'travel_agency_get_trip_currency_code' ) ) : /** * Get currency code for WP Travel Engine Trip */ function travel_agency_get_trip_currency_code( $post ){ $code = 'USD'; $wpte_setting = get_option( 'wp_travel_engine_settings', true ); $user = get_userdata( $post->post_author ); if ( class_exists( 'Vendor_Wp_Travel_Engine' ) && $user && in_array( 'trip_vendor', $user->roles ) ) { $userid = $user->ID; $user = get_user_meta( $userid, 'wpte_vendor',true ); if( isset( $user['currency_code'] ) && $user['currency_code']!='' ) { $code = $user['currency_code']; } } elseif( isset($wpte_setting['currency_code']) && $wpte_setting['currency_code']!='') { $code = esc_attr( $wpte_setting['currency_code'] ); } $apiKey = isset($wpte_setting['currency_converter_api']) && $wpte_setting['currency_converter_api']!='' ? esc_attr($wpte_setting['currency_converter_api']) : ''; if( class_exists( 'Wte_Trip_Currency_Converter_Init' ) && $apiKey != '' ) { $obj = new Wte_Trip_Currency_Converter_Init(); $code = $obj->wte_trip_currency_code_converter( $code ); } return $code; } endif; if( ! function_exists( 'travel_agency_get_template_part' ) ) : /** * Get template from plus, companion or theme. * * @param string $template Name of the section. */ function travel_agency_get_template_part( $template ) { if( locate_template( 'sections/' . $template . '.php' ) ){ get_template_part( 'sections/' . $template ); }else{ if( defined( 'TRAVEL_AGENCY_COMPANION_PATH' ) ){ if( file_exists( TRAVEL_AGENCY_COMPANION_PATH . 'public/sections/' . $template . '.php' ) ){ require_once( TRAVEL_AGENCY_COMPANION_PATH . 'public/sections/' . $template . '.php' ); } } } } endif; if( ! function_exists( 'travel_agency_primary_menu_fallback' ) ) : /** * Fallback for primary menu */ function travel_agency_primary_menu_fallback(){ if( current_user_can( 'manage_options' ) ){ echo ''; } } endif; if( ! function_exists( 'travel_agency_get_homepage_section' ) ) : /** * Return homepage sections */ function travel_agency_get_homepage_section(){ $sections = array(); $ed_banner = get_theme_mod( 'ed_banner', true ); $ed_search_bar = get_theme_mod( 'ed_search_bar', true ); $ed_about = get_theme_mod( 'ed_about_section', true ); $ed_activities = get_theme_mod( 'ed_activities_section', true ); $ed_popular = get_theme_mod( 'ed_popular_section', true ); $ed_why_us = get_theme_mod( 'ed_why_us_section', true ); $ed_feature = get_theme_mod( 'ed_feature_section', true ); $ed_stat = get_theme_mod( 'ed_stat_section', true ); $ed_deal = get_theme_mod( 'ed_deal_section', true ); $ed_cta = get_theme_mod( 'ed_cta_section', true ); $ed_blog = get_theme_mod( 'ed_blog_section', true ); if( $ed_banner ) array_push( $sections, 'banner' ); if( $ed_search_bar && travel_agency_is_wte_advanced_search_active() ) array_push( $sections, 'search' ); // Sections from travel agency companion if( $ed_about ) array_push( $sections, 'about' ); if( $ed_activities ) array_push( $sections, 'activities' ); if( $ed_popular ) array_push( $sections, 'popular' ); if( $ed_why_us ) array_push( $sections, 'our-feature' ); if( $ed_feature ) array_push( $sections, 'featured-trip' ); if( $ed_stat ) array_push( $sections, 'stats' ); if( $ed_deal ) array_push( $sections, 'deals' ); if( $ed_cta ) array_push( $sections, 'cta' ); if( $ed_blog ) array_push( $sections, 'blog' ); return apply_filters( 'ta_home_sections', $sections ); } endif; if( ! function_exists( 'travel_agency_get_header_search' ) ) : /** * Display search button in header */ function travel_agency_get_header_search(){ $ed_search = get_theme_mod( 'ed_search', true ); if( $ed_search ){ ?>
'page', 'fields' => 'ids', 'nopaging' => true, 'meta_key' => '_wp_page_template', 'meta_value' => $template_name ); return $pages = get_posts( $args ); } endif; /** * Check if Wp Travel Engine Plugin is installed */ function travel_agency_is_wpte_activated(){ return class_exists( 'Wp_Travel_Engine' ) ? true : false; } /** * Check if WP Travel Engine - Group Discount Plugin is installed */ function travel_agency_is_wpte_gd_activated(){ return class_exists( 'Wp_Travel_Engine_Group_Discount' ) ? true : false; } /** * Check if WP Travel Engine - Trip Reviews Plugin is installed */ function travel_agency_is_wpte_tr_activated(){ return class_exists( 'Wte_Trip_Review_Init' ) ? true : false; } /** * Check if WP WP Travel Engine - Trip Fixed Starting Dates Plugin is installed */ function travel_agency_is_wpte_tfsd_activated(){ return class_exists( 'WTE_Fixed_Starting_Dates' ) ? true : false; } /** * Check if WTE Advance Search is active */ function travel_agency_is_wte_advanced_search_active(){ return class_exists( 'Wte_Advanced_Search' ) ? true : false; } if( ! function_exists( 'travel_agency_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * * @return string */ function travel_agency_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; if( ! function_exists( 'travel_agency_trip_archive_currency_symbol_options' ) ) : /** * */ function travel_agency_trip_archive_currency_symbol_options( $trip_id, $code, $currency, $show_prev_cost = false ){ $obj = new Wp_Travel_Engine_Functions(); $meta = get_post_meta( $trip_id, 'wp_travel_engine_setting', true ); $trip_post = get_post( $trip_id ); $settings = get_option( 'wp_travel_engine_settings' ); $option = isset( $settings['currency_option'] ) && $settings['currency_option']!='' ? esc_attr( $settings['currency_option'] ) : 'symbol'; if( isset( $option ) && $option != 'symbol'){ $currency = $code; } if( ( isset( $meta['trip_prev_price'] ) && $meta['trip_prev_price'] ) || ( isset( $meta['sale'] ) && $meta['sale'] && isset( $meta['trip_price'] ) && $meta['trip_price'] ) ){ echo ''; if( ( isset( $meta['trip_prev_price'] ) && $meta['trip_prev_price'] ) && ( isset( $meta['sale'] ) && $meta['sale'] ) && ( isset( $meta['trip_price'] ) && $meta['trip_price'] ) ) { $cost = wp_travel_engine_get_sale_price( $trip_id ); $prev_cost = wp_travel_engine_get_prev_price( $trip_id ); if( $show_prev_cost ){ echo ''. wte_get_formated_price_html( $prev_cost ) .''; echo wte_get_formated_price_html( $cost ); echo ''; }else{ echo ''. wte_get_formated_price_html( $cost ) .''; } } elseif( isset( $meta['trip_prev_price'] ) && $meta['trip_prev_price'] ) { $prev_cost = wp_travel_engine_get_prev_price( $trip_id ); echo ''. wte_get_formated_price_html( $prev_cost ) .''; } echo ''; } } endif; if( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * Added for backwards compatibility to support pre 5.2.0 WordPress versions. */ function wp_body_open() { /** * Triggered after the opening tag. */ do_action( 'wp_body_open' ); } endif; if( ! function_exists( 'travel_agency_get_image_sizes' ) ) : /** * Get information about available image sizes */ function travel_agency_get_image_sizes( $size = '' ) { global $_wp_additional_image_sizes; $sizes = array(); $get_intermediate_image_sizes = get_intermediate_image_sizes(); // Create the full array with sizes and crop info foreach( $get_intermediate_image_sizes as $_size ) { if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) { $sizes[ $_size ]['width'] = get_option( $_size . '_size_w' ); $sizes[ $_size ]['height'] = get_option( $_size . '_size_h' ); $sizes[ $_size ]['crop'] = (bool) get_option( $_size . '_crop' ); } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) { $sizes[ $_size ] = array( 'width' => $_wp_additional_image_sizes[ $_size ]['width'], 'height' => $_wp_additional_image_sizes[ $_size ]['height'], 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'] ); } } // Get only 1 size if found if ( $size ) { if( isset( $sizes[ $size ] ) ) { return $sizes[ $size ]; } else { return false; } } return $sizes; } endif; if ( ! function_exists( 'travel_agency_get_fallback_svg' ) ) : /** * Get Fallback SVG */ function travel_agency_get_fallback_svg( $post_thumbnail ) { if( ! $post_thumbnail ){ return; } $image_size = travel_agency_get_image_sizes( $post_thumbnail ); if( $image_size ){ ?>
urlencode( implode( '|', $font_families ) ), 'display' => urlencode( 'fallback' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url( $fonts_url ); } endif;