replace events with moments

add_filter( ‘tribe_event_label_singular’, function() { return ‘Moment’; } ); add_filter( ‘tribe_event_label_singular_lowercase’, function() { return ‘moment’; } ); add_filter( ‘tribe_event_label_plural’, function() { return ‘Moments’; } ); add_filter( ‘tribe_event_label_plural_lowercase’, function() { return ‘moments’; } );Continue reading

Redirect User by Domain

// This line is adding a custom function to the ‘login_redirect’ filter. The ‘login_redirect’ filter is applied right after a user logs in to WordPress. The custom function ‘wppbc_custom_login_redirect’ is given a priority of 10, and it accepts 3 arguments.…Continue reading

MemberPress: Exclude Protected Posts from Search Results

function maybe_exclude_protected_posts($query) { if(!$query->is_admin && $query->is_search && $query->is_main_query()) { $posts_to_exclude = array(); $posts = get_posts(array( ‘post_type’ => get_post_types(), ‘numberposts’ => -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’, $posts_to_exclude); } } }…Continue reading