MemberPress: Generate All Invoices for the Specific Period (e.g. A Year)

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

MemberPress: Add the Invoice Number to the Transactions Screen

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

Envira – Disable Distraction Free Mode for the Lightbox

/* Envira – Disable Distraction Free Mode for the Lightbox * * @link https://enviragallery.com/docs/how-to-enable-the-envira-distraction-free-mode/ */ add_filter( ‘envira_gallery_get_config’, ‘my_envira_gallery_get_config’, 10, 2 ); function my_envira_gallery_get_config( $data_config, $key ) { if ( $key === ‘idle_time’ ) { $data_config[‘idle_time’] = 60; // false would…Continue reading

MemberPress: Add Custom Field Date to Members Table

function custom_admin_members_col($cols) { $cols[‘business_name’] = __(‘Business Name’, ‘memberpress’); // Replace the business_name with the name of the actual custom field key & replace the dummy Business Name text with the name of the actual custom field return $cols; } add_filter(‘mepr-admin-members-cols’,…Continue reading

MemberPress: Disable MemberPress Protection On Specific Page

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( ‘your-page’ ) || is_page( 123 ) ) { $protect = false; // Disable protection for the specified page…Continue reading

MemberPress: Disable MemberPress Protection Based on Custom Post Type And Tag

add_filter(‘mepr-pre-run-rule-content’, ‘mepr_override_content_protection’, 11, 3); function mepr_override_content_protection($protect, $post, $uri) { // Unprotect posts that belong to a specific custom post type (mpcs-lesson), with the “free” tag if (‘mpcs-lesson’ === get_post_type($post->ID) && has_tag(‘free’, $post)) { $protect = false; // Disable protection for…Continue reading

MemberPress: Disable MemberPress Protection On Posts with Specific Tags

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 “free” tag and if you want to add more than one tag just add (, ‘tag’) if (has_tag(array(‘free’), $post)) { $protect = false; // Disable protection…Continue reading

Envira – Enable Archives for the Standalone galleries and albums

/* Envira – Standalone Feature – Enable Archives * * @link https://enviragallery.com/docs/how-to-enable-archives-for-standalone-feature/ */ function envira_standalone_enable_archives( $post_args ) { $post_args[‘has_archive’] = true; $post_args[‘supports’] = array( ‘title’, ‘thumbnail’ ); return $post_args; } //Enables archive for the standalone albums add_filter(‘envira_albums_post_type_args’, ‘envira_standalone_enable_archives’); //Enables archive…Continue reading