implode( '&family=', $font_families ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2' ); return esc_url_raw($fonts_url); } endif; if( !function_exists( 'allinone_sanitize_sidebar_option_meta' ) ) : // Sidebar Option Sanitize. function allinone_sanitize_sidebar_option_meta( $input ){ $metabox_options = array( 'global-sidebar','left-sidebar','right-sidebar','no-sidebar' ); if( in_array( $input,$metabox_options ) ){ return $input; }else{ return ''; } } endif; if( !function_exists( 'allinone_page_lists' ) ) : // Page List. function allinone_page_lists(){ $page_lists = array(); $page_lists[''] = esc_html__( '-- Select Page --','allinone' ); $pages = get_pages( array ( 'parent' => 0, // replaces 'depth' => 1, ) ); foreach( $pages as $page ){ $page_lists[$page->ID] = $page->post_title; } return $page_lists; } endif; if( !function_exists( 'allinone_sanitize_post_layout_option_meta' ) ) : // Sidebar Option Sanitize. function allinone_sanitize_post_layout_option_meta( $input ){ $metabox_options = array( 'global-layout','layout-1','layout-2' ); if( in_array( $input,$metabox_options ) ){ return $input; }else{ return ''; } } endif; if( !function_exists( 'allinone_sanitize_header_overlay_option_meta' ) ) : // Sidebar Option Sanitize. function allinone_sanitize_header_overlay_option_meta( $input ){ $metabox_options = array( 'global-layout','enable-overlay' ); if( in_array( $input,$metabox_options ) ){ return $input; }else{ return ''; } } endif; /** * Allinone SVG Icon helper functions * * @package Allinone * @since 1.0.0 */ if ( ! function_exists( 'allinone_theme_svg' ) ): /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the Allinone_SVG_Icons class. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function allinone_theme_svg( $svg_name, $return = false ) { if( $return ){ return allinone_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in allinone_get_theme_svg();. }else{ echo allinone_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in allinone_get_theme_svg();. } } endif; if ( ! function_exists( 'allinone_get_theme_svg' ) ): /** * Get information about the SVG icon. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function allinone_get_theme_svg( $svg_name ) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( Allinone_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, ), 'line' => array( 'stroke' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true, ), ) ); if ( ! $svg ) { return false; } return $svg; } endif; if ( ! function_exists( 'allinone_svg_escape' ) ): /** * Get information about the SVG icon. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function allinone_svg_escape( $input ) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( $input, 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, ), ) ); if ( ! $svg ) { return false; } return $svg; } endif; if( !function_exists( 'allinone_social_menu_icon' ) ) : function allinone_social_menu_icon( $item_output, $item, $depth, $args ) { // Add Icon if ( isset( $args->theme_location ) && 'allinone-social-menu' === $args->theme_location ) { $svg = Allinone_SVG_Icons::get_theme_svg_name( $item->url ); if ( empty( $svg ) ) { $svg = allinone_theme_svg( 'link',$return = true ); } $item_output = str_replace( $args->link_after, '' . $svg, $item_output ); } return $item_output; } endif; add_filter( 'walker_nav_menu_start_el', 'allinone_social_menu_icon', 10, 4 ); if ( ! function_exists( 'allinone_sub_menu_toggle_button' ) ) : function allinone_sub_menu_toggle_button( $args, $item, $depth ) { // Add sub menu toggles to the main menu with toggles if ( $args->theme_location == 'allinone-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 == 'allinone-primary-menu' ) { if ( in_array( 'menu-item-has-children', $item->classes ) ) { $args->before = ''; } else { $args->before = ''; $args->after = ''; } } return $args; } add_filter( 'nav_menu_item_args', 'allinone_sub_menu_toggle_button', 10, 3 ); endif; if( !function_exists( 'allinone_post_category_list' ) ) : // Post Category List. function allinone_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','allinone' ); } 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('allinone_sanitize_meta_pagination') ): /** Sanitize Enable Disable Checkbox **/ function allinone_sanitize_meta_pagination( $input ) { $valid_keys = array('global-layout','no-navigation','norma-navigation','ajax-next-post-load'); if ( in_array( $input , $valid_keys ) ) { return $input; } return ''; } endif; if( !function_exists('allinone_disable_post_views') ): /** Disable Post Views **/ function allinone_disable_post_views() { add_filter('booster_extension_filter_views_ed', 'allinone_disable_views_ed'); } endif; if( !function_exists('allinone_disable_views_ed') ): /** Disable Reaction **/ function allinone_disable_views_ed() { return false; } endif; if( !function_exists('allinone_disable_post_read_time') ): /** Disable Read Time **/ function allinone_disable_post_read_time() { add_filter('booster_extension_filter_readtime_ed', 'allinone_disable_read_time'); } endif; if( !function_exists('allinone_disable_read_time') ): /** Disable Reaction **/ function allinone_disable_read_time() { return false; } endif; if( !function_exists('allinone_disable_post_like_dislike') ): /** Disable Like Dislike **/ function allinone_disable_post_like_dislike() { add_filter('booster_extension_filter_like_ed', 'allinone_disable_like_ed'); } endif; if( !function_exists('allinone_disable_like_ed') ): /** Disable Reaction **/ function allinone_disable_like_ed() { return false; } endif; if( !function_exists('allinone_disable_post_author_box') ): /** Disable Author Box **/ function allinone_disable_post_author_box() { add_filter('booster_extension_filter_ab_ed','allinone_disable_ab_ed'); } endif; if( !function_exists('allinone_disable_ab_ed') ): /** Disable Reaction **/ function allinone_disable_ab_ed() { return false; } endif; add_filter('booster_extension_filter_ss_ed', 'allinone_disable_social_share'); if( !function_exists('allinone_disable_social_share') ): /** Disable Reaction **/ function allinone_disable_social_share() { return false; } endif; if( !function_exists('allinone_disable_post_reaction') ): /** Disable Reaction **/ function allinone_disable_post_reaction() { add_filter('booster_extension_filter_reaction_ed', 'allinone_disable_reaction_cb'); } endif; if( !function_exists('allinone_disable_reaction_cb') ): /** Disable Reaction **/ function allinone_disable_reaction_cb() { return false; } endif; if( !function_exists( 'allinone_header_ad' ) ): function allinone_header_ad(){ $allinone_default = allinone_get_default_theme_options(); $ed_header_ad = get_theme_mod( 'ed_header_ad',$allinone_default['ed_header_ad'] ); $ed_header_type = get_theme_mod( 'ed_header_type',$allinone_default['ed_header_type'] ); $addvertisement_section_title = get_theme_mod( 'addvertisement_section_title',$allinone_default['addvertisement_section_title'] ); $header_ad_image = get_theme_mod( 'header_ad_image' ); $ed_header_link = get_theme_mod( 'ed_header_link' ); if( $ed_header_ad ){ ?> ID ) ){ $prev_link = get_permalink( $prev_post->ID );?> ID ) ){ $next_link = get_permalink( $next_post->ID );?> ID; if( $twp_navigation_type == '' || $twp_navigation_type == 'global-layout' ){ $twp_navigation_type = get_theme_mod('twp_navigation_type', $allinone_default['twp_navigation_type']); } if( $allinone_header_trending_page != $current_id && $allinone_header_popular_page != $current_id ){ if( $twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){ if( $twp_navigation_type == 'norma-navigation' ){ ?> ID ) ){ $next_post_id = $next_post->ID; echo ''; } } } } } endif; add_action( 'allinone_navigation_action','allinone_single_post_navigation',30 ); if( !function_exists('allinone_header_banner') ): function allinone_header_banner(){ global $post; if( have_posts() ): while (have_posts()) : the_post(); global $post; endwhile; endif; $allinone_post_layout = ''; $allinone_default = allinone_get_default_theme_options(); if( is_singular() ){ $allinone_post_layout = esc_html( get_post_meta( $post->ID, 'allinone_post_layout', true ) ); if( $allinone_post_layout == '' || $allinone_post_layout == 'global-layout' ){ $allinone_post_layout = get_theme_mod( 'allinone_single_post_layout',$allinone_default['allinone_archive_layout'] ); } } if( isset( $post->ID ) ){ $allinone_page_layout = esc_html( get_post_meta( $post->ID, 'allinone_page_layout', true ) ); } if( $allinone_post_layout == 'layout-2' && is_singular('post') ) { if ( have_posts() ) : while ( have_posts() ) : the_post(); $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(),'full' ); $allinone_ed_feature_image = esc_html( get_post_meta( get_the_ID(), 'allinone_ed_feature_image', true ) ); ?>