// This code snippet is intended to populate the vendor credits from the ACF ‘Vendor Management’ // field group and display the values in a list format on the frontend. // // Applies to Post Categories below: // – Real…Continue reading
/** * Ensures that a Statement Descriptor is not sent to the Stripe PaymentIntent creation process. * * This is a HOTFIX and is not intended for long-term use. We recommend updating to Easy Digital Downloads 3.2.8+ * * This…Continue reading
add_filter( ‘render_block_tasty-roundups/item’, function ( $block ) { $initial_block = $block; $block = preg_replace( ‘~Continue reading
/** * Add a custom product data tab */ add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs[‘test_tab’] = array( ‘title’ => __( ‘Shipping Info’, ‘woocommerce’ ), ‘priority’ => 50, ‘callback’ => ‘woo_new_product_tab_content’ );…Continue reading
/** * Avoid Typography Widows */ function kl_avoid_content_widows( $content ) { $pattern = ‘@(?:\s)([[:punct:][:word:]]+)(?:\s)(?!/>)([[:punct:][:word:]]+)(?:\s)([[:punct:][:word:]]+)@m’; $replacement = ‘ $1 $2 $3‘; $content = preg_replace( $pattern, $replacement, $content, -1 ); return $content; } add_filter( ‘the_content’, ‘kl_avoid_content_widows’ );Continue reading
function remove_noscript_tags($html) { return preg_replace(‘/(.*?)/is’, ”, $html); } add_filter(‘the_content’, ‘remove_noscript_tags’);Continue reading
/** * Enables the HTTP Strict Transport Security (HSTS) header in WordPress. * Includes preloading with subdomain support. */ function tg_enable_strict_transport_security_hsts_header_wordpress() { header( ‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’ ); } add_action( ‘send_headers’, ‘tg_enable_strict_transport_security_hsts_header_wordpress’ );Continue reading
// Add this code to your theme’s functions.php file or a custom plugin. add_filter(‘unzip_file_use_ziparchive’, ‘__return_false’);Continue reading
// This code snippet this used to sort the vendor archive located on the “Vendor Guide”. // It makes sure that featured vendors (ACF field group ‘status_ven_featured’ set to 1) appear first, // followed by paying vendors (ACF field group…Continue reading
add_action( ‘woocommerce_thankyou’, function ( $order_id ) { if ( ! $order_id ) { return; } $order = wc_get_order( $order_id ); if( ‘processing’ == $order->get_status() ) { $order->update_status( ‘completed’ ); } } );Continue reading