Forums

Join
bbPress Support ForumsTroubleshootingHow to remove Occupation & Interest META data?

Info

Tags

How to remove Occupation & Interest META data?

  1. On the registeration page, it asks the user to enter in Occupation and Interest.

    I want to completely remove these fields.

    How?

  2. That's not standard... did you add a plugin to support this? If so, turning off the plugin should do the trick. :-)

  3. No plugin.

    It's a clean RC install.

  4. Ah I added some extra stuff to my profile using a plugin, so had always assumed Occupation and Interest were part of the plugin!

    Doing more research now...

  5. @johnhiler

    Thanks, I'm looking into the database right now myself. ;)

    If you find anything, please let me know. Back to looking myself

  6. Hmm ... looks like it's hardcoded in the bb-include/functions.bb-core.php

    /meta_key => (required?, Label, hCard property). Don't use user_{anything} as the name of your meta_key.
    function bb_get_profile_info_keys( $context = null ) {
    return apply_filters( 'get_profile_info_keys', array(
    'first_name' => array(0, __('First name')),
    'last_name' => array(0, __('Last name')),
    'display_name' => array(1, __('Display name as')),
    'user_email' => array(1, __('Email'), 'email'),
    'user_url' => array(0, __('Website'), 'url'),
    'from' => array(0, __('Location')),
    'occ' => array(0, __('Occupation'), 'role'),
    'interest' => array(0, __('Interests')),
    ), $context );
    }

    Anyone know of a good way to remove Occupation and Interests without having to modify the bb-core.php file (to make future upgrading easier)

  7. In case anyone is curious, I created the following plugin to remove the Occupation and Interests user profile meta data.

    <?php

    /*
    Plugin Name: My Profile Fields
    Description: My profile fields for my lovely forums
    Version 1.0
    */

    function my_profile_fields( $fields ) {

    unset( $fields['occ'] ); /* removes the Occupation profile field: */

    unset( $fields['interest'] ); /* removes the Interests profile field: */

    return $fields;

    }

    add_filter( 'get_profile_info_keys', 'my_profile_fields' );

    ?>

  8. Ah ok, that looks pretty similar to johnbillion's plugin. Glad it worked out. :-)

  9. You must log in to post.