Disable Thumbnail Image Sizes (copy)

add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading

Generate Branded WP Maintenance Page

function rd_client_write_maintenance_dropin() { if (!function_exists(‘rd_client_get_brand_tokens’) || !function_exists(‘rd_client_brand_css_vars_from_tokens’)) { return new WP_Error(‘rd_tokens_missing’, ‘Brand token helpers are not loaded.’); } $tokens = rd_client_get_brand_tokens(); $vars_css = rd_client_brand_css_vars_from_tokens($tokens); // Favicon: token override, else Site Icon $favicon = ”; if (!empty($tokens[‘favicon_url’])) { $favicon = $tokens[‘favicon_url’];…Continue reading

Style Custom WP Error Page

if ( ! defined(‘RD_WP_DIE_BRANDER’) ) { return; } add_filter(‘rd_wp_die_head_css’, function ($css) { // Load tokens and convert to CSS variables $tokens = rd_client_get_brand_tokens(); $vars = ‘:root{‘.rd_client_brand_css_vars_from_tokens($tokens).’}’; $css .= $vars .Continue reading

Assign WP Error Page HTML Class and Change Title

if ( ! defined(‘RD_WP_DIE_BRANDER’) ) { define(‘RD_WP_DIE_BRANDER’, true); } add_action(‘plugins_loaded’, function () { if ((function_exists(‘wp_doing_ajax’) && wp_doing_ajax()) || (function_exists(‘wp_is_json_request’) && wp_is_json_request()) || (defined(‘XMLRPC_REQUEST’) && XMLRPC_REQUEST)) { return; } add_filter(‘wp_die_handler’, function () { return ‘rd_wp_die_passthrough_handler’; }); }); function rd_wp_die_passthrough_handler( $message, $title…Continue reading

Branding Tokens for WP Pages Customisation

add_filter(‘rd_client_brand_tokens’, function ($t) { return array_merge($t, [ // Colours ‘color_primary’ => ‘#231f20’, ‘color_accent’ => ‘#881721’, ‘color_bg’ => ‘#ffffff’, ‘color_bg_alt’ => ‘#881721’, ‘color_text’ => ‘#231f20’, ‘color_link’ => ‘#231f20’, ‘color_link_hover’ => ‘#881721’, // Fonts ‘font_family’ => ‘Roboto, Tahoma, Geneva, sans-serif’, ‘font_family_headings’ =>…Continue reading

Enable Brand Colours Engine for WP Pages Customisations

function rd_client_brand_css_vars_from_tokens(array $tokens): string { $vars = []; foreach ($tokens as $key => $val) { // Convert underscores in PHP keys to hyphens for CSS vars $css_key = str_replace(‘_’, ‘-‘, $key); $vars[] = “–rd-client-{$css_key}: {$val};”; } return implode(”, $vars); }…Continue reading

SHOP – WOO overrides

// ************************************************************************************************* // General woocommerce overrides // ************************************************************************************************* // ————————————————————————————————- // don’t show removed from cart message add_filter( ‘woocommerce_cart_item_removed_notice_type’, ‘__return_false’ ); // ————————————————————————————————- // override standard added to cart message add_filter( ‘wc_add_to_cart_message’, ‘asa_custom_wc_add_to_cart_message’, 10, 2 ); function asa_custom_wc_add_to_cart_message( $message, $product_id…Continue reading

SHOP – PDF Packing Slip

// ————————————————————————————————- // Format player name and division/team // add_action( ‘wpo_wcpdf_after_shipping_address’, ‘add_custom_billing_fields_to_pdf’, 10, 2 ); function add_custom_billing_fields_to_pdf ($document_type, $order) { if ($document_type == ‘packing-slip’) { $billing_playername = ”; $site_title = get_bloginfo(‘name’); if ($site_title == ‘Oakville Raiders’ || $site_title == ‘Seasiders…Continue reading