Created
December 14, 2021 20:38
-
-
Save Garconis/30c39556c377b01ec7b7792260cd09df to your computer and use it in GitHub Desktop.
WordPress | Only run certain add_action init rules if related plugin is active
This file contains 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 | |
// only run if TML plugin is active | |
add_action( 'init', 'fs_remove_tml_profile_fields'); | |
function fs_remove_tml_profile_fields() { | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
if ( is_plugin_active( 'theme-my-login/theme-my-login.php' ) ) { | |
// remove the password hint helper text from the register and password reset forms | |
tml_remove_form_field( 'register', 'indicator_hint' ); | |
tml_remove_form_field( 'resetpass', 'indicator_hint' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment