Type: php
MemberPress: Redirect Users After Login Based on Referrer
// Redirect all users to a specific page after login from a specific login page function custom_mepr_login_redirect_url($url, $user) { // Check the referrer to see if the login request came from a specific page if (isset($_SERVER[‘HTTP_REFERER’])) { $referrer = $_SERVER[‘HTTP_REFERER’];…Continue reading
MemberPress: Redirect Users After Login Based on Roles
// Redirect users after login based on their roles function custom_mepr_login_redirect_url($url, $user) { // Check if the user object is valid if (isset($user->roles) && is_array($user->roles)) { // Roles that should be redirected to the WordPress dashboard $admin_roles = array(‘administrator’, ‘editor’,…Continue reading
MemberPress: Redirect Users After Login Based on Roles
// Redirect users after login based on their roles function custom_mepr_login_redirect_url($url, $user) { // Check if the user object is valid if (isset($user->roles) && is_array($user->roles)) { // Roles that should be redirected to the WordPress dashboard $admin_roles = array(‘administrator’, ‘editor’,…Continue reading
MemberPress: Prevent users from auto-login after registration
function mepr_disable_auto_login($auto_login, $membership_id, $mepr_user) { return false; } add_filter(‘mepr-auto-login’, ‘mepr_disable_auto_login’, 10, 3);Continue reading
MemberPress: Exclude MemberPress Custom Post Types from WordPress Search Results
function exclude_ml_file_from_search( $query ) { // Check if it is not an admin page, is a search query, and is the main query if ( !$query->is_admin && $query->is_search && $query->is_main_query() ) { // Exclude the ‘mpdl-file’ post type from the…Continue reading
Enhancing Topic Filter Layout in Fluent Community
// * CodeSnippet Name: Fluent Community Modification // * Description: A custom Code for Fluent Community plugin // * Author: InKontaktBringer Team – Sumaiya // * Author URI: https://www.inkontaktbringer.de/linktree add_action(‘fluent_community/portal_head’, function() { ?>Continue reading
cmplz-show-banner
/** * Show the banner when a html element with class ‘cmplz-show-banner’ is clicked */ function cmplz_show_banner_on_click() { ?>Continue reading
Disable Login by Email
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
Disable Widget Blocks (use Classic Widgets)
add_filter( ‘use_widgets_block_editor’, ‘__return_false’ );Continue reading