Archives: Snippets
WP Simple Pay: Allow Customers to Exempt from Tax
add_filter( ‘simpay_get_customer_args_from_payment_form_request’, function( $customer_args, $form, $deprecated, $form_values ) { $exempt = isset( $form_values[‘simpay_field’][‘Tax Exempt’] ); if ( $exempt ) { $customer_args[‘tax_exempt’] = ‘exempt’; } return $customer_args; }, 10, 4 );Continue reading
Homepage Chatbot
Hide the ‘Screen Options’ Tab on admin bar
// Hide the admin ‘Screen Options’ tab add_filter(‘screen_options_show_screen’, ‘__return_false’);Continue reading
AdCritter
Replace The WordPress Logo on Login Page with your own logo
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://qcs-ghana.stromstadafroshop.se/wp-content/uploads/2024/04/logo-email-header.webp’; $logo_width = 100; $logo_height = 100; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading
Convert Uploaded Images to WebP Format Automatically
/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading
Untitled Snippet
MemberPress: Change default values for state and country fields on registration forms
(function($) { $(document).ready(function() { // Set defaults US, TX $(‘#mepr_signup_form #mepr-address-country’).val(‘US’).change(); $(‘#mepr_signup_form #mepr-address-state’).val(‘TX’).change(); }); })(jQuery);Continue reading
WP Simple Pay: Custom Button Color
.simpay-styled .simpay-form-control .simpay-btn:not(.stripe-button-el) { background-color: #0b749d; } .simpay-styled .simpay-form-control .simpay-btn:not(.stripe-button-el):focus, .simpay-styled .simpay-form-control .simpay-btn:not(.stripe-button-el):hover { background-color: #086285; }Continue reading