jaredatch / bbPress-Genesis-Extend

Provides basic compatibility with bbPress and the Genesis Framework with a few extra goodies.
5 stars 5 forks source link

Remove Genesis profile fields from front end profile edit screen #8

Closed dreamwhisper closed 10 years ago

dreamwhisper commented 10 years ago

Forum users with access to Genesis edit settings in their profiles (ie Administrators) see the following display issue when editing their profiles on the front end. 2014-10-06 13-39-27

To prevent this, they can be removed unless viewing in the admin profile:

add_action( 'bbp_ready', 'bbp_genesis_extend_disable_genesis_profile_fields_in_forum_user_edit' );
function bbp_genesis_extend_disable_genesis_profile_fields_in_forum_user_edit(){

    if( ! is_admin() ) {
        remove_action( 'show_user_profile', 'genesis_user_options_fields' );
        remove_action( 'edit_user_profile', 'genesis_user_options_fields' );
        remove_action( 'show_user_profile', 'genesis_user_archive_fields' );
        remove_action( 'edit_user_profile', 'genesis_user_archive_fields' );
        remove_action( 'show_user_profile', 'genesis_user_seo_fields' );
        remove_action( 'edit_user_profile', 'genesis_user_seo_fields' );
        remove_action( 'show_user_profile', 'genesis_user_layout_fields' );
        remove_action( 'edit_user_profile', 'genesis_user_layout_fields' );
    }

}
jaredatch commented 10 years ago

Thanks for the heads up. I'll get a fix out here soon as I get time.