How to add Login Form shortcode to Restrict Access Message
-
Hi,
I’m trying to add the UM login form to the global restricted access message.
By default, the shortcode shows up as text:
[ultimatemember form_id=”2209″]I’ve used the following code suggested in other tickets. With this in my child theme functions.php file, the shortcode no longer shows up, but the code doesn’t render either. It is just blank.
add_filter("um_get_option_filter__restricted_access_message",function( $value ){ if( is_admin() ) return $value; if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) { return do_shortcode( $value ); } else { return apply_shortcodes( $value ); } return $value; });
The issue I’m trying to solve is:
Members that are trying to access restricted content get this message. Currently they are directed to login via the default WordPress login page. But this doesn’t redirect them back to the page they were trying to access.I was able to make this work on a standard page and added it to my 404 template, which works great.
I’d appreciate your guidance in adding the same functionality to the Restricted Access message.
Thank you
The page I need help with: [log in to see the link]
- The topic ‘How to add Login Form shortcode to Restrict Access Message’ is closed to new replies.