• Hi

    Is there a way to unhook the taxonomies from ‘edit_user_profile’ so they don’t show on frontend profile forms?

    I have tried this code I found somewhere else, but haven’t been able to get it to work:

    add_action( 'plugins_loaded', function() {
        global $lh_uts;
        remove_action( 'show_user_profile', array( &$lh_uts, 'user_profile' ) );
        remove_action( 'edit_user_profile', array( &$lh_uts, 'user_profile' ) );
    });

    Many thanks
    Steve

Viewing 1 replies (of 1 total)
  • Thread Starter steveboj

    (@steveboj)

    I have managed to get it to work by putting this code in a plugin:

    function disable_lh_user_taxonomies() {
        global $lh_user_taxonomies_instance;
        remove_action('edit_user_profile', array( $lh_user_taxonomies_instance, 'user_profile' ));  // removes it from frontend forms
        remove_action('show_user_profile', array( $lh_user_taxonomies_instance, 'user_profile' ));  // removes it from backend forms
    }
    add_action('plugins_loaded', 'disable_lh_user_taxonomies', 11);

    Let me know if there’s a better/correct way to achieve this?

    Thanks
    Steve

    • This reply was modified 3 years, 2 months ago by steveboj.
Viewing 1 replies (of 1 total)
  • The topic ‘Remove taxonomies from the user view/edit screens’ is closed to new replies.