Require a comments with rating
add_filter( ‘tasty_recipes_min_rating_without_comment’, function() { return 6; // Require comments for 4 and 5 star ratings too. } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘tasty_recipes_min_rating_without_comment’, function() { return 6; // Require comments for 4 and 5 star ratings too. } );Continue reading
add_action( ‘woocommerce_email_order_meta’, function( $order, $sent_to_admin, $plain_text, $email ) { // Check if coupon is used in order if ( $order->get_used_coupons() ) { // Get the coupon codes used in the order $coupon_codes = implode( ‘, ‘, $order->get_used_coupons() ); // Set…Continue reading
// Register the smart tag. add_filter( ‘wpforms_smart_tags’, static function( $tags ) { // Key is the tag, value is the tag name. $tags[‘current_time’] = ‘Current Date/Time’; return $tags; } ); // Replace its value on form render on front-end. add_filter(…Continue reading
add_action( ‘wpforms_frontend_output_success’, static function ( $form_data, $fields, $entry_id ) { unset( $_GET[‘wpforms_return’], $_POST[‘wpforms’][‘id’] ); // If you want to preserve the user entered values in form fields – remove the line below. unset( $_POST[‘wpforms’][‘fields’] ); // Actually render the form.…Continue reading
add_filter( ‘woocommerce_cart_ready_to_calc_shipping’, function( $show_shipping ) { if ( is_cart() ) { return false; } return $show_shipping; }, 99 );Continue reading
function remove_image_zoom_support_webtalkhub() { remove_theme_support( ‘wc-product-gallery-zoom’ ); } add_action( ‘wp’, ‘remove_image_zoom_support_webtalkhub’, 100 );Continue reading
add_action( ‘woocommerce_product_meta_start’, ‘text_after_meta_start’ ); function text_after_meta_start(){ echo ‘ Beställ färgprovar Hemma hos dig inom 2 – 3 veckor Unik, stark och hållbar Tillverkas i vår egen verkstad i Malung-Sälen av lokalt virke Hög kvalitet till ett rättvist pris Personlig service…Continue reading
/** * Hide shipping rates when free shipping is available. * Updated to support WooCommerce 2.6 Shipping Zones. * * @param array $rates Array of rates found for the package. * @return array */ function my_hide_shipping_when_free_is_available( $rates ) { $free…Continue reading
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 ); add_action( ‘woocommerce_before_single_product_summary’, ‘start_left_side’, 5 ); function start_left_side() { print ‘ ‘.PHP_EOL; } add_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_template_single_excerpt’, 30 ); add_action( ‘woocommerce_before_single_product_summary’, ‘end_left_side’, 40 ); function end_left_side() { print ‘ ‘.PHP_EOL; print ‘ ‘.PHP_EOL; }Continue reading
/** * Adds a top bar to Storefront, before the header. */ function storefront_add_topbar() { ?> Måttbeställt Tillverkade i vårt eget snickeri (Malung-Sälen) Hög kvalitet till ett rättvist pris Snabb leverans (2-3 veckor) <?php } add_action( 'storefront_before_header', 'storefront_add_topbar' );Continue reading