Skip to content

Instantly share code, notes, and snippets.

@dwanjuki
Forked from andrewlimaza/show_login_form.php
Last active May 28, 2024 13:52
Show Gist options
  • Save dwanjuki/b918161ffde199c1a4b91a4e05bf7986 to your computer and use it in GitHub Desktop.
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
<?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