Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove profile links


  • jdhall1972
    Participant

    @jdhall1972

    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

    @allenpayne

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


    AllenPayne
    Participant

    @allenpayne

    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
    Keymaster

    @mercime

    @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

    @allenpayne

    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

    @praisehim

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


    bp-help
    Participant

    @bphelp

    @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

    @praisehim

    @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.


    bp-help
    Participant

    @bphelp

    @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

    @praisehim

    @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 🙁


    bp-help
    Participant

    @bphelp

    @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.


    bp-help
    Participant

    @bphelp

    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

    @praisehim

    @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!


    bp-help
    Participant

    @bphelp

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


    bp-help
    Participant

    @bphelp

    @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


    Matt Rad
    Participant

    @matthew_radich

    @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

    @sharmavishal

    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

    @commoneasy

    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 ?


    Nicole
    Participant

    @nicolecurioni

    Thanks @sharmavishal I confirm, it works like charm 😉


    Nicole
    Participant

    @nicolecurioni

    @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