-
-
Save dwanjuki/b918161ffde199c1a4b91a4e05bf7986 to your computer and use it in GitHub Desktop.
Show login form instead of no access message when members are logged out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Show a simple login form if users are logged out and a post/page requires membership | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_show_login_form(){ | |
return wp_login_form(); | |
} | |
add_filter('pmpro_not_logged_in_text_filter', 'pmpro_show_login_form'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment