Skip to content

Instantly share code, notes, and snippets.

@sjaved87
Last active March 20, 2016 09:52
Show Gist options
  • Save sjaved87/c7257153c7661919b884 to your computer and use it in GitHub Desktop.
Save sjaved87/c7257153c7661919b884 to your computer and use it in GitHub Desktop.
This snippet will remove duplicate password fields on custom registration pages added by "Set Password on Multisite Blog Creation" plugin.
<?php
if( !function_exists('wpmudev_remove_set_pass_on_custom_registration_pages') ) :
add_action('init', 'wpmudev_remove_set_pass_on_custom_registration_pages', 10);
function wpmudev_remove_set_pass_on_custom_registration_pages( $col_headers ){
global $pagenow;
if( $pagenow != 'wp-signup.php' && ( !isset( $_GET['action'] ) && $_GET['action'] != 'new_blog' ) ){
//Remove all actions of set password on multisite blog creation plugin if we are not on default signup page or on prosites add new blog page.
remove_action('init', 'wpmu_signup_password_init');
remove_action('template_redirect', 'wpmu_signup_password_init_sessions');
remove_action('wp_footer', 'wpmu_signup_password_stylesheet');
remove_action('signup_extra_fields', 'wpmu_signup_password_fields');
remove_action('wpmu_validate_user_signup', 'wpmu_signup_password_filter');
remove_action('signup_blogform', 'wpmu_signup_password_fields_pass_through');
remove_action('add_signup_meta', 'wpmu_signup_password_meta_filter',99);
remove_action('random_password', 'wpmu_signup_password_random_password_filter');
}
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment