Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garconis/30c39556c377b01ec7b7792260cd09df to your computer and use it in GitHub Desktop.
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
<?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