MemberPress: Change Email Subject in Bulk

function mepr_change_subject($subject, $recipients, $message, $headers) { if (strpos(strtolower($subject), ‘your new password’) !== false) { $subject = ‘Your New Password on yourdomain.com’; } return $subject; } add_filter(‘mepr-wp-mail-subject’, ‘mepr_change_subject’, 10, 4);Continue reading

MemberPress: Add Custom Field to Transactions Table

function custom_admin_transaction_col($cols) { $cols[‘col_business_name’] = __(‘Business Name’, ‘memberpress’); return $cols; } add_filter(‘mepr-admin-transactions-cols’, ‘custom_admin_transaction_col’); function custom_admin_transaction_col_sort($cols) { $cols[‘col_business_name’] = array(‘business_name’, true); return $cols; } add_filter(‘mepr-admin-transactions-sortable-cols’, ‘custom_admin_transaction_col_sort’); function custom_admin_transaction_col_content($column_name, $rec, $attributes) { if($column_name == ‘col_business_name’) { $user = get_user_by(‘login’, $rec->user_login); $business_name =…Continue reading

MemberPress: Classic Editor Fix for Courses

add_filter( ‘classic_editor_enabled_editors_for_post_type’, function ( $editors, $post_type ) { if ( $post_type == ‘mpcs-course’ || $post_type == ‘mpcs-lesson’ || $post_type = ‘mpcs-quiz’ ) { $editors[‘classic_editor’] = false; } return $editors; }, 10, 2 );Continue reading

Add Dropdown with Quantity Products per Page to Shop Page (WooCommerce)

function g9_woo_selectbox() { $per_page = filter_input(INPUT_GET, ‘perpage’, FILTER_SANITIZE_NUMBER_INT); echo ‘ ‘; echo ‘‘; $orderby_options = array( ’12’ => ’12 Items’, ’24’ => ’24 Items’, ’48’ => ’48 Items’, ’96’ => ’96 Items’ ); $shop_page_url = get_permalink(wc_get_page_id(‘shop’)); foreach ($orderby_options as $value…Continue reading

Trigger Variation Image Change After Color Change (WooCommerce)

(function ($) { $(document).ready(function ($) { var variations = JSON.parse( jQuery(“.variations_form”).attr(“data-product_variations”) ); if (variations) { var nthAttributeToSwitchImage = 1; var attributeName = Object.keys( variations[nthAttributeToSwitchImage – 1].attributes )[0]; // jQuery(“[name=” + attributeName + “]”).change(function () { jQuery(“.woocommerce div.product form.cart .variations select”).change(…Continue reading