exists() ? $user->display_name : ''; $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $comments_fields = array( 'author' => '
' . ( $req ? '*' : '' ) . '
', 'email' => '
' . ( $req ? '*' : '' ) . '
', 'url' => '
' . '
', ); $required_text = sprintf( ' ' . __( 'Required fields are marked %s', 'mino' ), '*' ); $comments_args = array( 'id_form' => 'commentform', 'class_form' => 'row', 'id_submit' => 'submit', 'class_submit' => 'submit btn btn-md', 'name_submit' => 'submit', 'title_reply' => __( 'Leave a Comment', 'mino' ), 'title_reply_to' => __( 'Leave a Reply to %s', 'mino' ), 'title_reply_before' => '

', 'title_reply_after' => '

', 'cancel_reply_before' => ' ', 'cancel_reply_after' => '', 'cancel_reply_link' => __( 'Cancel', 'mino' ), 'label_submit' => __( 'Submit', 'mino' ), 'submit_button' => '', 'submit_field' => '
%1$s %2$s
', 'format' => 'html', 'comment_field' => '
', 'must_log_in' => '
' . sprintf( __( 'You must be logged in to post a comment.', 'mino' ), wp_login_url( apply_filters( 'the_permalink', esc_url( get_permalink( $post_id ) ) ) ) ) . '
', 'logged_in_as' => '
' . sprintf( __( 'Logged in as %2$s. Log out?', 'mino' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', esc_url( get_permalink( $post_id ) ) ) ) ) . '
', 'comment_notes_before' => '
' . __( 'Your email address will not be published.', 'mino' ) . ''. ( $req ? $required_text : '' ) . '
', 'comment_notes_after' => '', 'fields' => apply_filters( 'comment_form_default_fields', $comments_fields ), ); return $comments_args; } } add_filter( 'comment_form_defaults', 'mino_comment_form' ); /** * Add filter for background pattern template * @return array Background pattern list */ if ( ! function_exists( 'mino_set_bg_pattern_template' ) ) { function mino_set_bg_pattern_template( $args ) { $pattern = array( 'pattern_1' => MINO_THEME_URI_ASSETS . 'img/pattern-01.png', 'pattern_2' => MINO_THEME_URI_ASSETS . 'img/pattern-02.png', 'pattern_3' => MINO_THEME_URI_ASSETS . 'img/pattern-03.png', 'pattern_4' => MINO_THEME_URI_ASSETS . 'img/pattern-04.png', 'pattern_5' => MINO_THEME_URI_ASSETS . 'img/pattern-05.png', 'pattern_6' => MINO_THEME_URI_ASSETS . 'img/pattern-06.png', ); return apply_filters( 'mino_bg_pattern_template_choices', $pattern ); } } add_filter( 'mino_bg_pattern_template', 'mino_set_bg_pattern_template' ); /** * Add filter for layout template * @return array Layout templates list */ if ( ! function_exists( 'mino_template_layout_set' ) ) { function mino_template_layout_set( $args ) { $pattern = array( 'full' => MINO_THEME_URI_ASSETS . 'img/layout-full.gif', 'left' => MINO_THEME_URI_ASSETS . 'img/layout-left.gif', 'right' => MINO_THEME_URI_ASSETS . 'img/layout-right.gif' ); return apply_filters( 'mino_layout_template_choices', $pattern ); } } add_filter( 'mino_template_layout', 'mino_template_layout_set' ); /** * Add filter for color template * @return array Theme color list */ if ( ! function_exists( 'mino_set_bg_color_template' ) ) { function mino_set_bg_color_template( $args ) { $pattern = array( 'color_1' => array( 'color' => '#181616', 'label' => 'black' ), 'color_2' => array( 'color' => '#FF7C44', 'label' => 'orange' ), 'color_3' => array( 'color' => '#E74C3C', 'label' => 'red' ), 'color_4' => array( 'color' => '#81B441', 'label' => 'green' ), 'color_5' => array( 'color' => '#23a0bf', 'label' => 'blue' ) ); return apply_filters( 'mino_color_template_choices', $pattern ); } } add_filter( 'mino_bg_color_template', 'mino_set_bg_color_template' ); /** * Mino read more excerpt * @param string $more Default value * @return html Read more structure */ if ( ! function_exists( 'mino_excerpt_more' ) ) { function mino_excerpt_more( $more ) { return '
' . __( 'Read More', 'mino' ) . '
'; } } add_filter( 'excerpt_more', 'mino_excerpt_more' ); /** * Set custom HTML for custom logo * @return string New HMTL output for custom logo */ function mino_logo_custom_html( $output ) { /* Add href class */ if ( strpos( $output, 'class="custom-logo-link"' ) ) { $output = str_replace( 'class="custom-logo-link"', 'class="custom-logo-link brand"', $output ); } return $output; } add_filter( 'get_custom_logo', 'mino_logo_custom_html' ); /** * Woocommerce filter part */ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { /** * Header menu add ajax for item button * @param array $fragments Woocommerce cart box * @return array $fragments Woocommerce cart box */ if ( ! function_exists( 'mino_header_add_to_cart_fragment' ) ) { function mino_header_add_to_cart_fragment( $fragments ) { ob_start(); ?>
' . ( ( is_numeric( $from ) ) ? wc_price( $from ) : $from ) . '
' . ( ( is_numeric( $to ) ) ? wc_price( $to ) : $to ) . '
'; return apply_filters( 'mino_set_price_output', $price ); } } add_filter( 'woocommerce_get_price_html_from_to', 'mino_woocommerce_get_price_html_from_to', 10, 4 ); if ( ! function_exists( 'mino_update_extra_profile_fields' ) ) { function mino_update_extra_profile_fields( $user_id ) { if ( current_user_can( 'edit_user', $user_id ) ) { if ( isset( $_POST['account_phone'] ) ) { update_user_meta( $user_id, 'mino_user_phone_number', sanitize_text_field( $_POST['account_phone'] ) ); } } } } add_action( 'edit_user_profile_update', 'mino_update_extra_profile_fields' ); if ( ! function_exists( 'mino_woocommerce_product_description_heading_hide' ) ) { function mino_woocommerce_product_description_heading_hide() { return ''; } } add_filter( 'woocommerce_product_description_heading', 'mino_woocommerce_product_description_heading_hide' ); if ( ! function_exists( 'mino_woocommerce_product_additional_information_heading_hide' ) ) { function mino_woocommerce_product_additional_information_heading_hide() { return ''; } } add_filter( 'woocommerce_product_additional_information_heading', 'mino_woocommerce_product_additional_information_heading_hide' ); if ( ! function_exists( 'mino_remove_postcount_bracket' ) ) { function mino_remove_postcount_bracket ( $variable ) { $variable = str_replace( '', '', $variable ); $variable = str_replace( '(', '', $variable ); $variable = str_replace( ')', '', $variable ); $variable = str_replace( '', '', $variable ); return apply_filters( 'mino_set_bracket', $variable ); } } add_filter( 'woocommerce_add_to_cart_message', 'mino_custom_add_to_cart_message' ); if ( ! function_exists( 'mino_custom_add_to_cart_message' ) ) { function mino_custom_add_to_cart_message() { global $woocommerce; // Output success messages if ( get_option( 'woocommerce_cart_redirect_after_add' ) == 'yes' ) : $return_to = esc_url( get_permalink(woocommerce_get_page_id('shop')) ); $message = sprintf('%s %s', $return_to, __('Continue Shopping →', 'mino' ), __('Product successfully added to your cart.', 'mino' ) ); else : $message = sprintf('%s %s', esc_url( get_permalink(woocommerce_get_page_id('cart'))), __('View Cart →', 'mino' ), __('Product successfully added to your cart.', 'mino' ) ); endif; return $message; } } if ( ! function_exists( 'mino_woocommerce_product_filter_form' ) ) { function mino_woocommerce_product_filter_form( $form ) { $form = ''; return $form; } } add_filter( 'get_product_search_form', 'mino_woocommerce_product_filter_form' ); if ( ! function_exists( 'mino_woocommerce_rename_tabs' ) ) { function mino_woocommerce_rename_tabs( $tabs ) { global $product, $post; $tabs['reviews']['title'] = ' '; if ( $post->post_content ) { $tabs['description']['title'] = ' '; } if ( ! empty( $product->product_attributes ) && ! empty( $tabs['additional_information'] ) ) { $tabs['additional_information']['title'] = ' '; } return $tabs; } } add_filter( 'woocommerce_product_tabs', 'mino_woocommerce_rename_tabs', 98 ); if ( ! function_exists( 'mino_custom_woocommerce_breadcrumb' ) ) { function mino_custom_woocommerce_breadcrumb( $args ){ $args['wrap_before'] = '
'; return $args; } } add_filter( 'woocommerce_breadcrumb_defaults', 'mino_custom_woocommerce_breadcrumb', 10, 1 ); }