implode( '&family=', $font_families ),
'display' => 'swap',
), 'https://fonts.googleapis.com/css2' );
return esc_url_raw($fonts_url);
}
endif;
if ( ! function_exists( 'aviation_industry_sub_menu_toggle_button' ) ) :
function aviation_industry_sub_menu_toggle_button( $args, $item, $depth ) {
// Add sub menu toggles to the main menu with toggles
if ( $args->theme_location == 'aviation-industry-primary-menu' && isset( $args->show_toggles ) ) {
// Wrap the menu item link contents in a div, used for positioning
$args->before = '
';
// Add sub menu icons to the main menu without toggles (the fallback menu)
}elseif( $args->theme_location == 'aviation-industry-primary-menu' ) {
if ( in_array( 'menu-item-has-children', $item->classes ) ) {
$args->before = '';
$args->after = aviation_industry_get_theme_svg( 'chevron-down' ) . '
';
} else {
$args->before = '';
$args->after = '';
}
}
return $args;
}
endif;
add_filter( 'nav_menu_item_args', 'aviation_industry_sub_menu_toggle_button', 10, 3 );
if ( ! function_exists( 'aviation_industry_the_theme_svg' ) ):
function aviation_industry_the_theme_svg( $svg_name, $return = false ) {
if( $return ){
return aviation_industry_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in aviation_industry_get_theme_svg();.
}else{
echo aviation_industry_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in aviation_industry_get_theme_svg();.
}
}
endif;
if ( ! function_exists( 'aviation_industry_get_theme_svg' ) ):
function aviation_industry_get_theme_svg( $svg_name ) {
// Make sure that only our allowed tags and attributes are included.
$svg = wp_kses(
Aviation_Industry_SVG_Icons::get_svg( $svg_name ),
array(
'svg' => array(
'class' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true,
'aria-hidden' => true,
'role' => true,
'focusable' => true,
),
'path' => array(
'fill' => true,
'fill-rule' => true,
'd' => true,
'transform' => true,
),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
'points' => true,
'transform' => true,
'focusable' => true,
),
'polyline' => array(
'fill' => true,
'points' => true,
),
'line' => array(
'fill' => true,
'x1' => true,
'x2' => true,
'y1' => true,
'y2' => true,
),
)
);
if ( ! $svg ) {
return false;
}
return $svg;
}
endif;
if( !function_exists( 'aviation_industry_post_category_list' ) ) :
// Post Category List.
function aviation_industry_post_category_list( $select_cat = true ){
$post_cat_lists = get_categories(
array(
'hide_empty' => '0',
'exclude' => '1',
)
);
$post_cat_cat_array = array();
if( $select_cat ){
$post_cat_cat_array[''] = esc_html__( '-- Select Category --','aviation-industry' );
}
foreach ( $post_cat_lists as $post_cat_list ) {
$post_cat_cat_array[$post_cat_list->slug] = $post_cat_list->name;
}
return $post_cat_cat_array;
}
endif;
if( !function_exists('aviation_industry_single_post_navigation') ):
function aviation_industry_single_post_navigation(){
$aviation_industry_footer_column_layout = aviation_industry_get_default_theme_options();
$aviation_industry_twp_navigation_type = esc_attr( get_post_meta( get_the_ID(), 'aviation_industry_twp_disable_ajax_load_next_post', true ) );
$current_id = '';
$article_wrap_class = '';
global $post;
$current_id = $post->ID;
if( $aviation_industry_twp_navigation_type == '' || $aviation_industry_twp_navigation_type == 'global-layout' ){
$aviation_industry_twp_navigation_type = get_theme_mod('aviation_industry_twp_navigation_type', $aviation_industry_footer_column_layout['aviation_industry_twp_navigation_type']);
}
if( $aviation_industry_twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){
if( $aviation_industry_twp_navigation_type == 'theme-normal-navigation' ){ ?>
'' . aviation_industry_the_theme_svg('arrow-left',$return = true ) . '' . esc_html__('Previous post:', 'aviation-industry') . '%title',
'next_text' => '' . aviation_industry_the_theme_svg('arrow-right',$return = true ) . '' . esc_html__('Next post:', 'aviation-industry') . '%title',
)); ?>
ID ) ){
$next_post_id = $next_post->ID;
echo '';
}
}
}
}
endif;
add_action( 'aviation_industry_navigation_action','aviation_industry_single_post_navigation',30 );
if( !function_exists('aviation_industry_content_offcanvas') ):
// Offcanvas Contents
function aviation_industry_content_offcanvas(){ ?>
'post', 'posts_per_page' => 4,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $aviation_industry_header_banner_cat ) ) );
if( $banner_query->have_posts() ): ?>
>
have_posts() ):
$banner_query->the_post();
$aviation_industry_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
$aviation_industry_featured_image = isset( $aviation_industry_featured_image[0] ) ? $aviation_industry_featured_image[0] : ''; ?>
'post', 'posts_per_page' => 8,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $aviation_industry_services_sec_cat ) ) );
if( $banner_query->have_posts() ): ?>
>
have_posts() ):
$banner_query->the_post();
$aviation_industry_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
$aviation_industry_featured_image = isset( $aviation_industry_featured_image[0] ) ? $aviation_industry_featured_image[0] : '';
$aviation_industry_services_icon = get_theme_mod( 'aviation_industry_services_icon' .$s,'' );
?>
'.esc_html( $aviation_industry_title ).''; } ?>
array(
'class' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true,
'aria-hidden' => true,
'role' => true,
'focusable' => true,
),
'path' => array(
'fill' => true,
'fill-rule' => true,
'd' => true,
'transform' => true,
),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
'points' => true,
'transform' => true,
'focusable' => true,
),
)
);
if ( ! $svg ) {
return false;
}
return $svg;
}
endif;
if( !function_exists( 'aviation_industry_sanitize_sidebar_option_meta' ) ) :
// Sidebar Option Sanitize.
function aviation_industry_sanitize_sidebar_option_meta( $input ){
$aviation_industry_metabox_options = array( 'global-sidebar','left-sidebar','right-sidebar','no-sidebar' );
if( in_array( $input,$aviation_industry_metabox_options ) ){
return $input;
}else{
return '';
}
}
endif;
if( !function_exists( 'aviation_industry_sanitize_pagination_meta' ) ) :
// Sidebar Option Sanitize.
function aviation_industry_sanitize_pagination_meta( $input ){
$aviation_industry_metabox_options = array( 'Center','Right','Left');
if( in_array( $input,$aviation_industry_metabox_options ) ){
return $input;
}else{
return '';
}
}
endif;
if( !function_exists( 'aviation_industry_sanitize_menu_transform' ) ) :
// Sidebar Option Sanitize.
function aviation_industry_sanitize_menu_transform( $input ){
$aviation_industry_metabox_options = array( 'capitalize','uppercase','lowercase');
if( in_array( $input,$aviation_industry_metabox_options ) ){
return $input;
}else{
return '';
}
}
endif;
if( !function_exists( 'aviation_industry_sanitize_page_content_alignment' ) ) :
// Sidebar Option Sanitize.
function aviation_industry_sanitize_page_content_alignment( $input ){
$aviation_industry_metabox_options = array( 'left','center','right');
if( in_array( $input,$aviation_industry_metabox_options ) ){
return $input;
}else{
return '';
}
}
endif;
if( !function_exists( 'aviation_industry_sanitize_footer_widget_title_alignment' ) ) :
// Footer Option Sanitize.
function aviation_industry_sanitize_footer_widget_title_alignment( $input ){
$aviation_industry_metabox_options = array( 'left','center','right');
if( in_array( $input,$aviation_industry_metabox_options ) ){
return $input;
}else{
return '';
}
}
endif;