MemberPress: Generate All Invoices

function generate_bulk_invoices() { if( isset( $_REQUEST[ ‘generate-invoices’ ] ) ) { global $wpdb; $query = “SELECT id FROM {$wpdb->prefix}mepr_transactions WHERE status in (‘complete’, ‘confirmed’, ‘refunded’)”; $txn_ids = $wpdb->get_results( $query ); foreach( $txn_ids as $txn_id ) { $invoices = new MePdfInvoicesCtrl();…Continue reading

MemberPress: Add Currency Codes To MemberPress

function mepr_currency_codes( $codes ) { array_push( $codes, ‘EGP’ ); // Adds ‘EGP’ to the list of currency codes. To add a different currency, replace EGP with the three-letter currency code of the needed currency. return $codes; // Return the modified…Continue reading

WooCommerce | Add currency below Total at checkout

function add_currency_below_total() { $currency = get_woocommerce_currency(); // Get currency code (e.g., USD, CAD, EUR) echo ‘ ‘ . __(‘Currency’, ‘woocommerce’) . ‘ ‘ . esc_html($currency) . ‘ ‘; } add_action(‘woocommerce_review_order_after_order_total’, ‘add_currency_below_total’);Continue reading

Disable New User Notifications

function wpcode_send_new_user_notifications( $user_id, $notify = ‘user’ ) { if ( empty( $notify ) || ‘admin’ === $notify ) { return; } elseif ( ‘both’ === $notify ) { // Send new users the email but not the admin. $notify =…Continue reading

Disable Emojis

/** * Disable the emojis in WordPress. */ add_action( ‘init’, function () { remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); remove_filter( ‘wp_mail’,…Continue reading