Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove profile links

  • @jdhall1972

    Participant

    WordPress 3.5.1
    BuddyPress 1.7

    BuddyPress is automatically turning custom field results into links on my profile pages. I’ve tried turning off this feature with the code below, but it doesn’t work. Any suggestions?

    `
    function remove_xprofile_links() {
    remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 9, 2 );
    }
    add_action( ‘bp_init’, ‘remove_xprofile_links’ );
    `

    Thanks,
    John

    http://missionsfund.org/missions/john-hall/profile/

Viewing 19 replies - 1 through 19 (of 19 total)
  • @allenpayne

    Participant

    I’d like to know this as well. can anyone help?

    @allenpayne

    Participant

    I’ve tried with this code but it doesn’t work either:

    remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 50 );

    @mercime

    Participant

    @jdhall1972
    you’ve got to put that code into  bp-custom.php which you need to upload to wp-content/plugins/ folder in server as posted here https://codex.buddypress.org/developer/customizing/bp-custom-php/
    cc @allenpayne

    @allenpayne

    Participant

    I did that already. Still doesn’t work. I tried to place it in both the functions.php file and the bp-custom.php (located at wp-content/plugins) with no success.

    Any other ideas @mercime?

    @praisehim

    Participant

    True. I am having the same problem with BuddyPress 1.7 and WordPress 3.5.1. This is definately a bug.

    @bphelp

    Participant

    @praisehim
    It is not a bug at all. I use this code with BP 1.7 and WP 3.5.1 with various themes downloaded from wordpress.org and it works flawlessly. Either you have a theme, plugin, or custom code that is conflicting with the code. Please make sure you test it thoroughly as I have before stating it is a bug.

    @praisehim

    Participant

    @bp-help

    Thank you for the response. Would you be able to advise as to where I should begin to see where the conflict is coming from please?

    Thank you once again.

    @bphelp

    Participant

    @praisehim
    The answer is in my previous response. Most likely its a theme, plugin, or custom code you may have introduced. You may need to revert back to a twenty twelve theme or bp-default theme, and deactivate all plugins other than buddypress. If you created a file in wp-content/plugins named bp-custom.php you also need to make sure the code is between opening and closing php tags like so:

    
    <?php
    function remove_xprofile_links() {
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action( 'bp_init', 'remove_xprofile_links' );
    ?>
    

    @praisehim

    Participant

    @bphelp

    It’s funny, but the plugin used to creat the custom fields Buddypress Xprofile Custom Fields Type 1.5.5.5 is what is causing the links to appear. I’m very confused as to what to do. I disabled all plugins and the current theme, and the links didn’t appear, however, as soon as I re-enabled the Buddypress Xprofile Custom Fields Type 1.5.5.5, then the links appear.

    What should I do now please 🙁

    @bphelp

    Participant

    @praisehim
    I suggest you ask the plugins author on their support forum why it conflicts with this function. Request that they add a class to the plugin. A lot of times that helps with conflicting functions. If that doesn’t work then simply don’t use the plugin. For now that is the best advise I can give you.

    @bphelp

    Participant

    I forgot to add this link which explains adding a class which wraps the function of the plugin:
    https://codex.wordpress.org/Plugin_API
    Note the part about avoiding function name collisions.

    @praisehim

    Participant

    @bphelp

    I ended up not using the plugin, however, I did make a post in their support forum asking them to resolve it. It seemed like the default profile fields sufficed for me anyway.

    Thank you for your help!

    @bphelp

    Participant

    @praisehim
    Your very much welcome! Glad I could assist you.

    @bphelp

    Participant

    @praisehim
    For the sake of convenience I made a super light weight plugin wrapped in a class that may enable you to use the Buddypress Xprofile Custom Fields Type plugin along with the plugin I made to get rid of the profile links. Give it a try and give some feedback if this resolves the conflict! Get the plugin here:
    https://github.com/bphelp/bp-remove-profile-links

    @matthew_radich

    Participant

    @bp-help Thanks for the plugin. I have tried it out. I did have trouble with it conflicting with BP Docs (I believe). I have since uninstalled that plugin and now yours works fine.

    @sharmavishal

    Participant

    This code works 100% with latest BP

    function remove_xprofile_links() {
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action('bp_setup_globals', 'remove_xprofile_links');

    @commoneasy

    Participant

    sorry to bump this old topic. I use both BP 2.0.1 and BP custom fields type and i got the the links removed with:

    function remove_xprofile_links() {
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action('bp_setup_globals', 'remove_xprofile_links');

    I was wondering if you could use this to only hide the links from certain profile fields, like only for profile field 2, 6 & 7 ?

    @nicolecurioni

    Participant

    Thanks @sharmavishal I confirm, it works like charm 😉

    @nicolecurioni

    Participant

    @matthew_radich you should check out the code Sharmavishal wrote, it works great, and I also use Buddypress Xprofile Custom Fields. 🙂

Viewing 19 replies - 1 through 19 (of 19 total)
  • The topic ‘Remove profile links’ is closed to new replies.
Skip to toolbar