function add_alt_text_to_images( $html ) { // Check if the image has a title attribute if ( preg_match( ‘/(title=[“‘].*?[“‘])/’, $html, $matches ) ) { // Get the title $title = substr( $matches[0], 7, -1 ); // Check if the image has…Continue reading
$isProduction = true; $triggerWords = [‘.loc’, ‘localhost’, ‘.local’, ‘staging.’, ‘.staging’, ‘.testing’, ‘.dev’, ‘.test’, ‘.cloud’]; // edit triggerWords for your setup, these as fairly standard identifiers of non production env // the goal is to check the root url for a…Continue reading
add_filter( ‘woocommerce_email_enabled_customer_completed_order’, ‘__return_false’ );Continue reading
function send_welcome_email_on_transaction_completed($event) { $txn = $event->get_data(); // Get the transaction data MeprUtils::send_notices($txn, ‘MeprUserWelcomeEmail’, null, true); // Send the welcome email } add_action(‘mepr-event-transaction-completed’, ‘send_welcome_email_on_transaction_completed’);Continue reading
function send_welcome_email_on_transaction_completed($event) { $txn = $event->get_data(); // Get the transaction data $usr = $txn->user(); // Get the user associated with the transaction MeprUtils::maybe_send_product_welcome_notices($txn, $usr); // Send the membership-specific welcome email } add_action(‘mepr-event-transaction-completed’, ‘send_welcome_email_on_transaction_completed’);Continue reading
add_filter( ‘mepr-can-you-buy-me-override’, function( $override, $product ) { // Check if the user is on the MemberPress Account page if ( !is_page( ‘account’ ) ) { return $override; } // Get the current user and their active memberships $user = MeprUtils::get_currentuserinfo();…Continue reading
add_action(‘wp_footer’, function() { if (is_singular(‘memberpressproduct’)) { echo ‘ ‘ . get_the_title() . ‘ ‘; ?>Continue reading
Add_filter(‘woocommerce_package_rates’, ‘wf_sort_shipping_methods’, 10, 2); function wf_sort_shipping_methods($available_shipping_methods, $package) { // Arrange shipping methods as per your requirement $sort_order = array( ‘wf_shipping_ups’ => array(), ‘wf_shipping_usps’ => array(), ‘free_shipping’ => array(), ‘local_pickup’ => array(), ‘legacy_flat_rate’ => array(), ); // unsetting all methods that…Continue reading
Add_filter(‘woocommerce_package_rates’, ‘wf_sort_shipping_methods’, 10, 2); function wf_sort_shipping_methods($available_shipping_methods, $package) { // Arrange shipping methods as per your requirement $sort_order = array( ‘wf_shipping_ups’ => array(), ‘wf_shipping_usps’ => array(), ‘free_shipping’ => array(), ‘local_pickup’ => array(), ‘legacy_flat_rate’ => array(), ); // unsetting all methods that…Continue reading
add_filter(‘mepr-vat-countries’, function($countries) { unset($countries[‘GB’]); return $countries; });Continue reading