Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelbeil/b3641953601466384875c6e8102c6cd9 to your computer and use it in GitHub Desktop.
Save michaelbeil/b3641953601466384875c6e8102c6cd9 to your computer and use it in GitHub Desktop.
This recipe removes the "Join Now" registration link on the PMPro login page.
<?php
/**
* This recipe removes the "Join Now" registration link on the login page.
*
* This link is shown only when the "Membership [ ] Anyone can register" option was set
* on the WordPress dashboard under Settings > General. To remove the "Join Now" link
* may also be achieved through deactivating this option if all users are required
* to be a member.
*
* 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 my_pmpro_login_forms_handler_nav( $links ) {
global $pmpro_pages;
// bail if not on login page.
if ( ! is_page( $pmpro_pages['login'] ) ) {
return $links;
}
unset( $links['register'] );
return $links;
}
add_filter( 'pmpro_login_forms_handler_nav', 'my_pmpro_login_forms_handler_nav' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment