implode( '&family=', $font_families ),
'display' => 'swap',
), 'https://fonts.googleapis.com/css2' );
return esc_url_raw($fonts_url);
}
endif;
if( !function_exists('alok_read_more_render') ):
function alok_read_more_render(){ ?>
theme_location ) {
$svg = Alok_SVG_Icons::get_theme_svg_name( $item->url );
if ( empty( $svg ) ) {
$svg = alok_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', 'alok_social_menu_icon', 10, 4 );
if( !function_exists( 'alok_add_sub_toggles_to_main_menu' ) ) :
function alok_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
// Add sub menu toggles to the Expanded Menu with toggles.
if( isset( $args->show_toggles ) && $args->show_toggles ){
// Wrap the menu item link contents in a div, used for positioning.
$args->before = '';
// Add sub menu icons to the primary menu without toggles.
}elseif( 'alok-primary-menu' === $args->theme_location ){
if( in_array( 'menu-item-has-children', $item->classes, true ) ){
$args->after = ''.alok_the_theme_svg('chevron-down',true).'';
}else{
$args->after = '';
}
}
return $args;
}
endif;
add_filter( 'nav_menu_item_args', 'alok_add_sub_toggles_to_main_menu', 10, 3 );
/**
* Alok SVG Icon helper functions
*
* @package Alok
* @since 1.0.0
*/
if ( ! function_exists( 'alok_the_theme_svg' ) ):
/**
* Output and Get Theme SVG.
* Output and get the SVG markup for an icon in the Alok_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 alok_the_theme_svg( $svg_name, $return = false ) {
if( $return ){
return alok_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in alok_get_theme_svg();.
}else{
echo alok_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in alok_get_theme_svg();.
}
}
endif;
if ( ! function_exists( 'alok_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 alok_get_theme_svg( $svg_name ) {
// Make sure that only our allowed tags and attributes are included.
$svg = wp_kses(
Alok_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,
' preserveAspectRatio' => 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( 'alok_vertical_header_section' ) ) :
function alok_vertical_header_section(){
$alok_default = alok_get_default_theme_options();
$header_banner_title = get_theme_mod( 'header_banner_title',$alok_default['header_banner_title'] );
$header_banner_description = get_theme_mod( 'header_banner_description',$alok_default['header_banner_description'] );
$header_banner_signature_image = get_theme_mod( 'header_banner_signature_image');
?>
'0',
'exclude' => '1',
)
);
$post_cat_cat_array = array();
if( $select_cat ){
$post_cat_cat_array[''] = esc_html__( '-- Select Category --','alok' );
}
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('alok_sanitize_meta_pagination') ):
/** Sanitize Enable Disable Checkbox **/
function alok_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('alok_disable_post_views') ):
/** Disable Post Views **/
function alok_disable_post_views() {
add_filter('booster_extension_filter_views_ed', function ( ) {
return false;
});
}
endif;
if( !function_exists('alok_disable_post_read_time') ):
/** Disable Read Time **/
function alok_disable_post_read_time() {
add_filter('booster_extension_filter_readtime_ed', function ( ) {
return false;
});
}
endif;
if( !function_exists('alok_disable_post_like_dislike') ):
/** Disable Like Dislike **/
function alok_disable_post_like_dislike() {
add_filter('booster_extension_filter_like_ed', function ( ) {
return false;
});
}
endif;
if( !function_exists('alok_disable_post_author_box') ):
/** Disable Author Box **/
function alok_disable_post_author_box() {
add_filter('booster_extension_filter_ab_ed', function ( ) {
return false;
});
}
endif;
add_filter('booster_extension_filter_ss_ed', function ( ) {
return false;
});
if( !function_exists('alok_disable_post_reaction') ):
/** Disable Reaction **/
function alok_disable_post_reaction() {
add_filter('booster_extension_filter_reaction_ed', function ( ) {
return false;
});
}
endif;
if( !function_exists('alok_single_post_navigation') ):
function alok_single_post_navigation(){
$alok_default = alok_get_default_theme_options();
$twp_navigation_type = esc_attr( get_post_meta( get_the_ID(), 'twp_disable_ajax_load_next_post', true ) );
$current_id = '';
$article_wrap_class = '';
global $post;
$current_id = $post->ID;
if( $twp_navigation_type == '' || $twp_navigation_type == 'global-layout' ){
$twp_navigation_type = get_theme_mod('twp_navigation_type', $alok_default['twp_navigation_type']);
}
if( $twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){
if( $twp_navigation_type == 'norma-navigation' ){ ?>
'' . alok_the_theme_svg('arrow-left',$return = true ) . '' . __('Previous post:', 'alok') . '
%title
',
'next_text' => '' . alok_the_theme_svg('arrow-right',$return = true ) . '' . __('Next post:', 'alok') . '%title
',
)); ?>
ID ) ){
$next_post_id = $next_post->ID;
echo '';
}
}
}
}
endif;
add_action( 'alok_navigation_action','alok_single_post_navigation',30 );
if ( ! function_exists( 'alok_header_toggle_search' ) ):
/**
* Header Search
**/
function alok_header_toggle_search() {
$alok_default = alok_get_default_theme_options();
$ed_header_search = get_theme_mod( 'ed_header_search', $alok_default['ed_header_search'] );
if( $ed_header_search ){ ?>
↑'); ?>
↑'); ?>
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( class_exists( 'Booster_Extension_Class' ) ){
add_filter('booster_extemsion_content_after_filter','alok_after_content_pagination');
}
if( !function_exists('alok_after_content_pagination') ):
function alok_after_content_pagination($after_content){
$pagination_single = wp_link_pages( array(
'before' => '' . esc_html__( 'Pages:', 'alok' ),
'after' => '
',
'echo' => false
) );
$after_content = $pagination_single.$after_content;
return $after_content;
}
endif;
if( !function_exists('alok_excerpt_content') ):
function alok_excerpt_content(){
$alok_default = alok_get_default_theme_options();
$ed_post_excerpt = get_theme_mod( 'ed_post_excerpt',$alok_default['ed_post_excerpt'] );
if( $ed_post_excerpt ){ ?>
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;