Last active
December 2, 2020 01:52
-
-
Save cryptexvinci/7e2ca1a0ba2d845d9eca0bba79dc8279 to your computer and use it in GitHub Desktop.
Login Redirect from Comments
This file contains hidden or 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 | |
/** | |
* Ultimate member - Redirect Comment to UM Login page on “You must be logged in to post a comment”. | |
* URL: https://wordpress.org/support/topic/email-domain-restriction-at-registration/ | |
*/ | |
// Change Default Comment Login link to UM Login Page. | |
add_filter( 'comment_form_defaults', 'um_change_login_link' ); | |
if ( ! function_exists( 'um_change_login_link' ) ) { | |
function um_change_login_link( $defaults ) { | |
if ( class_exists( 'UM' ) ) { | |
$defaults['must_log_in'] = '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), um_get_core_page( 'login' ) ) . '</p>'; | |
return $defaults; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment