WordPress.org

Ready to get started?Download WordPress

Forums

myCRED
[resolved] Buddypress Profile Nav (myCred 1.1) (5 posts)

  1. kalesco
    Member
    Posted 8 months ago #

    For various reasons I cannot update WP and thus not myCred either.

    When using Buddypress I always get the History Nav item on the users' profile page, no matter what is set in the options.
    Is there a way to make this work (show only when it is set), without updating the plugin to a newer version?
    (code snippet, patch...)

    Thanks!

    http://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 8 months ago #

    Hey.

    If you are looking to completely remove the users log page from the users profile page you could try adding the following code snippet into your themes functions.php file:

    if ( class_exists( 'myCRED_BuddyPress' ) ) {
    	add_action( 'init', 'remove_mycred_log_from_bp' );
    	function remove_mycred_log_from_bp() {
    		$mycred = new myCRED_BuddyPress();
    		remove_action( 'bp_setup_nav', array( $buddypress, 'setup_nav' ) );
    	}
    }
  3. kalesco
    Member
    Posted 8 months ago #

    Thank you,
    I wanted to tweak it in v1.1 so that it would work as planned.
    Do you have any code snippet or suggestion what I could change?
    I have no problem in changing the plugin code (sorry) as I can't update it anyway.

    I took a look at the current versions code, but there must have changed more than just the profile menu code as using the code from the new version didn't change anything in the behaviour.
    I have added a IF around the profile nav item code and it kind of works. It shows the history for admins, but not users. However, it still doesn't react to the setting.

  4. Gabriel
    Member
    Plugin Author

    Posted 8 months ago #

    Ah! Apologies, I misunderstood your question.

    I have created this pastebin to show you how the setup_nav() function looks now that it works.

    You could replace your version of the same function and see if that helps.
    This function is located (in 1.1) in:

    plugins/mycred/addons/buddypress/myCRED-addon-buddypress.php starting at line 179

  5. kalesco
    Member
    Posted 8 months ago #

    Thank you!
    This worked perfectly!

Reply

You must log in to post.

About this Plugin

About this Topic