implode( '&family=', $font_families ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2' ); return esc_url_raw($fonts_url); } endif; if( !function_exists( 'boundlessnews_sanitize_sidebar_option_meta' ) ) : // Sidebar Option Sanitize. function boundlessnews_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( 'boundlessnews_page_lists' ) ) : // Page List. function boundlessnews_page_lists(){ $page_lists = array(); $page_lists[''] = esc_html__( '-- Select Page --','boundlessnews' ); $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( 'boundlessnews_sanitize_post_layout_option_meta' ) ) : // Sidebar Option Sanitize. function boundlessnews_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( 'boundlessnews_sanitize_header_overlay_option_meta' ) ) : // Sidebar Option Sanitize. function boundlessnews_sanitize_header_overlay_option_meta( $input ){ $metabox_options = array( 'global-layout','enable-overlay' ); if( in_array( $input,$metabox_options ) ){ return $input; }else{ return ''; } } endif; /** * BoundlessNews SVG Icon helper functions * * @package WordPress * @subpackage BoundlessNews * @since 1.0.0 */ if ( ! function_exists( 'boundlessnews_the_theme_svg' ) ): /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the BoundlessNews_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 boundlessnews_the_theme_svg( $svg_name, $return = false ) { if( $return ){ return boundlessnews_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in boundlessnews_get_theme_svg();. }else{ echo boundlessnews_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in boundlessnews_get_theme_svg();. } } endif; if ( ! function_exists( 'boundlessnews_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 boundlessnews_get_theme_svg( $svg_name ) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( BoundlessNews_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, ), ) ); if ( ! $svg ) { return false; } return $svg; } endif; if ( ! function_exists( 'boundlessnews_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 boundlessnews_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('boundlessnews_post_format_icon') ): // Post Format Icon. function boundlessnews_post_format_icon( $format ){ if( $format == 'video' ){ $icon = boundlessnews_get_theme_svg( 'video' ); }elseif( $format == 'audio' ){ $icon = boundlessnews_get_theme_svg( 'audio' ); }elseif( $format == 'gallery' ){ $icon = boundlessnews_get_theme_svg( 'gallery' ); }elseif( $format == 'quote' ){ $icon = boundlessnews_get_theme_svg( 'quote' ); }elseif( $format == 'image' ){ $icon = boundlessnews_get_theme_svg( 'image' ); }else{ $icon = ''; } return $icon; } endif; if( !function_exists( 'boundlessnews_social_menu_icon' ) ) : function boundlessnews_social_menu_icon( $item_output, $item, $depth, $args ) { // Add Icon if ( isset( $args->theme_location ) && 'boundlessnews-social-menu' === $args->theme_location ) { $svg = BoundlessNews_SVG_Icons::get_theme_svg_name( $item->url ); if ( empty( $svg ) ) { $svg = boundlessnews_the_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', 'boundlessnews_social_menu_icon', 10, 4 ); if ( ! function_exists( 'boundlessnews_sub_menu_toggle_button' ) ) : function boundlessnews_sub_menu_toggle_button( $args, $item, $depth ) { // Add sub menu toggles to the main menu with toggles if ( $args->theme_location == 'boundlessnews-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 == 'boundlessnews-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', 'boundlessnews_sub_menu_toggle_button', 10, 3 ); endif; if( !function_exists( 'boundlessnews_post_category_list' ) ) : // Post Category List. function boundlessnews_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 --','boundlessnews' ); } 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('boundlessnews_sanitize_meta_pagination') ): /** Sanitize Enable Disable Checkbox **/ function boundlessnews_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('boundlessnews_disable_post_views') ): /** Disable Post Views **/ function boundlessnews_disable_post_views() { add_filter('booster_extension_filter_views_ed', 'boundlessnews_disable_views_ed'); } endif; if( !function_exists('boundlessnews_disable_views_ed') ): /** Disable Reaction **/ function boundlessnews_disable_views_ed() { return false; } endif; if( !function_exists('boundlessnews_disable_post_read_time') ): /** Disable Read Time **/ function boundlessnews_disable_post_read_time() { add_filter('booster_extension_filter_readtime_ed', 'boundlessnews_disable_read_time'); } endif; if( !function_exists('boundlessnews_disable_read_time') ): /** Disable Reaction **/ function boundlessnews_disable_read_time() { return false; } endif; if( !function_exists('boundlessnews_disable_post_like_dislike') ): /** Disable Like Dislike **/ function boundlessnews_disable_post_like_dislike() { add_filter('booster_extension_filter_like_ed', 'boundlessnews_disable_like_ed'); } endif; if( !function_exists('boundlessnews_disable_like_ed') ): /** Disable Reaction **/ function boundlessnews_disable_like_ed() { return false; } endif; if( !function_exists('boundlessnews_disable_post_author_box') ): /** Disable Author Box **/ function boundlessnews_disable_post_author_box() { add_filter('booster_extension_filter_ab_ed','boundlessnews_disable_ab_ed'); } endif; if( !function_exists('boundlessnews_disable_ab_ed') ): /** Disable Reaction **/ function boundlessnews_disable_ab_ed() { return false; } endif; add_filter('booster_extension_filter_ss_ed', 'boundlessnews_disable_social_share'); if( !function_exists('boundlessnews_disable_social_share') ): /** Disable Reaction **/ function boundlessnews_disable_social_share() { return false; } endif; if( !function_exists('boundlessnews_disable_post_reaction') ): /** Disable Reaction **/ function boundlessnews_disable_post_reaction() { add_filter('booster_extension_filter_reaction_ed', 'boundlessnews_disable_reaction_cb'); } endif; if( !function_exists('boundlessnews_disable_reaction_cb') ): /** Disable Reaction **/ function boundlessnews_disable_reaction_cb() { return false; } endif; if( !function_exists( 'boundlessnews_header_ad' ) ): function boundlessnews_header_ad(){ $boundlessnews_default = boundlessnews_get_default_theme_options(); $ed_header_ad = get_theme_mod( 'ed_header_ad',$boundlessnews_default['ed_header_ad'] ); $header_ad_image = get_theme_mod( 'header_ad_image' ); $ed_header_link = get_theme_mod( 'ed_header_link' ); if( $ed_header_ad ){ ?>
<?php esc_attr_e('Header AD Image','boundlessnews'); ?>
ID ) ){ $prev_link = get_permalink( $prev_post->ID );?>
ID,'medium' ) ){ ?> ID,'medium' ) ); ?> ID ) ); ?>
ID ) ){ $next_link = get_permalink( $next_post->ID );?>
ID,'medium' ) ){ ?> ID,'medium' ) ); ?> ID ) ); ?>
ID; if( $twp_navigation_type == '' || $twp_navigation_type == 'global-layout' ){ $twp_navigation_type = get_theme_mod('twp_navigation_type', $boundlessnews_default['twp_navigation_type']); } if( $boundlessnews_header_trending_page != $current_id && $boundlessnews_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( 'boundlessnews_navigation_action','boundlessnews_single_post_navigation',30 ); if( !function_exists('boundlessnews_header_banner') ): function boundlessnews_header_banner(){ global $post; if( have_posts() ): while (have_posts()) : the_post(); global $post; endwhile; endif; $boundlessnews_post_layout = ''; $boundlessnews_default = boundlessnews_get_default_theme_options(); if( is_singular() ){ $boundlessnews_post_layout = esc_html( get_post_meta( $post->ID, 'boundlessnews_post_layout', true ) ); if( $boundlessnews_post_layout == '' || $boundlessnews_post_layout == 'global-layout' ){ $boundlessnews_post_layout = get_theme_mod( 'boundlessnews_single_post_layout',$boundlessnews_default['boundlessnews_archive_layout'] ); } } if( isset( $post->ID ) ){ $boundlessnews_page_layout = esc_html( get_post_meta( $post->ID, 'boundlessnews_page_layout', true ) ); } if( $boundlessnews_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' ); $boundlessnews_ed_feature_image = esc_html( get_post_meta( get_the_ID(), 'boundlessnews_ed_feature_image', true ) ); ?> 'post', 'posts_per_page' => 5,'post__not_in' => get_option("sticky_posts") ) ); if( $recent_posts_query->have_posts() ): ?> '0', 'exclude' => '1', ) ); $slug_counts = array(); foreach( $post_cat_lists as $post_cat_list ){ if( $post_cat_list->count >= 1 ){ $slug_counts[] = array( 'count' => $post_cat_list->count, 'slug' => $post_cat_list->slug, 'name' => $post_cat_list->name, 'cat_ID' => $post_cat_list->cat_ID, 'description' => $post_cat_list->category_description, ); } } if( $slug_counts ){?>
'boundlessnews-social-menu', 'link_before' => '', 'link_after' => '', 'container' => 'div', 'container_class' => 'boundlessnews-social-menu', 'depth' => 1, ) ); ?>
'post', 'posts_per_page' => 9, 'post__not_in' => get_option("sticky_posts"), 'category_name' => $boundlessnews_header_trending_cat, ) ); if( $trending_news_query->have_posts() ): ?>
'); ?> '); ?>
'post', 'posts_per_page' => 6, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $category ), 'post_status' => 'publish' ) ); $tab_post_query_1 = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 6, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $category ), 'post_status' => 'publish' ) ); if( $tab_post_query ->have_posts() ): ?>
have_posts()) { $tab_post_query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'boundlessnews-500-300'); $featured_image = isset( $featured_image[0] ) ? $featured_image[0] : ''; ?>
>

have_posts()) { $tab_post_query_1->the_post(); if( $post_count != 1 && $post_count != 2 ){ $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); $featured_image = isset( $featured_image[0] ) ? $featured_image[0] : ''; ?>
>

'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($boundlessnews_header_ticker_cat))); if( $ticker_posts_query->have_posts() ): ?>
have_posts()): $ticker_posts_query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium'); $featured_image = isset( $featured_image[0] ) ? $featured_image[0] : ''; ?>
>

'; echo '
'; } endif; if( !function_exists('boundlessnews_woo_after_main_content') ): function boundlessnews_woo_after_main_content(){ $boundlessnews_default = boundlessnews_get_default_theme_options(); $sidebar = esc_attr( get_theme_mod( 'global_sidebar_layout', $boundlessnews_default['global_sidebar_layout'] ) ); if( $sidebar != 'no-sidebar' ){ get_sidebar(); } echo '
'; echo ''; } endif; if( !function_exists('boundlessnews_content_loading') ){ function boundlessnews_content_loading(){ ?>
'post', 'posts_per_page' => 50, 'post__not_in' => get_option("sticky_posts") ) ); $tag_lists = array(); if( $latest_post_query->have_posts() ): while( $latest_post_query->have_posts() ): $latest_post_query->the_post(); $tags = get_the_tags( get_the_ID() ); if( $tags ){ foreach( $tags as $tag ){ if( !in_array($tag->term_id, $tag_lists) ){ $tag_lists[ $tag->term_id ] = $tag->count; } } } endwhile; endif; arsort( $tag_lists); $boundlessnews_default = boundlessnews_get_default_theme_options(); $ed_header_tags = get_theme_mod( 'ed_header_tags',$boundlessnews_default['ed_header_tags'] ); if( $ed_header_tags ){ $ed_header_tags_title = get_theme_mod( 'ed_header_tags_title',$boundlessnews_default['ed_header_tags_title'] ); $ed_header_tags_count = get_theme_mod( 'ed_header_tags_count',$boundlessnews_default['ed_header_tags_count'] ); ?>
$value ){ $tag = get_tag($key); // <-- your tag ID ?> name); ?>
'', 'echo' => false ) ); $after_content = $pagination_single.$after_content; return $after_content; } endif; if( ! function_exists( 'boundlessnews_iframe_escape' ) ): /** Escape Iframe **/ function boundlessnews_iframe_escape( $input ){ $all_tags = array( 'iframe'=>array( 'width'=>array(), 'height'=>array(), 'src'=>array(), 'frameborder'=>array(), 'allow'=>array(), 'allowfullscreen'=>array(), ), 'video'=>array( 'width'=>array(), 'height'=>array(), 'src'=>array(), 'style'=>array(), 'controls'=>array(), ) ); return wp_kses($input,$all_tags); } endif; if( ! function_exists( 'boundlessnews_post_permalink' ) ): function boundlessnews_post_permalink(){ ?>
esc_html__( 'Global', 'boundlessnews' ), 'default' => esc_html__( 'Default', 'boundlessnews' ), 'square' => esc_html__( 'Square', 'boundlessnews' ), 'portrait' => esc_html__( 'Portrait', 'boundlessnews' ), 'landscape' => esc_html__( 'Landscape', 'boundlessnews' ), ); } endif; if( !function_exists('boundlessnews_video_autoplay') ): function boundlessnews_video_autoplay(){ return $boundlessnews_video_autoplay = array( 'global' => esc_html__( 'Global', 'boundlessnews' ), 'autoplay-disable' => esc_html__( 'Disable Autoplay', 'boundlessnews' ), 'autoplay-enable' => esc_html__( 'Enable Autoplay', 'boundlessnews' ), ); } endif; add_filter('comment_form_defaults','boundlessnews_comment_title_callback'); if( !function_exists('boundlessnews_comment_title_callback') ): function boundlessnews_comment_title_callback($defaults){ $defaults['title_reply_before'] = '

'; $defaults['title_reply_after'] = '

'; return $defaults; } endif; /** * Print the first instance of a block in the content, and then break away. * * @since BoundlessNews 1.0.7 * * @param string $block_name The full block type name, or a partial match. * Example: `core/image`, `core-embed/*`. * @param string|null $content The content to search in. Use null for get_the_content(). * @param int $instances How many instances of the block will be printed (max). Default 1. * @return bool Returns true if a block was located & printed, otherwise false. */ function boundlessnews_print_first_instance_of_block( $block_name, $content = null, $instances = 1 ) { $instances_count = 0; $blocks_content = ''; if ( ! $content ) { $content = get_the_content(); } // Parse blocks in the content. $blocks = parse_blocks( $content ); // Loop blocks. foreach ( $blocks as $block ) { // Sanity check. if ( ! isset( $block['blockName'] ) ) { continue; } // Check if this the block matches the $block_name. $is_matching_block = false; // If the block ends with *, try to match the first portion. if ( '*' === $block_name[-1] ) { $is_matching_block = 0 === strpos( $block['blockName'], rtrim( $block_name, '*' ) ); } else { $is_matching_block = $block_name === $block['blockName']; } if ( $is_matching_block ) { // Increment count. $instances_count++; // Add the block HTML. $blocks_content .= render_block( $block ); // Break the loop if the $instances count was reached. if ( $instances_count >= $instances ) { break; } } } if ( $blocks_content ) { /** This filter is documented in wp-includes/post-template.php */ echo apply_filters( 'the_content', $blocks_content ); // phpcs:ignore WordPress.Security.EscapeOutput return true; } return false; }