Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Removes Theme_My_Login_MS_Signup::tml_request_register
- */
- function tml_init() {
- global $theme_my_login_ms_signup;
- remove_action( 'tml_request_register', array( &$theme_my_login_ms_signup, 'tml_request_register' ) );
- }
- add_action( 'init', 'tml_init' );
- /**
- * Replace Theme_My_Login_MS_Signup::tml_request_register with a version that doesn't redirect to the main site
- *
- * @param object $theme_my_login Reference to global Theme My Login object
- */
- function tml_request_register( &$theme_my_login ) {
- global $theme_my_login_ms_signup;
- add_action( 'wp_head', 'wp_no_robots' );
- add_action( 'wp_head', array( &$theme_my_login_ms_signup, 'signup_header' ) );
- if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
- wp_redirect( network_home_url() );
- exit;
- }
- }
- add_action( 'tml_request_register', 'tml_request_register' );
- /**
- * Adds signup meta to register user to current blog
- *
- * @param array $meta Signup meta
- */
- function tml_add_signup_meta( $meta ) {
- global $current_blog;
- $meta['add_to_blog'] = $current_blog->blog_id;
- $meta['new_role'] = 'subscriber';
- return $meta;
- }
- add_filter( 'add_signup_meta', 'tml_add_signup_meta' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement