Skip to content

Instantly share code, notes, and snippets.

@ipokkel
Last active October 12, 2023 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ipokkel/4f799ddc3fbce0d709cffbc153291b0b to your computer and use it in GitHub Desktop.
Save ipokkel/4f799ddc3fbce0d709cffbc153291b0b 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