MemberPress: Move Membership Content Below Product Table on Registration Page
add_action( ‘wp_footer’, function() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action( ‘wp_footer’, function() { ?>Continue reading
function exclude_protected_memberpress_posts( $query ) { // Ensure we are not in the admin area and it’s the main query if ( ! is_admin() && $query->is_main_query() ) { // Check if we are on the repeater field context if ( function_exists(…Continue reading
function mepr_load_mp_styles() { wp_enqueue_style( ‘mepr-moove_gdpr_frontend’, ‘https://your-domain.com/path/to/your/gdpr-stylesheet.css’, array(), ‘4.15.0’ ); } // Add the action to enqueue the GDPR stylesheet on the frontend add_action( ‘wp_enqueue_scripts’, ‘mepr_load_mp_styles’ );Continue reading
function maybe_hide_pause_resume_links( $link, $sub ) { // Replace 123, 456 with the membership IDs which members can pause/resume subscriptions for. $products_to_allow = array( ‘123’, ‘456’ ); $product = $sub->product(); if( in_array( $product->ID, $products_to_allow ) ) { return $link; } else…Continue reading
function mepr_exclude_protected_posts_from_query_block( $query ) { if (! is_admin() && $query->is_main_query()) { $posts_to_exclude = array(); $posts = get_posts(array(‘post_type’ => ‘post’, ‘posts_per_page’ => -1)); foreach ($posts as $post) { if (MeprRule::is_locked($post)) { $posts_to_exclude[] = $post->ID; } } if (! empty($posts_to_exclude)) { $query->set(‘post__not_in’,…Continue reading
add_filter( ‘mepr-activecampaign-add-subscriber-args’, function( $args, $user ) { // Check if the username is set in the POST request and sanitize it $username = isset( $_POST[‘user_login’] ) ? sanitize_text_field( $_POST[‘user_login’] ) : ”; // Add the username to the custom field…Continue reading
// Remove the inactive tag function mepr_remove_ck_inactive_tag_from_subscriber($txn) { $contact = $txn->user(); $enabled = (bool)get_post_meta($txn->product_id, ‘_meprconvertkit_tag_override’, true); $active_tag_id = get_post_meta($txn->product_id, ‘_meprconvertkit_tag_override_id’, true); $inactive_tag_id = get_post_meta($txn->product_id, ‘_meprconvertkit_inactive_tag_override_id’, true); $ck = new MpConvertKit(); // Remove active tag if ($enabled && !empty($active_tag_id)) { $ck->remove_tag_from_subscriber($contact,…Continue reading
add_action( ‘mepr-account-is-inactive’ , function ( $txn ) { if ( is_plugin_active( ‘buddypress/bp-loader.php’ ) && $txn instanceof MeprTransaction) { //first we need to make sure that the user isn’t active on another subscription $mepr_user = new MeprUser( $txn->user_id ); if (…Continue reading