/** * 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
add_filter( ‘beehive_google_analytics_ga4_accounts_page_size’, function ( $limit ) { return 100; } );Continue reading
add_filter( ‘gettext’, function ( $translated_text, $text, $domain ) { if ( $text == ‘Birthday (optional)’ ) { $translated_text = __( ‘Birthday’, ‘rug’ ); } return $translated_text; }, 20, 3 );Continue reading
add_action( ‘wp’, function () { remove_theme_support( ‘wc-product-gallery-zoom’ ); }, 100 );Continue reading
/** * Plugin Name: [Smush] – Original Images * Plugin URI: https://premium.wpmudev.org/ * Description: Displays all original images so they can be deleted. Requires Smush * Author: Panos Lyrakis @ WPMUDEV * Author URI: https://premium.wpmudev.org/ * License: GPLv2 or later…Continue reading