Location: everywhere
Custom API Keys
/** * Returns the Stripe Secret key. */ function get_secret_key( $key ) { return ‘sk_live_123’; } add_filter( ‘simpay_stripe_api_secret_key’, ‘get_secret_key’ ); add_filter( ‘simpay_secret_key’, ‘get_secret_key’ ); /** * Returns the Stripe Publishable key. */ function get_publishable_key( $key ) { return ‘pk_live_123’; }…Continue reading
RT7 Official – Maintenance Mode (copy)
function custom_maintenance_mode() { if ( ! is_user_logged_in() ) { header( ‘HTTP/1.1 503 Service Temporarily Unavailable’ ); header( ‘Content-Type: text/html; charset=utf-8’ ); header( ‘Retry-After: 3600’ ); // You can change this value to set a different retry time (in seconds). ?>…Continue reading
Require Downloadable fields – Downloadable product template
add_filter( ‘wcvendors_pro_product_form_download_files_path’, ‘make_required’ ); add_filter( ‘wcvendors_pro_product_form_product_attributes_path’, ‘make_required’ ); add_filter( ‘wcv_product_dowlnoad_limit’, ‘make_required’ ); add_filter( ‘wcv_product_download_expiry’, ‘make_required’ ); function make_required( $field ){ $field[‘custom_attributes’] = array( ‘required’ => ” ); return $field; }Continue reading
Untitled Snippet
function obtener_sismos_recientes() { // URL de la API $url = ‘https://ultimosismo.igp.gob.pe/ultimo-sismo/ajaxb/2024?_=1694788511856’; // Obtener los datos de la API $respuesta = wp_remote_get($url); if (is_wp_error($respuesta)) { return ‘No se pudieron obtener los datos de los sismos.’; } $cuerpo = wp_remote_retrieve_body($respuesta); $datos =…Continue reading
AIOSEO – Increase SEO Analyzer TimeOut
add_filter( ‘http_request_args’, ‘aioseo_filter_analyzer_timeout’, 1, 2 ); function aioseo_filter_analyzer_timeout( $args, $url ) { if ( ‘https://analyze.aioseo.com/v1/analyze/’ === $url ) { $args[‘timeout’] = 120; } return $args; }Continue reading
Soften the password requirements
function reduce_woocommerce_min_strength_requirement( $strength ) { return 1; } add_filter( ‘woocommerce_min_password_strength’, ‘reduce_woocommerce_min_strength_requirement’ );Continue reading
Soften the password requirements
function reduce_woocommerce_min_strength_requirement( $strength ) { return 1; } add_filter( ‘woocommerce_min_password_strength’, ‘reduce_woocommerce_min_strength_requirement’ );Continue reading
Improve the add-to-cart message [EN]
add_filter( ‘wc_add_to_cart_message’, ‘bbloomer_custom_add_to_cart_message’ ); function bbloomer_custom_add_to_cart_message() { global $woocommerce; $return_to = get_permalink(woocommerce_get_page_id(‘cart’)); $message = sprintf(‘%s %s‘, __(‘Great choice! 🙂 The product has been added to your cart.’, ‘woocommerce’), $return_to, __(‘Go to cart?’, ‘woocommerce’) ); return $message; }Continue reading
Keep status at “on-hold” for all WooCommerce orders
function vd_adjust_order_paid_status( $status, $order_id, $order ) { return ‘on-hold’; } add_filter( ‘woocommerce_payment_complete_order_status’, ‘vd_adjust_order_paid_status’, 10, 3 );Continue reading