[ 'href' => [] ], 'b' => [] ]; } elseif ( 'allow_link' === $context ) { $tags = [ 'a' => [ 'class' => [], 'href' => [], 'rel' => [], 'title' => [], 'target' => [], ], 'img' => [ 'alt' => [], 'class' => [], 'height' => [], 'src' => [], 'srcset' => [], 'width' => [], ], 'b' => [] ]; } elseif ( 'allow_title' === $context ) { $tags = [ 'a' => [ 'class' => [], 'href' => [], 'rel' => [], 'title' => [], 'target' => [], ], 'br' => [], 'span' => [ 'class' => [], 'style' => [], ], 'img' => [ 'alt' => [], 'class' => [], 'height' => [], 'src' => [], 'srcset' => [], 'width' => [], ], 'b' => [] ]; } else { $tags = [ 'a' => [ 'class' => [], 'href' => [], 'rel' => [], 'title' => [], 'target' => [], ], 'abbr' => [ 'title' => [], ], 'b' => [], 'br' => [], 'sub' => [], 'blockquote' => [ 'cite' => [], ], 'cite' => [ 'title' => [], ], 'code' => [], 'del' => [ 'datetime' => [], 'title' => [], ], 'dd' => [], 'div' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'dl' => [], 'dt' => [], 'em' => [], 'h1' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'h2' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'h3' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'h4' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'h5' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'h6' => [ 'class' => [], 'title' => [], 'style' => [], 'id' => [], ], 'i' => [ 'class' => [], ], 'img' => [ 'alt' => [], 'class' => [], 'height' => [], 'src' => [], 'srcset' => [], 'width' => [], ], 'li' => [ 'class' => [], ], 'ol' => [ 'class' => [], ], 'p' => [ 'class' => [], ], 'q' => [ 'cite' => [], 'title' => [], ], 'span' => [ 'class' => [], 'title' => [], 'style' => [], ], 'strike' => [], 'strong' => [], 'ul' => [ 'class' => [], ], 'iframe' => [ 'class' => [], 'id' => [], 'name' => [], 'src' => [], 'title' => [], 'frameBorder' => [], 'width' => [], 'height' => [], 'scrolling' => [], 'allowvr' => [], 'allow' => [], 'allowFullScreen' => [], 'webkitallowfullscreen' => [], 'mozallowfullscreen' => [], 'loading' => [], ], ]; } echo wp_kses( $html, $tags ); } if ( ! function_exists( 'wtbigshop_custom_menu_cb' ) ) { /** * Callback function for the main menu * * @param $args * * @return string|void */ function wtbigshop_custom_menu_cb( $args ) { extract( $args ); $add_menu_link = admin_url( 'nav-menus.php' ); $menu_text = sprintf( __( "Add %s Menu", "bigshop" ), $theme_location ); __( 'Add a menu', 'bigshop' ); if ( ! current_user_can( 'manage_options' ) ) { $add_menu_link = home_url(); $menu_text = __( 'Home', 'bigshop' ); } // see wp-includes/nav-menu-template.php for available arguments $link = $link_before . '' . $before . $menu_text . $after . '' . $link_after; // We have a list if ( false !== stripos( $items_wrap, '' . $before . $menu_text . $after . '' . $link_after; // We have a list if ( false !== stripos( $items_wrap, ' ', '', false ) ); } } if ( ! function_exists( 'wtbigshop_list_item_separator' ) ) { /** * Retrieves the list item separator based on the locale. * * Added for backward compatibility to support pre-6.0.0 WordPress versions. * * @since 6.0.0 */ function wtbigshop_list_item_separator() { /* translators: Used between list items, there is a space after the comma. */ return sprintf( "%s", 'sp', __( ', ', 'bigshop' ) ); } } if ( ! function_exists( 'wtbigshop_posted_in' ) ) { /** * Prints HTML with category list information about theme categories. * @return string */ function wtbigshop_posted_in( $type = 'category' ) { $categories_list = get_the_category_list( wtbigshop_list_item_separator() ); if ( 'tag' === $type ) { $categories_list = get_the_tag_list( '', wtbigshop_list_item_separator() ); } if ( $categories_list ) { return sprintf( '%s', $type, $categories_list ); } return ''; } } if ( ! function_exists( 'wtbigshop_posted_on' ) ) { /** * Prints HTML with meta information for the current post-date/time. * @return string */ function wtbigshop_posted_on() { $time_string = sprintf( '', esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ) ); return sprintf( '%s', $time_string ); } } if ( ! function_exists( 'wtbigshop_posted_by' ) ) { /** * Prints HTML with meta information about theme author. * @return string */ function wtbigshop_posted_by( $prefix = '' ) { return sprintf( esc_html__( '%s %s', 'bigshop' ), $prefix ? '' . $prefix . '' : '', '' ); } } if ( ! function_exists( 'wtbigshop_get_svg' ) ) { /** * Get svg icon * * @param $name * * @return string|void */ function wtbigshop_get_svg( $name, $rotate = '' ) { $svg_list = apply_filters( 'wtbigshop_svg_icon_list', [ 'search' => '', 'user' => '', 'facebook' => '', 'facebook-square' => '', 'twitter' => '', 'twitter-square' => '', 'skype' => '', 'linkedin' => '', 'linkedin-square' => '', 'instagram' => '', 'instagram-square' => '', 'pinterest' => '', 'pinterest-square' => '', 'tiktok' => '', 'youtube' => '', 'youtube-square' => '', 'snapchat' => '', 'snapchat-square' => '', 'whatsapp' => '', 'whatsapp-square' => '', 'reddit' => '', 'reddit-square' => '', 'rss' => '', 'map-pin' => '', 'globe' => '', 'phone' => '', 'email' => '', 'scroll-top' => '', 'arrow-right' => '', 'home' => '', 'share' => '', 'chevron-right' => '', 'camera' => '', ] ); $rotate_style = ''; if ( $rotate ) { $rotate_style = "style=transform:rotate(" . $rotate . "deg);"; } if ( isset( $svg_list[ $name ] ) ) { return "{$svg_list[ $name ]}"; } return ''; } } if ( ! function_exists( 'wtbigshop_get_file' ) ) { /** * Get File Path * * @param $path * * @return string */ function wtbigshop_get_file( $path, $return_path = false ): string { $file = ( $return_path ? get_stylesheet_directory() : get_stylesheet_directory_uri() ) . $path; if ( ! file_exists( $file ) ) { $file = ( $return_path ? get_template_directory() : get_template_directory_uri() ) . $path; } return $file; } } if ( ! function_exists( 'wtbigshop_get_img' ) ) { /** * Get Image Path * * @param $filename * @param $echo * @param $image_meta * * @return string|void */ function wtbigshop_get_img( $filename, $echo = false, $image_meta = '' ) { $path = '/assets/images/' . $filename; $image_url = wtbigshop_get_file( $path ); if ( $echo ) { if ( ! strpos( $filename, '.svg' ) ) { $getimagesize = wp_getimagesize( wtbigshop_get_file( $path, true ) ); $image_meta = $getimagesize[3] ?? $image_meta; } echo ''; } else { return $image_url; } } } if ( ! function_exists( 'wtbigshop_get_css' ) ) { /** * Get CSS Path * * @param $filename * @param bool $check_rtl * * @return string */ function wtbigshop_get_css( $filename, $check_rtl = false ) { $min = WP_DEBUG ? '.css' : '.min.css'; $is_rtl = $check_rtl && is_rtl() ? 'css-rtl' : 'css'; $path = "/assets/$is_rtl/" . $filename . $min; return wtbigshop_get_file( $path ); } } if ( ! function_exists( 'wtbigshop_get_js' ) ) { /** * Get JS Path * * @param $filename * * @return string */ function wtbigshop_get_js( $filename ) { $path = '/assets/js/' . $filename . '.js'; return wtbigshop_get_file( $path ); } } if ( ! function_exists( 'wtbigshop_option' ) ) { /** * Get Customize Options value by key * * @param $key * * @return mixed */ function wtbigshop_option( $key, $default = '', $return_array = false ) { if ( ! empty( Opt::$options[ $key ] ) ) { $opt_val = Opt::$options[ $key ]; if ( $return_array && $opt_val ) { $opt_val = explode( ',', trim( $opt_val, ', ' ) ); } return $opt_val; } if ( $default ) { return $default; } return false; } } if ( ! function_exists( 'wtbigshop_get_social_html' ) ) { /** * Get Social markup * * @param $color * * @return void */ function wtbigshop_get_social_html( $color = '' ) { ob_start(); $icon_style = wtbigshop_option( 'rt_social_icon_style' ); foreach ( Fns::get_socials() as $id => $item ) { if ( empty( $item['url'] ) ) { continue; } ?>

'', 'date' => '', 'comment' => '', 'category' => '', 'tag' => '', 'reading' => '', 'views' => '', ]; if ( isset( $icon_list[ $name ] ) ) { return $icon_list[ $name ]; } } } if ( ! function_exists( 'wtbigshop_reading_time' ) ) { /** * Post reading time */ function wtbigshop_reading_time() { $post_content = get_post()->post_content; $post_content = strip_shortcodes( $post_content ); $post_content = strip_tags( $post_content ); $word_count = str_word_count( $post_content ); $reading_time = floor( $word_count / 200 ); if ( $reading_time < 1 ) { $result = esc_html__( 'Less than a minute', 'bigshop' ); } elseif ( $reading_time > 60 ) { $result = sprintf( esc_html__( '%s hours read','bigshop' ), floor( $reading_time / 60 ) ); } else if ( $reading_time == 1 ) { $result = esc_html__( '1 min read', 'bigshop' ); } else { $result = sprintf( esc_html__( '%s mins read', 'bigshop' ), $reading_time ); } return '' . $result . ' '; } } if ( ! class_exists( 'RT_POST_VIEWS' ) ) { /** * Post views */ class RT_POST_VIEWS { function __construct() { add_action( 'wp_footer', array( $this, '_set_post_views' ) ); } /** * Count number of views */ function _set_post_views() { # Run only if the post views option is set to THEME's post views module ---------- if ( ! is_single() ) { return; } # Run only on the first page of the post ---------- $page = get_query_var( 'paged', 1 ); if ( $page > 1 ) { return false; } # Increase number of views +1 ---------- $count = 0; $post_id = get_the_ID(); $count_key = 'rt_post_views'; $count = (int) get_post_meta( $post_id, $count_key, true ); $new_count = $count + 1; update_post_meta( $post_id, $count_key, (int) $new_count ); } } new RT_POST_VIEWS(); } /* Display number of views */ if ( ! function_exists( 'rt_post_views' ) ) { function rt_post_views( $text = '', $post_id = 0 ) { if ( empty( $post_id ) ) { $post_id = get_the_ID(); } $views_class = ''; $formated = 0; $count_key = 'rt_post_views'; $view_count = get_post_meta( $post_id, $count_key, true ); if ( ! empty( $view_count ) ) { $formated = number_format_i18n( $view_count ); if ( $view_count > 1000 ) { $views_class = 'very-high'; } elseif ( $view_count > 100 ) { $views_class = 'high'; } elseif ( $view_count > 5 ) { $views_class = 'rising'; } } else if ( $view_count == '' ) { $view_count = 0; } else { $view_count = 0; } if ( $view_count == 1 ) { $wtbigshop_view_html = esc_html__( 'View', 'bigshop' ); } else { $wtbigshop_view_html = esc_html__( 'Views', 'bigshop' ); } $wtbigshop_views_html = '' . $view_count . ' ' . $wtbigshop_view_html; return '' . $wtbigshop_views_html . ' '; } } if ( ! function_exists( 'wtbigshop_post_meta' ) ) { /** * Get post meta * * @return string */ function wtbigshop_post_meta( $args ) { $default_args = [ 'with_list' => true, 'with_icon' => true, 'include' => [], 'class' => '', 'author_prefix' => __( 'By', 'bigshop' ) ]; $args = wp_parse_args( $args, $default_args ); $comments_number = get_comments_number(); $comments_text = sprintf( _n( 'Comment: %s', 'Comments: %s', $comments_number, 'bigshop' ), number_format_i18n( $comments_number ) ); $_meta_data = []; $output = ''; $_meta_data['author'] = wtbigshop_posted_by( $args['author_prefix'] ); $_meta_data['date'] = wtbigshop_posted_on(); $_meta_data['category'] = wtbigshop_posted_in(); $_meta_data['tag'] = wtbigshop_posted_in( 'tag' ); $_meta_data['comment'] = esc_html( $comments_text ); $_meta_data['reading'] = wtbigshop_reading_time(); $_meta_data['views'] = rt_post_views(); $meta_list = $args['include'] ?? array_keys( $_meta_data ); if ( $args['with_list'] ) { $output .= ''; } return $output; } } if ( ! function_exists( 'wtbigshop_post_thumbnail' ) ) { /** * Displays post thumbnail. * @return void */ function wtbigshop_post_thumbnail( $size = 'full', $thumb_date = false ) { if ( ! Fns::can_show_post_thumbnail() ) { return; } ?>
true ] ); ?>
%s", esc_html( $tags_label ) ); } ?>
true, 'with_icon' => true, 'include' => $includes, ] ); ?>
true, 'include' => Fns::single_meta_lists(), 'author_prefix' => wtbigshop_option( 'rt_author_prefix' ), ] ); } the_title( '

', '

' ); ?>
< id="comment-"> comment_type ) : case 'pingback' : case 'trackback' : ?>
%s', 'bigshop' ), get_comment_author_link() ); ?>
comment_approved == '0' ) { ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => $icon . __( 'Reply', 'bigshop' ) ] ) ); ?>