Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
exists( $fontAwesome_file ) ) { $content = $wp_filesystem->get_contents( $fontAwesome_file ); } // End If Statement if ( $wp_filesystem->exists( $template_icon_file ) ) { $content .= $wp_filesystem->get_contents( $template_icon_file ); } // End If Statement $pattern = '/\.(fa-(?:\w+(?:-)?)+):before\s*{\s*content/'; $pattern_two = '/\.(icon-(?:\w+(?:-)?)+):before\s*{\s*content/'; $subject = $content; preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER ); preg_match_all( $pattern_two, $subject, $matches_two, PREG_SET_ORDER ); $all_matches = array_merge( $matches, $matches_two ); $icons = array(); foreach ( $all_matches as $match ) { // $icons[] = array('value' => $match[1], 'label' => $match[1]); $icons[] = $match[1]; } $data = apply_filters( 'wallox_elementor_icons_json', $icons ); set_transient( 'wallox_fa_icons', $data, 10080 ); // saved for one week } return array_combine( $data, $data ); // combined for key = value } endif; if ( ! function_exists( 'wallox_get_page_by_title' ) ) { function wallox_get_page_by_title( $title, $post_type = 'page' ) { $posts = get_posts( array( 'post_type' => $post_type, 'title' => $title, 'post_status' => 'all', 'numberposts' => 1, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, 'orderby' => 'post_date ID', 'order' => 'ASC', ) ); if ( ! empty( $posts ) ) { return $posts[0]; } else { return null; } } } // custom kses allowed html if ( ! function_exists( 'wallox_kses_allowed_html' ) ) : function wallox_kses_allowed_html( $tags, $context ) { switch ( $context ) { case 'wallox_allowed_tags': $tags = array( 'a' => array( 'href' => array(), 'class' => array() ), 'b' => array(), 'br' => array(), 'span' => array( 'class' => array(), 'data-count' => array() ), 'img' => array( 'class' => array(), 'decoding' => array(), 'src' => array(), 'alt' => array(), 'title' => array() ), 'i' => array( 'class' => array() ), 'p' => array( 'class' => array() ), 'ul' => array( 'class' => array() ), 'li' => array( 'class' => array() ), 'div' => array( 'class' => array() ), 'strong' => array(), 'sup' => array(), ); return $tags; default: return $tags; } } add_filter( 'wp_kses_allowed_html', 'wallox_kses_allowed_html', 10, 2 ); endif; if ( ! function_exists( 'wallox_excerpt' ) ) : // Post's excerpt text function wallox_excerpt( $get_limit_value, $echo = true ) { $opt = $get_limit_value; $excerpt_limit = ! empty( $opt ) ? $opt : 40; $excerpt = wp_trim_words( get_the_content(), $excerpt_limit, '' ); if ( $echo == true ) { echo esc_html( $excerpt ); } else { return esc_html( $excerpt ); } } endif; if ( ! function_exists( 'wallox_post_query' ) ) { function wallox_post_query( $post_type ) { $post_list = get_posts( array( 'post_type' => $post_type, 'showposts' => -1, ) ); $posts = array(); if ( ! empty( $post_list ) && ! is_wp_error( $post_list ) ) { foreach ( $post_list as $post ) { $options[ $post->ID ] = $post->post_title; } return $options; } } } if ( ! function_exists( 'wallox_custom_query_pagination' ) ) : /** * Prints HTML with post pagination links. */ function wallox_custom_query_pagination( $paged = '', $max_page = '' ) { global $wp_query; $big = 999999999; // need an unlikely integer if ( ! $paged ) $paged = get_query_var( 'paged' ); if ( ! $max_page ) $max_page = $wp_query->max_num_pages; $links = paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, $paged ), 'total' => $max_page, 'mid_size' => 1, 'prev_text' => '', 'next_text' => '', ) ); echo wp_kses( $links, 'wallox_allowed_tags' ); } endif; if ( ! function_exists( 'wallox_get_nav_menu' ) ) : function wallox_get_nav_menu() { $menu_list = get_terms( array( 'taxonomy' => 'nav_menu', 'hide_empty' => true, ) ); $options = []; if ( ! empty( $menu_list ) && ! is_wp_error( $menu_list ) ) { foreach ( $menu_list as $menu ) { $options[ $menu->slug ] = $menu->name; } return $options; } } endif; if ( ! function_exists( 'wallox_get_taxonoy' ) ) : function wallox_get_taxonoy( $taxonoy ) { $taxonomy_list = get_terms( array( 'taxonomy' => $taxonoy, 'hide_empty' => true, ) ); $options = []; if ( ! empty( $taxonomy_list ) && ! is_wp_error( $taxonomy_list ) ) { foreach ( $taxonomy_list as $taxonomy ) { $options[ $taxonomy->slug ] = $taxonomy->name; } return $options; } } endif; if ( ! function_exists( 'wallox_get_template' ) ) : function wallox_get_template( $template_name = null ) { $template_path = apply_filters( 'wallox-elementor/template-path', 'elementor-templates/' ); $template = locate_template( $template_path . $template_name ); if ( ! $template ) { $template = WALLOX_ADDON_PATH . '/elementor-templates/' . $template_name; } if ( file_exists( $template ) ) { return $template; } else { return false; } } endif; if ( ! function_exists( 'wallox_get_sidebar_template' ) ) : function wallox_get_sidebar_template( $template_name = null ) { $template_path = apply_filters( 'wallox-sidebar/template-path', 'sidebar-widget-template/' ); $template = locate_template( $template_path . $template_name ); if ( ! $template ) { $template = WALLOX_ADDON_PATH . '/sidebar-widget-template/' . $template_name; } if ( file_exists( $template ) ) { return $template; } else { return false; } } endif; if ( ! function_exists( 'wallox_get_elementor_option' ) ) : function wallox_get_elementor_option( $template_name = null ) { $template_path = apply_filters( 'wallox-elementor/template-options', 'elementor-options/' ); $template = locate_template( $template_path . $template_name ); if ( ! $template ) { $template = WALLOX_ADDON_PATH . '/elementor-options/' . $template_name; } if ( file_exists( $template ) ) { return $template; } } endif; if ( ! function_exists( 'wallox_get_common_function' ) ) : function wallox_get_common_function( $template_name = null ) { $template_path = apply_filters( 'wallox-common/template-options', 'common/' ); $template = locate_template( $template_path . $template_name ); if ( ! $template ) { $template = WALLOX_ADDON_PATH . '/common/' . $template_name; } if ( file_exists( $template ) ) { return $template; } } endif; if ( ! function_exists( 'wallox_get_thumbnail_alt' ) ) : function wallox_get_thumbnail_alt( $thumbnail_id ) { return get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ); } endif; if ( ! function_exists( 'wallox_get_owl_options' ) ) : function wallox_get_owl_options( $settings ) { $loop_status = ( 'yes' == $settings['loop'] ) ? true : false; $nav_status = ( 'yes' == $settings['enable_nav'] ) ? true : false; $dots_status = ( 'yes' == $settings['enable_dots'] ) ? true : false; $autoplay_status = ( 'yes' == $settings['autoplay'] ) ? true : false; $hover_pause_status = ( 'yes' == $settings['hover_pause'] ) ? true : false; $center_status = ( 'yes' == $settings['center_status'] ) ? true : false; $url_hash_listner = ( 'yes' == $settings['url_hash_listner'] ) ? true : false; $delay = $settings['delay']['size']; $custom_animation_status = ( 'yes' == $settings['custom_animation_status'] ) ? true : false; $custom_animation_out = $settings['custom_animation_out']; $custom_animation_in = $settings['custom_animation_in']; if ( 'yes' == $settings['enable_nav'] ) { $nav_left_icon = $settings['nav_left_icon']['value']; $nav_right_icon = $settings['nav_right_icon']['value']; } $items = $settings['items']['size']; $margin = $settings['margin']['size']; $smart_speed = $settings['smart_speed']['size']; $breakpoint = $settings['breakpoint']; $owl_options = [ "loop" => $loop_status, "margin" => $margin, "items" => $items, "nav" => $nav_status, "dots" => $dots_status, "smartSpeed" => $smart_speed, ]; if ( true === $autoplay_status ) : $owl_options["autoplay"] = $autoplay_status; $owl_options["autoplayTimeout"] = $delay; endif; if ( true === $custom_animation_status ) : $owl_options["animateOut"] = $custom_animation_out; $owl_options["animateIn"] = $custom_animation_in; endif; if ( true === $hover_pause_status ) : $owl_options["autoplayHoverPause"] = $hover_pause_status; endif; if ( true === $center_status ) : $owl_options["center"] = $center_status; endif; if ( true === $url_hash_listner ) : $owl_options["URLhashListener"] = $url_hash_listner; endif; if ( 'yes' == $settings['enable_nav'] ) : $owl_options["navText"] = [ "", "" ]; endif; if ( ! empty( $breakpoint ) ) : $reponsive_options = []; foreach ( $breakpoint as $item ) : $reponsive_options[ $item['screen_size']['size'] ]["margin"] = $item['margin']['size']; $reponsive_options[ $item['screen_size']['size'] ]["items"] = $item['item']['size']; endforeach; $owl_options["responsive"] = $reponsive_options; endif; return json_encode( $owl_options ); } endif; if ( ! function_exists( 'wallox_get_circle_options' ) ) : function wallox_get_circle_options( $arg, $condition = false ) { if ( ! empty( $condition ) ) : //Circle Options $arg->start_controls_section( 'circle_options', [ 'label' => __( 'Circle Options', 'wallox-addon' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => $condition ] ] ); else : $arg->start_controls_section( 'circle_options', [ 'label' => __( 'Circle Options', 'wallox-addon' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); endif; $arg->add_control( 'enable_gradient_color', [ 'label' => __( 'Enable Gradient Color?', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'wallox-addon' ), 'label_off' => __( 'No', 'wallox-addon' ), 'return_value' => 'yes', 'default' => 'no', ] ); $gradient_items_color = new \Elementor\Repeater(); $gradient_items_color->add_control( 'gradient_color', [ 'label' => esc_html__( 'Gradient Color', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::COLOR, ] ); $arg->add_control( 'gradient_items_color', [ 'label' => __( 'Gradient Lists', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $gradient_items_color->get_controls(), 'condition' => [ 'enable_gradient_color' => [ 'yes' ] ] ] ); $arg->add_control( 'fill_color', [ 'label' => esc_html__( 'Fill Color', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default=' => '36731f', 'condition' => [ 'enable_gradient_color!' => [ 'yes' ] ] ] ); $arg->add_control( 'empty_fill_color', [ 'label' => esc_html__( 'Empty Fill Color', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default=' => '36731f' ] ); $arg->add_control( 'thickness', [ 'label' => __( 'Thickness', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'count' ], 'range' => [ 'count' => [ 'min' => 1, 'max' => 14, 'step' => 1, ], ], 'default' => [ 'unit' => 'count', 'size' => 3, ], ] ); $arg->add_control( 'size', [ 'label' => __( 'Size', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'count' ], 'range' => [ 'count' => [ 'min' => 50, 'max' => 200, 'step' => 10, ], ], 'default' => [ 'unit' => 'count', 'size' => 110, ], ] ); $arg->add_control( 'angel', [ 'label' => __( 'Angel', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'count' ], 'range' => [ 'count' => [ 'min' => 0, 'max' => 180, 'step' => 1, ], ], 'default' => [ 'unit' => 'count', 'size' => 0, ], ] ); $arg->add_control( 'linecap', [ 'label' => __( 'Line Cap', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SELECT2, 'default' => 'square', 'options' => [ 'butt' => __( 'Butt', 'wallox-addon' ), 'round' => __( 'Round', 'wallox-addon' ), 'square' => __( 'Square', 'wallox-addon' ), ] ] ); $arg->end_controls_section(); } endif; if ( ! function_exists( 'wallox_apply_circle_options' ) ) : function wallox_apply_circle_options( $settings, $item ) { $value = $item['count_number']['size'] / 10; $decimal = $value / 10; $formatted_value = number_format( $decimal, 1, '.', '' ); ob_start(); ?> data-options='{ "value": , "thickness": , "startAngle": , "emptyFill": " ", "lineCap": " ", "size": , "fill": { $item ) : echo esc_attr( '"' . $item['gradient_color'] . '"' ); if ( $key != $endKey ) { echo ','; } endforeach; echo ']'; else : // Output single fill color echo '"color": "' . esc_attr( $settings['fill_color'] ) . '"'; endif; ?> }}' add_control( str_replace( ' ', '_', strtolower( $label ) ) . '_tag_' . $layout, [ 'label' => esc_html__( $label . ' Tag', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SELECT, 'label_block' => true, 'options' => array( 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'span' => 'span', 'p' => 'p', ), 'default' => $default, ] ); } endif; if ( ! function_exists( 'wallox_elementor_rendered_content' ) ) : function wallox_elementor_rendered_content( $init, $rendered_name, $class = '', $tag = 'p', $url_name = 'url', $extra = '' ) { $settings = $init->get_settings_for_display(); if ( 'a' == $tag ) : $init->add_render_attribute( $rendered_name, [ 'class' => 'wallox-inline-editing' ] ); else : $init->add_render_attribute( $rendered_name, [ 'class' => $class, ] ); endif; if ( 'a' == $tag ) : printf( '<%1$s %7$s %3$s %4$s>%5$s %6$s', tag_escape( $tag ), $init->get_render_attribute_string( $rendered_name ), 'href="' . esc_url( $settings[ $url_name ]['url'] ) . '"', esc_attr( ! empty( $settings[ $url_name ]['is_external'] ) ? "target=_blank" : ' ' ), wp_kses( $settings[ $rendered_name ], 'wallox_allowed_tags' ), $extra, 'class="' . esc_attr( $class ) . '"' ); else : printf( '<%1$s %2$s>%3$s', tag_escape( $tag ), $init->get_render_attribute_string( $rendered_name ), wp_kses( $settings[ $rendered_name ], 'wallox_allowed_tags' ) ); endif; } endif; if ( ! function_exists( 'wallox_elementor_repeater_rendered_content' ) ) : function wallox_elementor_repeater_rendered_content( $init, $content, $key, $rendered_name, $class = 'wallox-default', $tag = 'p', $url_name = 'url', $extra = '' ) { if ( 'a' == $tag ) : $init->add_render_attribute( $key, [ 'class' => 'wallox-inline-editing' ] ); else : $init->add_render_attribute( $key, [ 'class' => $class, ] ); endif; if ( 'a' == $tag ) : printf( '<%1$s %7$s %3$s %4$s>%5$s %6$s', tag_escape( $tag ), $init->get_render_attribute_string( $key ), 'href="' . esc_url( $content[ $url_name ]['url'] ) . '"', esc_attr( ! empty( $content[ $url_name ]['is_external'] ) ? "target=_blank" : ' ' ), wp_kses( $content[ $rendered_name ], 'wallox_allowed_tags' ), $extra, 'class="' . esc_attr( $class ) . '"' ); else : printf( '<%1$s %2$s>%3$s', tag_escape( $tag ), $init->get_render_attribute_string( $key ), wp_kses( $content[ $rendered_name ], 'wallox_allowed_tags' ) ); endif; } endif; if ( ! function_exists( 'wallox_basic_rendered_content' ) ) : function wallox_basic_rendered_content( $init, $content, $rendered_name, $class = 'wallox-default', $tag = 'p', $url_name = 'url', $extra = '' ) { $init->add_render_attribute( $rendered_name, [ 'class' => $class, ] ); if ( 'a' == $tag ) : printf( '<%1$s %2$s %3$s %4$s>%5$s%6$s', tag_escape( $tag ), $init->get_render_attribute_string( $rendered_name ), 'href="' . esc_url( $content[ $url_name ]['url'] ) . '"', esc_attr( ! empty( $content[ $url_name ]['is_external'] ) ? "target=_blank" : ' ' ), wp_kses( $content[ $rendered_name ], 'wallox_allowed_tags' ), $extra, ); else : printf( '<%1$s %2$s>%3$s', tag_escape( $tag ), $init->get_render_attribute_string( $rendered_name ), wp_kses( $content[ $rendered_name ], 'wallox_allowed_tags' ) ); endif; } endif; if ( ! function_exists( 'wallox_elementor_rendered_image' ) ) { function wallox_elementor_rendered_image( $content, $name, $class = '', $duration = '', $delay = '' ) { if ( empty( $content[ $name ] ) ) { return; } $image = ( $content[ $name ]["id"] != "" ) ? wp_get_attachment_image_url( $content[ $name ]["id"], "full" ) : $content[ $name ]["url"]; if ( empty( $image ) ) { return; } $image_attr = ''; $title = \Elementor\Control_Media::get_image_title( $content[ $name ] ); if ( ! empty( $title ) ) { $image_attr .= 'title="' . esc_attr( $title ) . '" '; } if ( ! empty( $class ) ) { $image_attr .= 'class="' . esc_attr( $class ) . '" '; } if ( ! empty( $duration ) ) { $image_attr .= 'data-wow-duration="' . esc_attr( $duration ) . '" '; } if ( ! empty( $delay ) ) { $image_attr .= 'data-wow-delay="' . esc_attr( $delay ) . '" '; } printf( '%s', esc_url( $image ), esc_attr( \Elementor\Control_Media::get_image_alt( $content[ $name ] ) ), $image_attr ); } } if ( ! function_exists( 'wallox_elementor_column_count_options' ) ) : function wallox_elementor_column_count_options( $init, $condition ) { $init->start_controls_section( 'column_options', [ 'label' => __( 'Column Options', 'wallox-addon' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, 'condition' => [ 'layout_type' => $condition ] ] ); $init->add_responsive_control( 'column_count', [ 'label' => __( 'Column Width %', 'wallox-addon' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ '%' => [ 'min' => 1, 'max' => 100, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'desktop_default' => [ 'unit' => '%', 'size' => '', ], 'tablet_default' => [ 'unit' => '%', 'size' => '', ], 'mobile_default' => [ 'unit' => '%', 'size' => '', ], 'selectors' => [ '{{WRAPPER}} .row [class*=col-]' => 'width: {{SIZE}}% !important;', ], ] ); $init->end_controls_section(); } endif; if ( ! is_rtl() ) : function wallox_set_rtl_mode( $locale ) { $wallox_get_rtl_mode_status = get_theme_mod( 'wallox_rtl_mode', false ); // check page rtl $current_page = get_page_by_path( $_SERVER['REQUEST_URI'] ); if ( isset( $current_page->ID ) ) { $check_page_rtl = get_post_meta( $current_page->ID, 'wallox_enable_rtl_mode', true ); $wallox_get_rtl_mode_status = empty( $check_page_rtl ) ? $wallox_get_rtl_mode_status : $check_page_rtl; } if ( isset( $_SERVER['SERVER_NAME'] ) && isset( $_SERVER['REQUEST_URI'] ) ) { //check home page $check_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $check_url_without_http = trim( str_replace( array( 'http://', 'https://' ), '', $check_url ), '/' ); $site = site_url(); $site_without_http = trim( str_replace( array( 'http://', 'https://' ), '', $site ), '/' ); if ( $check_url_without_http == $site_without_http ) { $frontpage_id = get_option( 'page_on_front' ); $check_home_page_rtl = get_post_meta( $frontpage_id, 'wallox_enable_rtl_mode', true ); $wallox_get_rtl_mode_status = empty( $check_home_page_rtl ) ? $wallox_get_rtl_mode_status : $check_home_page_rtl; } $wallox_dynamic_rtl_mode_status = isset( $_GET['rtl_mode'] ) ? $_GET['rtl_mode'] : $wallox_get_rtl_mode_status; if ( 'yes' == $wallox_dynamic_rtl_mode_status ) { $locale = ( $wallox_dynamic_rtl_mode_status == 'yes' ) ? 'ar' : 'en_US'; } } return $locale; } add_filter( 'locale', 'wallox_set_rtl_mode', 1, 1 ); endif; /** * Automatically add product to cart on visit */ if ( ! function_exists( 'wallox_auto_add_product_to_cart' ) ) : function wallox_auto_add_product_to_cart() { $auto_cart_status = isset( $_GET['auto_cart'] ) ? $_GET['auto_cart'] : ''; if ( ! is_admin() && ! empty( $auto_cart_status ) ) { $get_product = wallox_get_page_by_title( $auto_cart_status, $post_type = "product" ); // 64; //replace with your own product id $product_id = $get_product->ID; $found = false; //check if product already in cart if ( sizeof( WC()->cart->get_cart() ) > 0 ) { foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { $_product = $values['data']; if ( $_product->get_id() == $product_id ) $found = true; } // if product not found, add it if ( ! $found ) WC()->cart->add_to_cart( $product_id ); } else { // if no products in cart, add it WC()->cart->add_to_cart( $product_id ); } } } add_action( 'template_redirect', 'wallox_auto_add_product_to_cart' ); endif; if ( ! function_exists( 'wallox_fixed_footer_class_to_html_tag' ) ) : function wallox_fixed_footer_class_to_html_tag( $output, $doctype ) { if ( 'html' !== $doctype ) { return $output; } return $output; } endif; if ( ! function_exists( 'wallox_product_details_social_share' ) ) : //social share function wallox_product_details_social_share() { global $post; //get current page url $wallox_url = urlencode_deep( get_permalink() ); //get current page title $wallox_title = str_replace( ' ', '%20', get_the_title( $post->ID ) ); //get post thumbnail for pinterest $wallox_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); //all social share link generate $facebook_share_link = 'https://www.facebook.com/sharer/sharer.php?u=' . $wallox_url; $twitter_share_link = 'https://twitter.com/intent/tweet?text=' . $wallox_title . '&url=' . $wallox_url . '&via=Crunchify'; ; $linkedin_share_link = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $wallox_url . '&title=' . $wallox_title; ; $pinterest_share_link = 'https://pinterest.com/pin/create/button/?url=' . $wallox_url . '&media=' . $wallox_thumbnail[0] . '&description=' . $wallox_title; ?>

' . get_the_time( 'd' ) . '
' . get_the_time( 'M' ) . ' ' . get_the_time( 'Y' ) . '
'; } endif; add_filter( 'wallox_blog_date', 'wallox_blog_date_callback', 10, 1 ); if ( function_exists( 'wallox_elementor_rendered_image' ) ) : add_filter( 'loop_shop_columns', 'wallox_loop_columns' ); if ( ! function_exists( 'wallox_loop_columns' ) ) { function wallox_loop_columns() { $wallox_shop_layout = isset( $_GET['column'] ) ? $_GET['column'] : ( get_theme_mod( 'wallox_shop_column' ) ? get_theme_mod( 'wallox_shop_column' ) : 3 ); return $wallox_shop_layout; } } add_filter( 'loop_shop_per_page', 'wallox_loop_shop_per_page', 30 ); function wallox_loop_shop_per_page( $products ) { $wallox_shop_product_per_page = isset( $_GET['product_per_page'] ) ? $_GET['product_per_page'] : get_theme_mod( 'product_per_page' ); return $wallox_shop_product_per_page; } endif; // recent post widget // Hook the registration function to the widgets_init action add_action( 'widgets_init', 'wallox_register_custom_recent_posts_widget' ); function wallox_register_custom_recent_posts_widget() { // Register the widget register_widget( new Layerdrops\Wallox\SidebarWidget\RecentPost() ); register_widget( new Layerdrops\Wallox\SidebarWidget\BlogCategories() ); register_widget( new Layerdrops\Wallox\SidebarWidget\BlogTags() ); register_widget( new Layerdrops\Wallox\SidebarWidget\BlogComments() ); } /** * Sourcing color metabox and customizer via json file */ function wallox_source_color_meta( $type = null, $set_option = null, $init = null ) { $data = get_transient( 'wallox_css_variable' ); if ( empty( $data ) ) { global $wp_filesystem; require_once ( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem(); $json_file = WALLOX_ADDON_PATH . '/assets/vendors/wallox-css-var/wallox-css-var.json'; $content = ''; if ( $wp_filesystem->exists( $json_file ) ) { $content = $wp_filesystem->get_contents( $json_file ); } // End If Statement $data = apply_filters( 'wallox_css_variable', $content ); set_transient( 'wallox_css_variable', $data, 10080 ); // saved for one week } $values = json_decode( $data ); if ( 'get' === $type ) { $cssvariable = ''; foreach ( $values as $name ) { $cssvariable .= wallox_get_color_meta( $name, 'wallox' ); } return $cssvariable; } if ( 'set' === $type ) { wallox_set_color_meta( $set_option, $values ); } if ( 'set_customizer' === $type ) { wallox_set_color_customizer( $init, $set_option, $values ); } } /** * Making color metaboxes from arrays */ function wallox_set_color_meta( $option_name = null, $value = null ) { foreach ( $value as $name ) { $option_name->add_field( array( 'name' => ucwords( str_replace( "-", " ", $name ) ), 'id' => 'wallox_' . str_replace( "-", "_", $name ), 'type' => 'colorpicker', ) ); } } /** * Making color customizer options from arrays */ function wallox_set_color_customizer( $init = null, $option_name = null, $value = null ) { foreach ( $value as $name ) { $init->customize_type_color( $option_name, 'wallox_theme_color', $name ); } } /** * Printing color variables conditional */ function wallox_get_color_meta( $name = null, $prefix = null ) { $setting_name = str_replace( "-", "_", $name ); $customizer_option = get_theme_mod( $setting_name ); $page_meta_option = get_post_meta( get_the_ID(), $prefix . '_' . $setting_name, true ); $value = ! empty( $page_meta_option ) ? $page_meta_option : $customizer_option; return ! empty( $value ) ? "--" . $name . ":" . $value . ";" . "--" . $name . "-rgb:" . wallox_hex_to_rgb( $value ) . ";" : ""; } /** * Generates json for elementor icons */ function wallox_get_elementor_icons( $infos ) { global $wp_filesystem; require_once ( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem(); $options = []; $data = get_transient( 'wallox_get_elementor_icons' ); // create icons json for json files if ( empty( $data ) ) { foreach ( $infos as $info ) { $css_file = WALLOX_ADDON_PATH . '/assets/vendors/' . $info['name'] . '/style.css'; $json_file = WALLOX_ADDON_PATH . '/assets/vendors/' . $info['name'] . '/icons.json'; $class_pattern = $info['class']; $version = filemtime( $json_file ); $content = ''; if ( $wp_filesystem->exists( $css_file ) ) { $content .= $wp_filesystem->get_contents( $css_file ); } $pattern = '/\.(' . $class_pattern . '-(?:\w+(?:-)?)+):before\s*{\s*content/'; preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); $icons = []; foreach ( $matches as $match ) { $icons[] = $match[1]; } $icons_formatted = [ "icons" => $icons, ]; $data = apply_filters( 'wallox_get_elementor_icons', $icons_formatted ); if ( $wp_filesystem->exists( $json_file ) ) { $wp_filesystem->put_contents( $json_file, json_encode( $data ), FS_CHMOD_FILE ); } set_transient( 'wallox_get_elementor_icons', $data, 10080 ); // saved for one week } } $i = 1; // create icons array for elementor foreach ( $infos as $info ) { $json_file = WALLOX_ADDON_PATH . '/assets/vendors/' . $info['name'] . '/icons.json'; $version = filemtime( $json_file ); $options[ $info['name'] . '-' . $version ] = [ 'name' => $info['name'] . '-' . $version, 'label' => 'Wallox Icons ' . $i, 'url' => '', 'enqueue' => array( WALLOX_ADDON_URL . '/assets/vendors/' . $info['name'] . '/style.css', ), 'prefix' => '', 'displayPrefix' => '', 'labelIcon' => 'icon-dairy-products', 'ver' => $version, 'fetchJson' => WALLOX_ADDON_URL . '/assets/vendors/' . $info['name'] . '/icons.json', 'native' => 1, ]; $i++; } return $options; }