MemberPress: Change the Back-Button Link on Courses
add_action( ‘wp_head’, function() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action( ‘wp_head’, function() { ?>Continue reading
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_shortcode( ‘mpcs-course-progress’, function( $atts ) { if( !isset( $atts[ ‘course_id’ ] ) ) return; $user_id = get_current_user_id(); if ( !$user_id ) return ”; $course = new memberpress\courses\models\Course((int)$atts[‘course_id’]); $progress = $course->user_progress($user_id); ?>Continue reading
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
function disable_wp_responsive_images() { return 1; } add_filter(‘max_srcset_image_width’, ‘disable_wp_responsive_images’);Continue reading
(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
function generate_bulk_invoices() { if(isset($_REQUEST[‘generate-invoices’])) { global $wpdb; $query = “SELECT id FROM {$wpdb->prefix}mepr_transactions WHERE created_at > ‘2025-01-01 00:00:00’ AND created_at < '2025-12-31 23:59:59' AND status IN ('complete', 'confirmed', 'refunded')"; $txn_ids = $wpdb->get_results($query); foreach($txn_ids as $txn_id) { $invoices = new MePdfInvoicesCtrl();…Continue reading
add_filter(‘mepr_admin_transactions_cols’, function ($cols) { $cols[‘col_txn_invoice’] = __(‘Invoice No.’, ‘memberpress-pdf-invoice’); return $cols; }); add_action(‘mepr_admin_transactions_cell’, function ($column_name, $rec, $attributes) { if ($column_name === ‘col_txn_invoice’) { ?>Continue reading
add_action(‘mpca-sub-accounts-th’, function($curr_user, $sub_accounts) { ?>Continue reading
add_filter(‘mepr_pre_run_rule_content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts with the specified page slug or ID if ( is_page( array( ‘slug1’, ‘slug2’, 123, 456 ) ) ) { $protect = false; // Disable protection for the specified…Continue reading